]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix error codes passed to connection callbacks
authorMichał Kępień <michal@isc.org>
Tue, 28 Dec 2021 14:09:50 +0000 (15:09 +0100)
committerMichał Kępień <michal@isc.org>
Tue, 28 Dec 2021 14:09:50 +0000 (15:09 +0100)
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.

lib/isc/netmgr/tcp.c
lib/isc/netmgr/tcpdns.c
lib/isc/netmgr/tlsdns.c

index eb6437d8d4a862374818edc09f94854b80aa347b..b818f41a20038cb296913596d0e1c2d1b7f19f51 100644 (file)
@@ -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;
index 9167e52bb5f7360b2d9d76bcba105bdbacd9dffc..ebb1ec8e8fc579853a385c4f2521ec8c251b4793 100644 (file)
@@ -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;
index 137a1709cd276f7952abf20a973200717156f37d..0e34b95011c85f9055a7630640a0ad531ca8d820 100644 (file)
@@ -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;