Skip to content

Commit ef3f81d

Browse files
committed
feat: set IP_DONTFRAG on macOS
1 parent 1bab46f commit ef3f81d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

wgengine/magicsock/magicsock_darwin.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ func trySetPathMTUDiscover(pconn nettype.PacketConn, logf logger.Logf, network s
1515
logf("magicsock: failed to set Path MTU Discover: get syscall conn: %v", err)
1616
}
1717
level := unix.IPPROTO_IP
18-
option := unix.IP_MTU_DISCOVER
18+
option := unix.IP_DONTFRAG
1919
if network == "udp6" {
2020
level = unix.IPPROTO_IPV6
21-
option = unix.IPV6_MTU_DISCOVER
21+
option = unix.IPV6_DONTFRAG
2222
}
2323
err = s.Control(func(fd uintptr) {
24-
err := unix.SetsockoptInt(int(fd), level, option, unix.IP_PMTUDISC_DO)
24+
err := unix.SetsockoptInt(int(fd), level, option, 1)
2525
if err != nil {
2626
logf("magicsock: failed to set Path MTU Discover: SetsockoptInt failed: %v", err)
2727
}

0 commit comments

Comments
 (0)