]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix for #447: squelch connection refused tcp connection failures
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 19 Mar 2021 16:43:36 +0000 (17:43 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 19 Mar 2021 16:43:36 +0000 (17:43 +0100)
  from the log, unless verbosity is high.

doc/Changelog
util/netevent.c

index bce6fbee09843ecc687c346837e1b3961f3221a6..12d98eb211a5824e9db14d09bec5d9d03de426e4 100644 (file)
@@ -1,3 +1,7 @@
+19 March 2021: Wouter
+       - Fix for #447: squelch connection refused tcp connection failures
+         from the log, unless verbosity is high.
+
 17 March 2021: Wouter
        - Fix #441: Minimal NSEC range not accepted for top level domains.
 
index 6ef84133bed8e4281be6ea7393725007a9789a02..aac717f8d64eafc929d329e786c6a594b00a5432 100644 (file)
@@ -1633,6 +1633,10 @@ comm_point_tcp_handle_read(int fd, struct comm_point* c, int short_ok)
                        if(errno == ECONNRESET && verbosity < 2)
                                return 0; /* silence reset by peer */
 #endif
+#ifdef ECONNREFUSED
+                       if(errno == ECONNREFUSED && verbosity < 2)
+                               return 0; /* silence reset by peer */
+#endif
 #ifdef ENETUNREACH
                        if(errno == ENETUNREACH && verbosity < 2)
                                return 0; /* silence it */
@@ -1661,6 +1665,16 @@ comm_point_tcp_handle_read(int fd, struct comm_point* c, int short_ok)
                        }
 #endif
 #else /* USE_WINSOCK */
+                       if(WSAGetLastError() == WSAECONNREFUSED && verbosity < 2)
+                               return 0;
+                       if(WSAGetLastError() == WSAEHOSTDOWN && verbosity < 2)
+                               return 0;
+                       if(WSAGetLastError() == WSAEHOSTUNREACH && verbosity < 2)
+                               return 0;
+                       if(WSAGetLastError() == WSAENETDOWN && verbosity < 2)
+                               return 0;
+                       if(WSAGetLastError() == WSAENETUNREACH && verbosity < 2)
+                               return 0;
                        if(WSAGetLastError() == WSAECONNRESET)
                                return 0;
                        if(WSAGetLastError() == WSAEINPROGRESS)