mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-24 10:41:19 -08:00
wgengine/router: disable IPv6 if v6 policy routing is unavailable.
Fixes #895.
Signed-off-by: David Anderson <[email protected]>
(cherry picked from commit a664aac877)
This commit is contained in:
1 parent
e29f92f653
commit
c242540a97
1 file changed
+14
@@ -1023,6 +1023,20 @@ func supportsV6() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// Older kernels don't support IPv6 policy routing.
|
||||
bs, err = ioutil.ReadFile("/proc/sys/net/ipv6/conf/all/disable_policy")
|
||||
if err != nil {
|
||||
// Absent knob means policy routing is unsupported.
|
||||
return false
|
||||
}
|
||||
disabled, err = strconv.ParseBool(strings.TrimSpace(string(bs)))
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
if disabled {
|
||||
return false
|
||||
}
|
||||
|
||||
// Some distros ship ip6tables separately from iptables.
|
||||
if _, err := exec.LookPath("ip6tables"); err != nil {
|
||||
return false
|
||||
|
||||
Reference in new issue
Block a user