- Fix on windows to ignore connection failure on UDP, unless verbose.

This commit is contained in:
W.C.A. Wijngaards 2020-12-02 11:58:24 +01:00
parent eb052e1543
commit e049fb303c
2 changed files with 11 additions and 1 deletions

View File

@ -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

View File

@ -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