mirror of
https://github.com/qdm12/gluetun.git
synced 2026-06-20 19:04:11 +02:00
hotfix(pmtud/icmp): set IPv6 dont fragment options just in case
This commit is contained in:
@@ -4,8 +4,11 @@ import (
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
func setDontFragment(fd uintptr) (err error) {
|
||||
// https://docs.microsoft.com/en-us/troubleshoot/windows/win32/header-library-requirement-socket-ipproto-ip
|
||||
// #define IP_DONTFRAGMENT 14 /* don't fragment IP datagrams */
|
||||
return windows.SetsockoptInt(windows.Handle(fd), windows.IPPROTO_IP, 14, 1)
|
||||
func setDontFragment(fd uintptr, ipv4 bool) (err error) {
|
||||
if ipv4 {
|
||||
// https://docs.microsoft.com/en-us/troubleshoot/windows/win32/header-library-requirement-socket-ipproto-ip
|
||||
// #define IP_DONTFRAGMENT 14 /* don't fragment IP datagrams */
|
||||
return windows.SetsockoptInt(windows.Handle(fd), windows.IPPROTO_IP, 14, 1)
|
||||
}
|
||||
return windows.SetsockoptInt(windows.Handle(fd), windows.IPPROTO_IPV6, 14, 1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user