File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ package tstun
55import "tailscale.com/envknob"
66
77const (
8- maxMTU uint32 = 65536
9- defaultMTU uint32 = 1280
8+ maxMTU = 65536
9+ defaultMTU = 1280
1010)
1111
1212// DefaultMTU returns either the constant default MTU of 1280, or the value set
@@ -21,13 +21,8 @@ func DefaultMTU() uint32 {
2121 // 1280 is the smallest MTU allowed for IPv6, which is a sensible
2222 // "probably works everywhere" setting until we develop proper PMTU
2323 // discovery.
24- tunMTU := defaultMTU
2524 if mtu , ok := envknob .LookupUintSized ("TS_DEBUG_MTU" , 10 , 32 ); ok {
26- mtu := uint32 (mtu )
27- if mtu > maxMTU {
28- mtu = maxMTU
29- }
30- tunMTU = mtu
25+ return min (uint32 (mtu ), maxMTU )
3126 }
32- return tunMTU
27+ return defaultMTU
3328}
You can’t perform that action at this time.
0 commit comments