nuttx-apps/netutils
Ricard Rosson 01ff92f794 netutils/telnetd: survive transient connection errors instead of exiting
Any single failed connection killed the whole daemon:

- A peer that resets before the accept completes (a port scanner, or a
  simple "nc -z" probe) surfaces as an accept4() error such as
  ECONNABORTED, which took the errout path and closed the listener.
- The per-connection error paths after a successful accept (setsockopt,
  opening /dev/telnet, SIOCTELNET, opening the session device, spawning
  the session) likewise exited the daemon instead of dropping the one
  connection.

Either way, one bad or aborted connection and the telnet console is
dead until reboot - a trivial remote way to take out the NuttX console
on any reachable network.  Verified on hardware: one "nc -zv" probe
permanently killed the listener.

Treat these as per-connection failures: drop the connection and keep
accepting.  Genuinely unrecoverable accept4() errors (EBADF, ENOTSOCK,
EINVAL, EOPNOTSUPP - a bad listen socket) still exit loudly, and a
short pause on repeated transient failures avoids busy-spinning while
an interface is down.  Daemon setup errors (socket/bind/listen) exit
as before.

Assisted-by: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Ricard Rosson <ricard@groundbits.com>
2026-07-23 19:00:43 +01:00
..
bare netutils: Add BARE 2026-01-23 11:05:48 -03:00
chat apps: Fix unchecked strdup()/asprintf() as requested in #1727 2026-05-23 16:30:52 -04:00
cjson netutils/cjson: fix apps path in CMake 2026-03-26 20:18:52 -04:00
cmux include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
codecs !fsutils/passwd: Replace TEA with PBKDF2-HMAC-SHA256 2026-07-22 17:21:22 +08:00
connectedhomeip netutils: migrate the license to ASF 2024-12-21 13:53:10 +08:00
cwebsocket netutils: migrate the license to ASF 2024-12-21 13:53:10 +08:00
dhcp6c include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
dhcpc netutils/dhcpc: parse DHCP NTP server option 2026-04-24 10:44:08 -03:00
dhcpd !apps: replace sclock_t with clock_t and drop redundant time_t/off_t casts 2026-05-11 17:38:32 +08:00
discover include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
dropbear !fsutils/passwd: Replace TEA with PBKDF2-HMAC-SHA256 2026-07-22 17:21:22 +08:00
esp8266 include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
ftpc apps: Fix unchecked strdup()/asprintf() as requested in #1727 2026-05-23 16:30:52 -04:00
ftpd apps: Fix unchecked strdup()/asprintf() as requested in #1727 2026-05-23 16:30:52 -04:00
iperf iperf: compatible work with no IPv4 2026-01-04 00:06:17 +08:00
iptables netutils: migrate the license to ASF 2024-12-21 13:53:10 +08:00
jsoncpp netutils: migrate the license to ASF 2024-12-21 13:53:10 +08:00
libcoap netutils: migrate the license to ASF 2024-12-21 13:53:10 +08:00
libcurl4nx include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
libshvc apps: fix distclean for partial builds and residual .kconfig files 2026-07-09 09:25:33 +08:00
libulut apps: fix distclean for partial builds and residual .kconfig files 2026-07-09 09:25:33 +08:00
libwebsockets netutils/libwebsockets: Fix error regarding building with CMake 2026-06-16 14:27:29 -03:00
mdns include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
mqttc netutils/mqttc: fix patch and add mbedtls dependency 2026-04-10 12:23:37 -03:00
nanopb netutils/nanopb: fix unpack step for MACOS 2025-07-14 15:48:08 -03:00
netcat netutils: migrate the license to ASF 2024-12-21 13:53:10 +08:00
netinit !apps: drop CONFIG_SYSTEM_TIME64 conditionals 2026-05-11 17:38:32 +08:00
netlib netlib: replace DNS ping with gateway ping for connectivity check 2026-05-14 11:58:15 +08:00
nng netutils/nng: Update help for NETUTILS_NNG 2026-01-21 09:48:11 +08:00
ntpclient !apps: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-22 13:38:25 +08:00
paho_mqtt paho_mqtt: Add mqtt compilation files 2025-12-25 12:20:17 +08:00
ping icmpv6_ping.c: change socket type from SOCK_DGRAM to SOCK_RAW. 2026-01-19 22:52:06 +08:00
plcatool netutils: Add plcatool 2025-09-17 19:29:10 +08:00
pppd include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
ptpd !apps: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-22 13:38:25 +08:00
rexec netutils/rexec: initialize ret to avoid maybe-uninitialized 2026-06-27 08:47:46 -03:00
rexecd netutils/rexecd: add -t option to serve connections without a thread 2026-06-30 13:46:37 +08:00
rtptools netutils: migrate the license to ASF 2024-12-21 13:53:10 +08:00
smtp netutils: smtp: treat recv EOF as an error 2026-07-09 09:29:57 +08:00
telnetc Remove unused header files across multiple source files 2025-01-10 21:42:00 +08:00
telnetd netutils/telnetd: survive transient connection errors instead of exiting 2026-07-23 19:00:43 +01:00
tftpc include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
thttpd netutils/thttpd: Apply the same check to related allocation sites 2026-05-23 16:30:52 -04:00
wakaama wakaama: add support for TLV 2026-05-18 16:18:53 -04:00
wakeonlan netutils: migrate the license to ASF 2024-12-21 13:53:10 +08:00
webclient include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
webserver apps: Fix unchecked strdup()/asprintf() as requested in #1727 2026-05-23 16:30:52 -04:00
xedge netutils/xedge: refactor Makefile to use git clone instead of zip downloads 2025-08-02 10:00:20 -03:00
xmlrpc netutils: migrate the license to ASF 2024-12-21 13:53:10 +08:00
.gitignore build: Remve the unnecessary .gitignore 2020-05-23 15:56:35 +01:00
CMakeLists.txt netutils: migrate the license to ASF 2024-12-21 13:53:10 +08:00
Make.defs netutils: migrate the license to ASF 2024-12-21 13:53:10 +08:00
Makefile netutils: migrate the license to ASF 2024-12-21 13:53:10 +08:00