"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
gotd accept error handling
To:
gameoftrees@openbsd.org
Date:
Thu, 25 Sep 2025 15:19:55 +0200

Download raw body.

Thread
Prevent gotd looping on unhandled errors raised by accept().

gotd would somehow loop on ENOTSOCK in a case observed by "noodle" on IRC.
For now, exit the event loop if an unknown accept error occurs rather
sending a storm of errors to syslog.

ok?

(I do not understand the root cause of the ENOTSOCK issue. Any ideas?)

1 file changed, 4 insertions(+), 0 deletions(-)

commit - 7979059dc7b358f427b7f2293a2e30b2337a3185
commit + eb635f16ef20c2f8a5b7721adf77a68cbab8e57b
blob - 1b329e140c2f97f1c42c73270630a5094c1e2b26
blob + ed7d64ae64a9f407da94123ef917c0c8d3bb05ed
--- gotd/listen.c
+++ gotd/listen.c
@@ -303,6 +303,10 @@ gotd_accept(int fd, short event, void *arg)
 			return;
 		default:
 			log_warn("accept");
+
+			/* Prevent endless looping on errors. */
+			event_del(&iev->ev);
+			event_loopexit(NULL);
 			return;
 		}
 	}