[ECOS] Re: RedBoot TCP socket stays in TIME_WAIT state forever.

Grant Edwards grante@visi.com
Mon Apr 10 13:41:00 GMT 2006

>>> AFAICT, the only way to get out of _TIME_WAIT state is if
>>> somebody called tcp_send() while in that state so that a timer
>>> gets set with the do_close() callback.
>>> How would tcp_send() ever get called once we've hit step 4)
>>> above?  Everything's been ACKed so there is no reason for the
>>> stack itself to ever try to send anything, and calling
>>> __tcp_write() in the application code is just going to return
>>> immediately becuase the socket isn't in a valid state for
>>> calling write().
>>> Shouldn't the 1s/2m timer be set when the socket transitions to
>>> the _TIME_WAIT state?
>> Moving __timer_set(&s->timer, s->reuse ? 1000 : 120000, do_close, s)
>> to the places where the state transitions to _TIME_WAIT seems to 
>> have fixed the problem.
> Would you like to propose an actual patch for this, please?

Yes, it's on my list of things to do.

> Also, do you have a test case (or way to show the problem)?

I suppose I could add an "exit" command to RedBoot's telnet
server that would demonstrate the problem.

Grant Edwards

Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

More information about the Ecos-discuss mailing list