From: Ondřej Surý Date: Fri, 6 Nov 2020 12:11:08 +0000 (+0100) Subject: netmgr: Always load the result from async socket X-Git-Tag: v9.16.11~17^2~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21daa258a26342b7560f015b5d4468120ac68cc3;p=thirdparty%2Fbind9.git netmgr: Always load the result from async socket 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) --- diff --git a/lib/isc/netmgr/udp.c b/lib/isc/netmgr/udp.c index 27e11fc1656..2c3b61965f5 100644 --- a/lib/isc/netmgr/udp.c +++ b/lib/isc/netmgr/udp.c @@ -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);