]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- If MSG_FASTOPEN gives EPIPE fallthrough to try normal tcp write.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 31 May 2017 11:09:15 +0000 (11:09 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 31 May 2017 11:09:15 +0000 (11:09 +0000)
git-svn-id: file:///svn/unbound/trunk@4201 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
util/netevent.c

index 79d166501ed9850fbf112e418e683bf86725647a..b30fbe00921f939a34938281fe492beec941fb1a 100644 (file)
@@ -1,5 +1,6 @@
 31 May 2017: Wouter
        - Fix #1273: cachedb.c doesn't compile with -Wextra.
+       - If MSG_FASTOPEN gives EPIPE fallthrough to try normal tcp write.
 
 30 May 2017: Ralph
        - Fix #1269: inconsistent use of built-in local zones with views.
index ef4f24aaba252c24fd7c7544a4b5ee3d0d642a7f..dcb9cb5adcd8d87492aec64ad192891fc81f82a5 100644 (file)
@@ -1407,12 +1407,15 @@ comm_point_tcp_handle_write(int fd, struct comm_point* c)
                        if(errno == EINTR || errno == EAGAIN)
                                return 1;
                        /* Not handling EISCONN here as shouldn't ever hit that case.*/
-                       if(errno != 0 && verbosity < 2)
+                       if(errno != EPIPE && errno != 0 && verbosity < 2)
                                return 0; /* silence lots of chatter in the logs */
-                       else if(errno != 0) 
+                       if(errno != EPIPE && errno != 0) {
                                log_err_addr("tcp sendmsg", strerror(errno),
                                        &c->repinfo.addr, c->repinfo.addrlen);
-                       return 0;
+                               return 0;
+                       }
+                       /* fallthrough to nonFASTOPEN
+                        * (MSG_FASTOPEN on Linux 3 produces EPIPE) */
                } else {
                        c->tcp_byte_count += r;
                        if(c->tcp_byte_count < sizeof(uint16_t))