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

Ferry Huberts (spam-protected)
Fri Aug 24 15:13:40 CEST 2012


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);
-- 
1.7.11.4





More information about the Olsr-dev mailing list