lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #22530] api_msg.c's recv_raw() does not consume data


From: Jonathan Larmour
Subject: [lwip-devel] [bug #22530] api_msg.c's recv_raw() does not consume data
Date: Mon, 10 Mar 2008 13:25:30 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.12) Gecko/20070530 Fedora/1.5.0.12-1.fc5 Firefox/1.5.0.12

Follow-up Comment #1, bug #22530 (project lwip):

I agree that this is a bug. recv_raw should not assume that if it hasn't
"eaten" the data it will continue unmodified.

Although I don't think the suggested fix is correct. That would produce odd
behaviour that would change depending on exactly when an application makes a
call to receive a packet or not. It would not be reliable.

The correct answer is probably to still not "eat" the packet, but to copy the
pbuf entirely into a new pbuf. The reason we don't "eat" the packet is because
we don't know whether the data is definitely for us or not. It's the same
principle as raw_input() which tries all the raw PCBs in turn until one of
them eats the data - it doesn't know which one the data is really for. It
would be more wrong to "eat" the data before it reaches the PCB that actually
uses it, than to duplicate the data.


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?22530>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

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