mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-24 00:29:58 -05:00
- Fix tcp fastopen failure when disabled, try normal connect instead.
This commit is contained in:
parent
4b2799fdd6
commit
520fa84265
2 changed files with 15 additions and 3 deletions
|
|
@ -1,3 +1,6 @@
|
||||||
|
1 September 2021: Wouter
|
||||||
|
- Fix tcp fastopen failure when disabled, try normal connect instead.
|
||||||
|
|
||||||
27 August 2021: Wouter
|
27 August 2021: Wouter
|
||||||
- Fix #533: Negative responses get cached even when setting
|
- Fix #533: Negative responses get cached even when setting
|
||||||
cache-max-negative-ttl: 1
|
cache-max-negative-ttl: 1
|
||||||
|
|
|
||||||
|
|
@ -1863,13 +1863,22 @@ comm_point_tcp_handle_write(int fd, struct comm_point* c)
|
||||||
if(errno == EINTR || errno == EAGAIN)
|
if(errno == EINTR || errno == EAGAIN)
|
||||||
return 1;
|
return 1;
|
||||||
/* Not handling EISCONN here as shouldn't ever hit that case.*/
|
/* Not handling EISCONN here as shouldn't ever hit that case.*/
|
||||||
if(errno != EPIPE && errno != 0 && verbosity < 2)
|
if(errno != EPIPE
|
||||||
return 0; /* silence lots of chatter in the logs */
|
#ifdef EOPNOTSUPP
|
||||||
if(errno != EPIPE && errno != 0) {
|
/* if /proc/sys/net/ipv4/tcp_fastopen is
|
||||||
|
* disabled on Linux, sendmsg may return
|
||||||
|
* 'Operation not supported', if so
|
||||||
|
* fallthrough to ordinary connect. */
|
||||||
|
&& errno != EOPNOTSUPP
|
||||||
|
#endif
|
||||||
|
&& errno != 0) {
|
||||||
|
if(verbosity < 2)
|
||||||
|
return 0; /* silence lots of chatter in the logs */
|
||||||
log_err_addr("tcp sendmsg", strerror(errno),
|
log_err_addr("tcp sendmsg", strerror(errno),
|
||||||
&c->repinfo.addr, c->repinfo.addrlen);
|
&c->repinfo.addr, c->repinfo.addrlen);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
verbose(VERB_ALGO, "tcp sendmsg for fastopen failed (with %s), try normal connect", strerror(errno));
|
||||||
/* fallthrough to nonFASTOPEN
|
/* fallthrough to nonFASTOPEN
|
||||||
* (MSG_FASTOPEN on Linux 3 produces EPIPE)
|
* (MSG_FASTOPEN on Linux 3 produces EPIPE)
|
||||||
* we need to perform connect() */
|
* we need to perform connect() */
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue