From: W.C.A. Wijngaards Date: Fri, 19 Mar 2021 16:43:36 +0000 (+0100) Subject: - Fix for #447: squelch connection refused tcp connection failures X-Git-Tag: release-1.13.2rc1~242 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57d4c3a8a4592cf1411c2600bb2debcddcc2416d;p=thirdparty%2Funbound.git - Fix for #447: squelch connection refused tcp connection failures from the log, unless verbosity is high. --- diff --git a/doc/Changelog b/doc/Changelog index bce6fbee0..12d98eb21 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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. diff --git a/util/netevent.c b/util/netevent.c index 6ef84133b..aac717f8d 100644 --- a/util/netevent.c +++ b/util/netevent.c @@ -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)