]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Ignore and don't log ISC_R_NOTCONNECTED from uv_accept()
authorOndřej Surý <ondrej@sury.org>
Wed, 21 Oct 2020 22:17:03 +0000 (00:17 +0200)
committerEvan Hunt <each@isc.org>
Thu, 22 Oct 2020 22:00:07 +0000 (15:00 -0700)
When client disconnects before the connection can be accepted, the named
would log a spurious log message:

    error: Accepting TCP connection failed: socket is not connected

We now ignore the ISC_R_NOTCONNECTED result code and log only other
errors

(cherry picked from commit 5ef71c420fc118b506ad5a16bdb4a21fafdcda9c)

lib/isc/netmgr/tcp.c

index 6cdd9ddadfabb8e86a151663bf610646ad0e871c..e75a708b4efbd2ffdaba025fc9dd7dd0fc2aeb21 100644 (file)
@@ -517,9 +517,17 @@ error:
        if (sock->quota != NULL) {
                isc_quota_detach(&sock->quota);
        }
-       isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_NETMGR,
-                     ISC_LOG_ERROR, "Accepting TCP connection failed: %s",
-                     isc_result_totext(result));
+
+       switch (result) {
+       case ISC_R_NOTCONNECTED:
+               /* IGNORE: The client disconnected before we could accept */
+               break;
+       default:
+               isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+                             ISC_LOGMODULE_NETMGR, ISC_LOG_ERROR,
+                             "Accepting TCP connection failed: %s",
+                             isc_result_totext(result));
+       }
 
        /*
         * Detach the socket properly to make sure uv_close() is called.