//go:build windows package dialer import ( "syscall" "testing" "golang.org/x/sys/windows" ) // IP_MTU_DISCOVER on windows (ws2ipdef.h); control.DisableUDPFragment sets it to // IP_PMTUDISC_DO, the same "don't fragment" state the linux helper checks. const ( windowsIPMTUDiscover = 71 windowsPMTUDiscDo = 1 ) // udpSocketDFSet reports whether the socket has "don't fragment" forced on. // shater addition: upstream ships linux + darwin only, so the whole suite // skipped on the dev host — where it is the one platform we can actually run it // on before the router build. func udpSocketDFSet(t *testing.T, sysConn syscall.Conn) bool { t.Helper() rawConn, err := sysConn.SyscallConn() if err != nil { t.Fatal(err) } var ( value int sockErr error ) ctrlErr := rawConn.Control(func(fd uintptr) { value, sockErr = windows.GetsockoptInt(windows.Handle(fd), windows.IPPROTO_IP, windowsIPMTUDiscover) }) if ctrlErr != nil { t.Fatal(ctrlErr) } if sockErr != nil { t.Skip("IP_MTU_DISCOVER is not readable on this host: ", sockErr) } return value == windowsPMTUDiscDo }