]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix issue on macOX 10.10 where TCP fast open is detected but not
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 21 Aug 2017 11:44:46 +0000 (11:44 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 21 Aug 2017 11:44:46 +0000 (11:44 +0000)
  implemented causing TCP to fail. The fix allows fallback to regular
  TCP in this case and is also more robust for cases where connectx()
  fails for some reason.

git-svn-id: file:///svn/unbound/trunk@4304 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
services/outside_network.c

index 5b0bc011566bc681858321f2dac90b5f791c482f..868d98e99f8b5a1160202e0d977afaf7c9d94d52 100644 (file)
@@ -4,6 +4,10 @@
          installs between sep11 and oct11 2017.
        - tag 1.6.5 with pointrelease 1.6.5 (1.6.4 plus 5011 fix).
        - trunk version 1.6.6 in development.
+       - Fix issue on macOX 10.10 where TCP fast open is detected but not
+         implemented causing TCP to fail. The fix allows fallback to regular
+         TCP in this case and is also more robust for cases where connectx()
+         fails for some reason.
 
 10 August 2017: Wouter
        - Patch to show DNSCrypt status in help output, from Carsten
index 9b1490e643f848711e58c01f02c48d161937e786..fe2b55b1ac177e8823563584f37df843aac577e3 100644 (file)
@@ -268,6 +268,13 @@ outnet_tcp_take_into_use(struct waiting_tcp* w, uint8_t* pkt, size_t pkt_len)
        if (connectx(s, &endpoints, SAE_ASSOCID_ANY,  
                     CONNECT_DATA_IDEMPOTENT | CONNECT_RESUME_ON_READ_WRITE,
                     NULL, 0, NULL, NULL) == -1) {
+               /* if fails, failover to connect for OSX 10.10 */
+#ifdef EINPROGRESS
+               if(errno != EINPROGRESS) {
+#else
+               if(1) {
+#endif
+                       if(connect(s, (struct sockaddr*)&w->addr, w->addrlen) == -1) {
 #else /* USE_OSX_MSG_FASTOPEN*/
 #ifdef USE_MSG_FASTOPEN
        pend->c->tcp_do_fastopen = 1;
@@ -302,6 +309,10 @@ outnet_tcp_take_into_use(struct waiting_tcp* w, uint8_t* pkt, size_t pkt_len)
 #ifdef USE_MSG_FASTOPEN
        }
 #endif /* USE_MSG_FASTOPEN */
+#ifdef USE_OSX_MSG_FASTOPEN
+               }
+       }
+#endif /* USE_OSX_MSG_FASTOPEN */
        if(w->outnet->sslctx && w->ssl_upstream) {
                pend->c->ssl = outgoing_ssl_fd(w->outnet->sslctx, s);
                if(!pend->c->ssl) {