wgengine/router,ipn/ipnlocal: add MTU field to router config

The MacOS client can't set the MTU when creating the tun due to lack
of permissions, so add it to the router config and have MacOS set it
in the callback using a method that it does have permissions for.

Updates #8219

Signed-off-by: Val <valerie@tailscale.com>
This commit is contained in:
Val
2023-07-18 23:51:32 +02:00
committed by valscale
parent 9b5e29761c
commit 1138f4eb5f
3 changed files with 31 additions and 5 deletions
+12 -2
View File
@@ -21,8 +21,8 @@ func mustCIDRs(ss ...string) []netip.Prefix {
func TestConfigEqual(t *testing.T) {
testedFields := []string{
"LocalAddrs", "Routes", "LocalRoutes", "SubnetRoutes",
"SNATSubnetRoutes", "NetfilterMode",
"LocalAddrs", "Routes", "LocalRoutes", "NewMTU",
"SubnetRoutes", "SNATSubnetRoutes", "NetfilterMode",
}
configType := reflect.TypeOf(Config{})
configFields := []string{}
@@ -134,6 +134,16 @@ func TestConfigEqual(t *testing.T) {
&Config{NetfilterMode: preftype.NetfilterNoDivert},
true,
},
{
&Config{NewMTU: 0},
&Config{NewMTU: 0},
true,
},
{
&Config{NewMTU: 1280},
&Config{NewMTU: 0},
false,
},
}
for i, tt := range tests {
got := tt.a.Equal(tt.b)