]> 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>
Sat, 7 Nov 2020 20:12:08 +0000 (21:12 +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.

lib/isc/netmgr/udp.c

index aa058ce06d68c647f8321195f6b493b50187275e..05e490a6f27bcc22cdbd49ae0541d5be1d9195e0 100644 (file)
@@ -841,9 +841,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);