From: Alan T. DeKok Date: Sat, 24 May 2025 12:39:38 +0000 (-0400) Subject: ENOTCONN is an allowed error for connected UDP sockets X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1714591ad962da05d52ffd289a15fa399bffe8b;p=thirdparty%2Ffreeradius-server.git ENOTCONN is an allowed error for connected UDP sockets --- diff --git a/src/lib/bio/fd_errno.h b/src/lib/bio/fd_errno.h index 41da53da73e..72217af8114 100644 --- a/src/lib/bio/fd_errno.h +++ b/src/lib/bio/fd_errno.h @@ -27,21 +27,22 @@ case EAGAIN: } return fr_bio_error(IO_WOULD_BLOCK); -#ifndef NDEBUG -case ENOTCONN: /* - * We're doing a read/write to a socket which isn't connected. This is a failure of the - * application state machine. + * We're reading / writing a connected UDP socket, and the other end has gone away. */ - fr_assert(0); - break; -#endif +case ENOTCONN: + /* + * The other end of a socket has closed the connection. + */ case ECONNRESET: + + /* + * The other end of a pipe has closed the connection. + */ case EPIPE: /* - * The other end closed the connection, signal the application that it's a (maybe) clean close, - * and set EOF on the BIO. + * The connection is no longer usable, close it. */ fr_bio_eof(&my->bio); return 0;