]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
ENOTCONN is an allowed error for connected UDP sockets
authorAlan T. DeKok <aland@freeradius.org>
Sat, 24 May 2025 12:39:38 +0000 (08:39 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 26 May 2025 19:25:25 +0000 (15:25 -0400)
src/lib/bio/fd_errno.h

index 41da53da73e43d7681d2a638cfe51caabf317275..72217af8114b21c77b605ce2d37cd80468bfdbd5 100644 (file)
@@ -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;