Files
tailscale/wgengine/magicsock/peermtu_linux.go
Alex Valiushko 12e619a070 wgengine/magicsock: apply peer MTU sockopts through net/sockopts (#21855)
And merge the repeated don't fragment codepaths between Linux and Darwin.

Updates tailscale/corp#48168

Change-Id: I5aef408f037c8def99522b4d820c853a6a6a6964
Signed-off-by: Alex Valiushko <[email protected]>
2026-10-26 10:09:21 -07:00

24 lines
473 B
Go

// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
//go:build linux && !android
package magicsock
import (
"syscall"
)
// dontFrag{Enabled,Disabled} are the values of the don't fragment sockopt.
const (
dontFragEnabled = syscall.IP_PMTUDISC_DO
dontFragDisabled = syscall.IP_PMTUDISC_DONT
)
func getDontFragOpt(network string) int {
if network == "udp4" {
return syscall.IP_MTU_DISCOVER
}
return syscall.IPV6_MTU_DISCOVER
}