[Top][All Lists]

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

[lwip-users] Zero-length pbuf

From: Charles Landau
Subject: [lwip-users] Zero-length pbuf
Date: Thu, 11 Dec 2008 10:46:08 -0800
User-agent: Thunderbird (Macintosh/20081105)

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.

reply via email to

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