[Top][All Lists]

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

[lwip-devel] [task #7675] Enable to refuse data on a TCP_EVENT_RECV call

From: Simon Goldschmidt
Subject: [lwip-devel] [task #7675] Enable to refuse data on a TCP_EVENT_RECV call
Date: Sat, 19 Jan 2008 10:39:11 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv: Gecko/20071127 Firefox/

Update of task #7675 (project lwip):

             Open/Closed:                  Closed => Open                   


Follow-up Comment #10:

After going through the changes made for this task, I think there might be
another bug in here. Since it's only from reading the code, I might be wrong
(then please tell me :):

Prior to the changes (processing the return value of TCP_EVENT_RECV), the raw
API relied on the application callbacks to always deallocate the pbuf it
received, regardless of the return value. Now (in tcp_input - tcp_in.c:326) we
rely on the pbuf 'recv_data' still being valid after the recv callback is
called. With old applications, this might lead to accessing a pbuf which is
already deallocated!

Increasing recv_data->ref doesn't help either, since behaviour might be mixed
(old apps free the pbuf, new apps + netconn API don't).
For a start, a simple ASSERT(recv_data->ref != 0) might work...

Note that this would not happen if we wouldn't ACK the data before trying to
give it to the recv callback, but we delayed that until after 1.3.0 since it
implies a rather big change in tcp_in.c :-(


Reply to this item at:


  Nachricht geschickt von/durch Savannah

reply via email to

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