[Top][All Lists]

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

[lwip-devel] [bug #25094] Zero-length pbuf

From: Charles Landau
Subject: [lwip-devel] [bug #25094] Zero-length pbuf
Date: Sun, 14 Dec 2008 18:09:05 +0000
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv: Gecko/2008102920 Firefox/3.0.4


                 Summary: Zero-length pbuf
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: clandau
            Submitted on: Sun 14 Dec 2008 06:09:03 PM GMT
                Category: TCP
                Severity: 3 - Normal
              Item Group: Feature Request
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 
            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.

Even better, if it is possible, would be to not add a TCP header until it is
known that the packet won't be concatenated to the queue. 


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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