From: Michał Kępień Date: Tue, 28 Dec 2021 14:09:50 +0000 (+0100) Subject: Fix error codes passed to connection callbacks X-Git-Tag: v9.17.22~22^2 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=ea89ab80ae3594b45ab751ae6b249e64e59ddf60;p=thirdparty%2Fbind9.git Fix error codes passed to connection callbacks Commit 9ee60e7a17bf34c7ef7f4d79e6a00ca45444ec8c erroneously introduced duplicate conditions to several existing conditional statements responsible for determining error codes passed to connection callbacks upon failure. Fix the affected expressions to ensure connection callbacks are invoked with: - the ISC_R_SHUTTINGDOWN error code when a global netmgr shutdown is in progress, - the ISC_R_CANCELED error code when a specific operation has been canceled. This does not fix any known bugs, it only adjusts the changes introduced by commit 9ee60e7a17bf34c7ef7f4d79e6a00ca45444ec8c so that they match its original intent. --- diff --git a/lib/isc/netmgr/tcp.c b/lib/isc/netmgr/tcp.c index eb6437d8d4a..b818f41a200 100644 --- a/lib/isc/netmgr/tcp.c +++ b/lib/isc/netmgr/tcp.c @@ -247,7 +247,7 @@ tcp_connect_cb(uv_connect_t *uvreq, int status) { */ isc__nm_uvreq_put(&req, sock); return; - } else if (isc__nmsocket_closing(sock)) { + } else if (isc__nm_closing(sock)) { /* Network manager shutting down */ result = ISC_R_SHUTTINGDOWN; goto error; diff --git a/lib/isc/netmgr/tcpdns.c b/lib/isc/netmgr/tcpdns.c index 9167e52bb5f..ebb1ec8e8fc 100644 --- a/lib/isc/netmgr/tcpdns.c +++ b/lib/isc/netmgr/tcpdns.c @@ -214,7 +214,7 @@ tcpdns_connect_cb(uv_connect_t *uvreq, int status) { REQUIRE(VALID_UVREQ(req)); REQUIRE(VALID_NMHANDLE(req->handle)); - if (isc__nmsocket_closing(sock)) { + if (isc__nm_closing(sock)) { /* Network manager shutting down */ result = ISC_R_SHUTTINGDOWN; goto error; diff --git a/lib/isc/netmgr/tlsdns.c b/lib/isc/netmgr/tlsdns.c index 137a1709cd2..0e34b95011c 100644 --- a/lib/isc/netmgr/tlsdns.c +++ b/lib/isc/netmgr/tlsdns.c @@ -230,7 +230,7 @@ tlsdns_connect_cb(uv_connect_t *uvreq, int status) { REQUIRE(VALID_UVREQ(req)); REQUIRE(VALID_NMHANDLE(req->handle)); - if (isc__nmsocket_closing(sock)) { + if (isc__nm_closing(sock)) { /* Network manager shutting down */ result = ISC_R_SHUTTINGDOWN; goto error;