lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Re: [lwip] tcp_pcb_purge() function - question


From: Adam Dunkels
Subject: [lwip-users] Re: [lwip] tcp_pcb_purge() function - question
Date: Wed, 08 Jan 2003 23:27:28 -0000

Hi!

On Thursday 24 January 2002 15.42, you wrote:
> In the function tcp_pcb_remove - there is a  call to the function -
> tcp_pcb_purge(). My question is regarding to the condition in this function
> (tcp_pcb_purge) - why there is a check for the state to be LISTEN ,
> TIME_WAIT or CLOSED. If the pcb is going to be removed , whould have
> expected to delete all the segments on this socket? - Doesn't this could
> cause to memory leak? Thanks.

The check is made becase connections in LISTEN, TIME-WAIT or CLOSED doesn't 
have any queued segments. Connections in LISTEN are also handled by a smaller 
structure than the tcp_seg struct, so they doesn't even have such a queue, so 
calling tcp_segs_free() could produce some very dangerous results. 
(Connections in TIME-WAIT used to be handled by a smaller structure as well, 
but this was changed for version 0.4.x.)

/adam
-- 
Adam Dunkels <address@hidden>
http://www.sics.se/~adam
[This message was sent through the lwip discussion list.]




reply via email to

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