Disable Don't Fragment on macOS

This commit is contained in:
Florian Märkl 2019-08-17 14:12:33 +02:00 committed by Florian Märkl
commit b591105c3b
No known key found for this signature in database
GPG key ID: 125BC8A5A6A1E857

View file

@ -241,6 +241,9 @@ CHIAKI_EXPORT ChiakiErrorCode chiaki_takion_connect(ChiakiTakion *takion, Chiaki
goto error_sock;
}
#if __APPLE__
CHIAKI_LOGW(takion->log, "Don't fragment is not supported on macOS, MTU values may be incorrect.");
#else
const int mtu_discover_val = IP_PMTUDISC_DO;
r = setsockopt(takion->sock, IPPROTO_IP, IP_MTU_DISCOVER, &mtu_discover_val, sizeof(mtu_discover_val));
if(r < 0)
@ -249,6 +252,7 @@ CHIAKI_EXPORT ChiakiErrorCode chiaki_takion_connect(ChiakiTakion *takion, Chiaki
ret = CHIAKI_ERR_NETWORK;
goto error_sock;
}
#endif
r = connect(takion->sock, info->sa, info->sa_len);
if(r < 0)