]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
set src_port if it's zero, too
authorAlan T. DeKok <aland@freeradius.org>
Fri, 20 Dec 2024 15:41:03 +0000 (10:41 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 20 Dec 2024 22:24:29 +0000 (17:24 -0500)
src/lib/bio/fd.c

index 896dd62fc214ddf20c67d05ac7f4a7d1f4f6b0c8..74707074cb7b51c6e2e197374ce743cbf8848552 100644 (file)
@@ -634,7 +634,10 @@ int fr_bio_fd_socket_name(fr_bio_fd_t *my)
        /*
         *      Already set: do nothing.
         */
-       if (!fr_ipaddr_is_inaddr_any(&my->info.socket.inet.src_ipaddr)) return 0;
+       if (!fr_ipaddr_is_inaddr_any(&my->info.socket.inet.src_ipaddr) &&
+           (my->info.socket.inet.src_port != 0)) {
+               return 0;
+       }
 
        /*
         *      FreeBSD jail issues.  We bind to 0.0.0.0, but the