This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Network TCP Handler: stale socket disposal


On Thu, Aug 30, 2007 at 08:51:59AM -0500, John Mills wrote:
> Andrew -
> 
> On Wed, 29 Aug 2007, Andrew Lunn wrote:
> 
> > > Also, it may be the case that this
> > > issue has been solved in the FreeBSD sources.
> > 
> > http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/kern/uipc_socket.c#rev1.174
> > 
> > Looks like there are a few race conditions......
> 
> What would you expect as consequences of closing a socket that remained on 
> the 'accept' queue?

I've not looked at the code, so im guessing. 

It could be that select() has already woken up because there is now an
socket on the accept queue. The socket is then closed and removed from
the queue. accept() is called and it blocks since there is nothing on
the queue. This is now what the developer expected. Select said there
was a connection to accept...

Instead, if the socket is left on the queue, accpet() should see the
now closed socket, free it and return the error. 

    Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]