From 690ade4ee1c0e4e30f95226f6e6ffaadbd803813 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 28 Jul 2021 08:00:03 -0700 Subject: [PATCH] ipn/ipnlocal: add URL to IP forwarding error message Updates #606 Signed-off-by: Brad Fitzpatrick --- ipn/ipnlocal/local.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ipn/ipnlocal/local.go b/ipn/ipnlocal/local.go index b612ccde7..ba5a60db6 100644 --- a/ipn/ipnlocal/local.go +++ b/ipn/ipnlocal/local.go @@ -2743,17 +2743,18 @@ func (b *LocalBackend) CheckIPForwarding() error { return nil } + const suffix = "\nSubnet routes won't work without IP forwarding.\nSee https://tailscale.com/kb/1104/enable-ip-forwarding/" for _, key := range keys { bs, err := exec.Command("sysctl", "-n", key).Output() if err != nil { - return fmt.Errorf("couldn't check %s (%v).\nSubnet routes won't work without IP forwarding.", key, err) + return fmt.Errorf("couldn't check %s (%v)%s", key, err, suffix) } on, err := strconv.ParseBool(string(bytes.TrimSpace(bs))) if err != nil { - return fmt.Errorf("couldn't parse %s (%v).\nSubnet routes won't work without IP forwarding.", key, err) + return fmt.Errorf("couldn't parse %s (%v)%s.", key, err, suffix) } if !on { - return fmt.Errorf("%s is disabled. Subnet routes won't work.", key) + return fmt.Errorf("%s is disabled.%s", key, suffix) } } return nil