lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Re: [lwip] Freeing pbufs in tcp_input


From: Kieran Mansley
Subject: [lwip-users] Re: [lwip] Freeing pbufs in tcp_input
Date: Wed, 08 Jan 2003 23:38:30 -0000

On Fri, 11 Oct 2002, Holger Fried wrote:

> Hello,
>
> I think, incomming packets should be freed by the application. Or from the
> stack after the call of tcp_recved. But in tcp_input() is a call
> tcp_seg_free after passing the data to the application, which frees all
> pbufs in the seg regardless if the application has read or copied the data.
> Is this true and when isn't this wrong?

I can't see a tcp_seg_free anywhere that would have an impact - the only
calls to this are in relation to connection setup, and freeing things on
the unacked and unsent queue when an ACK is received.  (It might have
changed in the CVS version though).

There is a call to pbuf_free(inseg.p) in tcp_input.  However, if the
packet had any data to be passed to the application, this was stored on
pcb->recv_data, and inseg.p was set to be NULL to avoid this very problem
occuring.

Hope that helps,

Kieran

[This message was sent through the lwip discussion list.]




reply via email to

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