Skip to content

Commit

Permalink
- Fix to squelch permission denied and other errors from remote host,
Browse files Browse the repository at this point in the history
  they are logged at higher verbosity but not on low verbosity.
  • Loading branch information
wcawijngaards committed Dec 11, 2020
1 parent a4fc328 commit 7077660
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/Changelog
@@ -1,5 +1,7 @@
11 December 2020: Wouter
- Fix #371: unbound-control timeout when Unbound is not running.
- Fix to squelch permission denied and other errors from remote host,
they are logged at higher verbosity but not on low verbosity.

3 December 2020: Wouter
- make depend.
Expand Down
21 changes: 21 additions & 0 deletions util/netevent.c
Expand Up @@ -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) {
case EACCES: /* some hosts send ICMP 'Permission Denied' */
#ifndef USE_WINSOCK
case ECONNREFUSED:
# ifdef ENETUNREACH
Expand Down Expand Up @@ -1609,6 +1610,26 @@ 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 ENETUNREACH
if(errno == ENETUNREACH && verbosity < 2)
return 0; /* silence it */
#endif
#ifdef EHOSTDOWN
if(errno == EHOSTDOWN && verbosity < 2)
return 0; /* silence it */
#endif
#ifdef EHOSTUNREACH
if(errno == EHOSTUNREACH && verbosity < 2)
return 0; /* silence it */
#endif
#ifdef ENETDOWN
if(errno == ENETDOWN && verbosity < 2)
return 0; /* silence it */
#endif
#ifdef EACCES
if(errno == EACCES && verbosity < 2)
return 0; /* silence it */
#endif
#ifdef ENOTCONN
if(errno == ENOTCONN) {
log_err_addr("read (in tcp s) failed and this could be because TCP Fast Open is enabled [--disable-tfo-client --disable-tfo-server] but does not work", sock_strerror(errno),
Expand Down

0 comments on commit 7077660

Please sign in to comment.