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.
This commit is contained in:
		
							parent
							
								
									242c4e2ca6
								
							
						
					
					
						commit
						c3acae034c
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		|  | @ -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) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue