From: Guus Sliepen Date: Sat, 24 Oct 2009 20:32:35 +0000 (+0200) Subject: Use IP_DONTFRAGMENT instead of IP_MTU_DISCOVER on Windows. X-Git-Tag: release-1.0.11~6 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c3acae034c4da2d1c70f31b852b14ca098c0eeb9;p=oweals%2Ftinc.git Use IP_DONTFRAGMENT instead of IP_MTU_DISCOVER on Windows. This ensures the DF bit on outgoing UDP packets gets set on Windows when path MTU discovery is enabled, reducing fragmentation. --- diff --git a/src/net_socket.c b/src/net_socket.c index baf0227..f5a569b 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -279,6 +279,11 @@ int setup_vpn_in_socket(const sockaddr_t *sa) { option = IP_PMTUDISC_DO; setsockopt(nfd, SOL_IP, IP_MTU_DISCOVER, &option, sizeof(option)); } +#elif defined(IPPROTO_IP) && defined(IP_DONTFRAGMENT) + if(myself->options & OPTION_PMTU_DISCOVERY) { + option = 1; + setsockopt(nfd, IPPROTO_IP, IP_DONTFRAGMENT, &option, sizeof(option)); + } #endif #if defined(SOL_IPV6) && defined(IPV6_MTU_DISCOVER) && defined(IPV6_PMTUDISC_DO)