mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-20 23:00:56 -05:00
- Fix #358: Squelch udp connect 'no route to host' errors on low
verbosity.
This commit is contained in:
parent
174bb48ae8
commit
5906811ff1
2 changed files with 36 additions and 3 deletions
|
|
@ -1,3 +1,7 @@
|
||||||
|
1 December 2020: Wouter
|
||||||
|
- Fix #358: Squelch udp connect 'no route to host' errors on low
|
||||||
|
verbosity.
|
||||||
|
|
||||||
30 November 2020: Wouter
|
30 November 2020: Wouter
|
||||||
- Fix assertion failure on double callback when iterator loses
|
- Fix assertion failure on double callback when iterator loses
|
||||||
interest in query at head of line that then has the tcp stream
|
interest in query at head of line that then has the tcp stream
|
||||||
|
|
|
||||||
|
|
@ -1745,6 +1745,33 @@ select_id(struct outside_network* outnet, struct pending* pend,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** return true is UDP connect error needs to be logged */
|
||||||
|
static int udp_connect_needs_log(int err)
|
||||||
|
{
|
||||||
|
switch(err) {
|
||||||
|
case ECONNREFUSED:
|
||||||
|
# ifdef ENETUNREACH
|
||||||
|
case ENETUNREACH:
|
||||||
|
# endif
|
||||||
|
# ifdef EHOSTDOWN
|
||||||
|
case EHOSTDOWN:
|
||||||
|
# endif
|
||||||
|
# ifdef EHOSTUNREACH
|
||||||
|
case EHOSTUNREACH:
|
||||||
|
# endif
|
||||||
|
# ifdef ENETDOWN
|
||||||
|
case ENETDOWN:
|
||||||
|
# endif
|
||||||
|
if(verbosity >= VERB_ALGO)
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Select random interface and port */
|
/** Select random interface and port */
|
||||||
static int
|
static int
|
||||||
select_ifport(struct outside_network* outnet, struct pending* pend,
|
select_ifport(struct outside_network* outnet, struct pending* pend,
|
||||||
|
|
@ -1804,9 +1831,11 @@ select_ifport(struct outside_network* outnet, struct pending* pend,
|
||||||
/* connect() to the destination */
|
/* connect() to the destination */
|
||||||
if(connect(fd, (struct sockaddr*)&pend->addr,
|
if(connect(fd, (struct sockaddr*)&pend->addr,
|
||||||
pend->addrlen) < 0) {
|
pend->addrlen) < 0) {
|
||||||
log_err_addr("udp connect failed",
|
if(udp_connect_needs_log(errno)) {
|
||||||
strerror(errno), &pend->addr,
|
log_err_addr("udp connect failed",
|
||||||
pend->addrlen);
|
strerror(errno), &pend->addr,
|
||||||
|
pend->addrlen);
|
||||||
|
}
|
||||||
sock_close(fd);
|
sock_close(fd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue