[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Zero-length pbuf

From: address@hidden
Subject: Re: [lwip-users] Zero-length pbuf
Date: Thu, 11 Dec 2008 21:03:49 +0100
User-agent: Thunderbird (Macintosh/20081105)

At least from reading your post (not reading the source code), it seems you're right. Could you file a bug at http://savannah.nongnu.org/bugs/?group=lwip ?


Charles Landau wrote:
In lwIP version 1.3.0, in core/tcp_out.c, starting at line 336 the code appends the pbuf chain queue->p to the unsent queue useg. When so doing it removes the TCP header from queue->p because useg already has a header.

It can happen that the pbuf chain queue->p is a chain of two (or more) pbufs, the first of which has only a TCP header (added at line 258). Removing the TCP header leaves this pbuf with a zero length. Appending this to useg using pbuf_cat() leaves the zero length pbuf in the chain. This leaves a useless zero length pbuf allocated and taking up space limited by TCP_SND_QUEUELEN.

I suggest in this case the zero length pbuf should be freed and only the rest of its chain appended to useg.

lwip-users mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]