diff --git a/doc/Changelog b/doc/Changelog index 5b0bc0115..868d98e99 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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 diff --git a/services/outside_network.c b/services/outside_network.c index 9b1490e64..fe2b55b1a 100644 --- a/services/outside_network.c +++ b/services/outside_network.c @@ -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) {