]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix the outgoing UDP socket selection on Windows
authorOndřej Surý <ondrej@isc.org>
Thu, 13 May 2021 13:04:48 +0000 (15:04 +0200)
committerOndřej Surý <ondrej@isc.org>
Thu, 13 May 2021 13:04:48 +0000 (15:04 +0200)
The outgoing UDP socket selection would pick unintialized children
socket on Windows, because we have more netmgr workers than we have
listening sockets.  This commit fixes the selection by keeping the
outgoing socket the same, so it's always run on existing socket.

lib/isc/netmgr/udp.c

index ba61418ce08471992d4f563cb938893e7907912e..b8a40d99f565f06af97e8b87760286537aebff9c 100644 (file)
@@ -481,12 +481,17 @@ isc__nm_udp_send(isc_nmhandle_t *handle, const isc_region_t *region,
                 */
                INSIST(sock->parent != NULL);
 
+#if defined(WIN32)
+               /* On Windows, we have only a single listening listener */
+               rsock = sock;
+#else
                if (isc__nm_in_netthread()) {
                        ntid = isc_nm_tid();
                } else {
                        ntid = sock->tid;
                }
                rsock = &sock->parent->children[ntid];
+#endif
        }
 
 send: