mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-14 11:31:57 +00:00
net/netutil: only check Linux sysctls w/ procfs, assume absent means false
Fixes #7217 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
05adf22383
commit
2477fc4952
@@ -6,6 +6,7 @@ package netutil
|
||||
import (
|
||||
"io"
|
||||
"net"
|
||||
"runtime"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -51,3 +52,16 @@ func TestOneConnListener(t *testing.T) {
|
||||
t.Errorf("nil Addr")
|
||||
}
|
||||
}
|
||||
|
||||
func TestIPForwardingEnabledLinux(t *testing.T) {
|
||||
if runtime.GOOS != "linux" {
|
||||
t.Skipf("skipping on %s", runtime.GOOS)
|
||||
}
|
||||
got, err := ipForwardingEnabledLinux(ipv4, "some-not-found-interface")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if got {
|
||||
t.Errorf("got true; want false")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user