]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
netmgr: Always load the result from async socket
authorOndřej Surý <ondrej@sury.org>
Fri, 6 Nov 2020 12:11:08 +0000 (13:11 +0100)
committerOndřej Surý <ondrej@sury.org>
Wed, 9 Dec 2020 09:46:16 +0000 (10:46 +0100)
Because we use result earlier for setting the loadbalancing on the
socket, we could be left with a ISC_R_NOTIMPLEMENTED value stored in the
variable and when the UDP connection would succeed, we would
errorneously return this value instead of ISC_R_SUCCESS.

(cherry picked from commit 050258bda4a45faf18baaf3879a9da160d2230fe)

lib/isc/netmgr/udp.c

index 27e11fc1656611dd75314a4f5d17dd3384cc9097..2c3b61965f538b7e43d3aaf1c7ddc5bf55584141 100644 (file)
@@ -839,9 +839,7 @@ isc_nm_udpconnect(isc_nm_t *mgr, isc_nmiface_t *local, isc_nmiface_t *peer,
                isc__nm_uvreq_put(&req, sock);
        }
 
-       if (atomic_load(&sock->result) != ISC_R_SUCCESS) {
-               result = atomic_load(&sock->result);
-       }
+       result = atomic_load(&sock->result);
 
        isc__nmsocket_detach(&tmp);