From 1825d2337bef2a369dd201efa093c1afc564bf17 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 13 Nov 2023 13:18:30 -0800 Subject: [PATCH] ipn/ipnlocal: respect ExitNodeAllowLANAccess on iOS (#10230) Updates tailscale/corp#15783 Change-Id: I1082fbfff61a241ebd3b8275be0f45e329b67561 Signed-off-by: Brad Fitzpatrick --- ipn/ipnlocal/local.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ipn/ipnlocal/local.go b/ipn/ipnlocal/local.go index d67e2f965..b0de68f2c 100644 --- a/ipn/ipnlocal/local.go +++ b/ipn/ipnlocal/local.go @@ -3906,7 +3906,8 @@ func (b *LocalBackend) routerConfig(cfg *wgcfg.Config, prefs ipn.PrefsView, oneC if err != nil { b.logf("failed to discover interface ips: %v", err) } - if runtime.GOOS == "linux" || runtime.GOOS == "darwin" || runtime.GOOS == "windows" { + switch runtime.GOOS { + case "linux", "windows", "darwin", "ios": rs.LocalRoutes = internalIPs // unconditionally allow access to guest VM networks if prefs.ExitNodeAllowLANAccess() { rs.LocalRoutes = append(rs.LocalRoutes, externalIPs...) @@ -3916,6 +3917,10 @@ func (b *LocalBackend) routerConfig(cfg *wgcfg.Config, prefs ipn.PrefsView, oneC rs.Routes = append(rs.Routes, externalIPs...) } b.logf("allowing exit node access to local IPs: %v", rs.LocalRoutes) + default: + if prefs.ExitNodeAllowLANAccess() { + b.logf("warning: ExitNodeAllowLANAccess has no effect on " + runtime.GOOS) + } } }