mirror of
https://github.com/qdm12/gluetun.git
synced 2026-05-07 04:20:12 +02:00
15 lines
335 B
Go
15 lines
335 B
Go
package icmp
|
|
|
|
import (
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
func setDontFragment(fd uintptr, ipv4 bool) (err error) {
|
|
if ipv4 {
|
|
return unix.SetsockoptInt(int(fd), unix.IPPROTO_IP,
|
|
unix.IP_MTU_DISCOVER, unix.IP_PMTUDISC_PROBE)
|
|
}
|
|
return unix.SetsockoptInt(int(fd), unix.IPPROTO_IPV6,
|
|
unix.IPV6_MTU_DISCOVER, unix.IPV6_PMTUDISC_PROBE)
|
|
}
|