From: W.C.A. Wijngaards Date: Wed, 2 Dec 2020 10:58:24 +0000 (+0100) Subject: - Fix on windows to ignore connection failure on UDP, unless verbose. X-Git-Tag: release-1.13.1rc1~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e049fb303c39eef9cda4a70c6e161819d7e08ffd;p=thirdparty%2Funbound.git - Fix on windows to ignore connection failure on UDP, unless verbose. --- diff --git a/doc/Changelog b/doc/Changelog index 9bb31615f..9d055b5df 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -5,6 +5,7 @@ - Fix #356: deadlock when listening tcp. - Fix unbound-dnstap-socket to not use log routine from interrupt handler and not print so frequently when invoked in sequence. + - Fix on windows to ignore connection failure on UDP, unless verbose. 1 December 2020: Wouter - Fix #358: Squelch udp connect 'no route to host' errors on low diff --git a/util/netevent.c b/util/netevent.c index 98796a788..e7a674f8a 100644 --- a/util/netevent.c +++ b/util/netevent.c @@ -583,6 +583,7 @@ comm_point_send_udp_msg_if(struct comm_point *c, sldns_buffer* packet, static int udp_recv_needs_log(int err) { switch(err) { +#ifndef USE_WINSOCK case ECONNREFUSED: # ifdef ENETUNREACH case ENETUNREACH: @@ -596,6 +597,13 @@ static int udp_recv_needs_log(int err) # ifdef ENETDOWN case ENETDOWN: # endif +#else /* USE_WINSOCK */ + case WSAECONNREFUSED: + case WSAENETUNREACH: + case WSAEHOSTDOWN: + case WSAEHOSTUNREACH: + case WSAENETDOWN: +#endif if(verbosity >= VERB_ALGO) return 1; return 0; @@ -736,7 +744,8 @@ comm_point_udp_callback(int fd, short event, void* arg) #else if(WSAGetLastError() != WSAEINPROGRESS && WSAGetLastError() != WSAECONNRESET && - WSAGetLastError()!= WSAEWOULDBLOCK) + WSAGetLastError()!= WSAEWOULDBLOCK && + udp_recv_needs_log(WSAGetLastError())) log_err("recvfrom failed: %s", wsa_strerror(WSAGetLastError())); #endif