[Olsr-dev] [PATCH v1 1/2] net_olsr: rephrase 'enough space in buffer' condition

Ferry Huberts (spam-protected)
Fri Aug 24 16:17:58 CEST 2012


both patches are meant for the release branch as well

On 24-08-12 15:13, Ferry Huberts wrote:
> From: Ferry Huberts <(spam-protected)>
>
> Signed-off-by: Ferry Huberts <(spam-protected)>
> ---
>   src/net_olsr.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/net_olsr.c b/src/net_olsr.c
> index 66e103d..de5d33a 100644
> --- a/src/net_olsr.c
> +++ b/src/net_olsr.c
> @@ -224,7 +224,7 @@ net_output_pending(const struct interface * ifp)
>   int
>   net_outbuffer_push(struct interface *ifp, const void *data, const uint16_t size)
>   {
> -  if ((ifp->netbuf.pending + size) > ifp->netbuf.maxsize)
> +  if ((int)size > net_outbuffer_bytes_left(ifp))
>       return 0;
>
>     memcpy(&ifp->netbuf.buff[ifp->netbuf.pending + OLSR_HEADERSIZE], data, size);
>

-- 
Ferry Huberts




More information about the Olsr-dev mailing list