lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] Potential bug in tcp_close 1.4.2 rc1


From: Kieran Mansley
Subject: Re: [lwip-devel] Potential bug in tcp_close 1.4.2 rc1
Date: Fri, 25 Mar 2011 09:18:54 +0000

On Thu, 2011-03-24 at 15:46 -0600, Brent Kucera wrote:
> 
> You are correct, the problem is that when I shut down the server
> (calling
> echo_close, which calls tcp_close), then restart the server, tcp_bind
> fails
> with ERR_USE.I think it shouldn't because if I close a connection,
> that port
> ought to be free regardless of what the other side does.

I think the current behaviour might be correct, but I don't have the
time today to check to be sure.  The side of the connection that does
the close first will take longer to get to a point where the port can be
re-used.  This is a consequence of the TCP state machine and the way it
is careful to avoid packets from an earlier connection being interpreted
as for a new connection.  I think SO_REUSE is the right thing to do.
You might want to check that if you wait a couple of minutes and restart
your server that it is then able to get the port.  This sort of thing
shows itself on other platforms like Linux too.

Kieran




reply via email to

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