Files
tailscale/wgengine/magicsock/peermtu_darwin.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
426 B
Go

// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
//go:build darwin && !ios
package magicsock
import (
"golang.org/x/sys/unix"
)
// dontFrag{Enabled,Disabled} are the values of the don't fragment sockopt.
const (
dontFragEnabled = 1
dontFragDisabled = 0
)
func getDontFragOpt(network string) int {
if network == "udp4" {
return unix.IP_DONTFRAG
}
return unix.IPV6_DONTFRAG
}