[Toybox] [PATCH] telnetd: handle TIME_WAIT better.

enh enh at google.com
Thu Apr 22 19:00:35 PDT 2021


After a network outage, a long-running telnetd was spinning trying to
read from a socket that was in TIME_WAIT. It's easy to reproduce this by
using the regular telnet client and typing ^]^D to exit abruptly.

I don't think these sockets should ever have been non-blocking, and we
want to give up on the client if we hit EOF. All of this needs
rewriting to be less complicated (and not use select(2)), but this seems
to be a minimal fix for the spin without harming normal usage (where by
"usage" I mean "testing the telnet client").
---
 toys/pending/telnetd.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20210422/398fdb66/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-telnetd-handle-TIME_WAIT-better.patch
Type: text/x-patch
Size: 3015 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20210422/398fdb66/attachment-0002.bin>


More information about the Toybox mailing list