mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-20 23:00:56 -05:00
- Fix to squelch tcp socket bind failures when the interface is gone.
This commit is contained in:
parent
71f311dbe1
commit
90d0f8bc19
2 changed files with 9 additions and 1 deletions
|
|
@ -5,6 +5,7 @@
|
||||||
4 May 2021: Wouter
|
4 May 2021: Wouter
|
||||||
- Merge #478: Allow configuration of TCP timeout while waiting for
|
- Merge #478: Allow configuration of TCP timeout while waiting for
|
||||||
response.
|
response.
|
||||||
|
- Fix to squelch tcp socket bind failures when the interface is gone.
|
||||||
|
|
||||||
3 May 2021: Wouter
|
3 May 2021: Wouter
|
||||||
- Fix #481: Fix comment in configuration file.
|
- Fix #481: Fix comment in configuration file.
|
||||||
|
|
|
||||||
|
|
@ -238,7 +238,14 @@ pick_outgoing_tcp(struct pending_tcp* pend, struct waiting_tcp* w, int s)
|
||||||
((struct sockaddr_in6*)&pi->addr)->sin6_port = 0;
|
((struct sockaddr_in6*)&pi->addr)->sin6_port = 0;
|
||||||
else ((struct sockaddr_in*)&pi->addr)->sin_port = 0;
|
else ((struct sockaddr_in*)&pi->addr)->sin_port = 0;
|
||||||
if(bind(s, (struct sockaddr*)&pi->addr, pi->addrlen) != 0) {
|
if(bind(s, (struct sockaddr*)&pi->addr, pi->addrlen) != 0) {
|
||||||
log_err("outgoing tcp: bind: %s", sock_strerror(errno));
|
#ifndef USE_WINSOCK
|
||||||
|
#ifdef EADDRNOTAVAIL
|
||||||
|
if(!(verbosity < 4 && errno == EADDRNOTAVAIL))
|
||||||
|
#endif
|
||||||
|
#else /* USE_WINSOCK */
|
||||||
|
if(!(verbosity < 4 && WSAGetLastError() == WSAEADDRNOTAVAIL))
|
||||||
|
#endif
|
||||||
|
log_err("outgoing tcp: bind: %s", sock_strerror(errno));
|
||||||
sock_close(s);
|
sock_close(s);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue