From b591105c3bf48b207d86c4efda50d150df6f254f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=A4rkl?= Date: Sat, 17 Aug 2019 14:12:33 +0200 Subject: [PATCH] Disable Don't Fragment on macOS --- lib/src/takion.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/src/takion.c b/lib/src/takion.c index a85b91d..82054f2 100644 --- a/lib/src/takion.c +++ b/lib/src/takion.c @@ -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)