net/netns: remove a useless probe of the "ip" command

We stopped using it in 1.18.

Change-Id: If5adf1d99275286a89e2a05f0bce5193d9f6e5e3
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
pull/3715/head
Brad Fitzpatrick 3 years ago committed by Brad Fitzpatrick
parent e6626366a2
commit 51bc9a6d9d

@ -11,7 +11,6 @@ import (
"fmt" "fmt"
"net" "net"
"os" "os"
"os/exec"
"sync" "sync"
"syscall" "syscall"
@ -67,8 +66,7 @@ func socketMarkWorks() bool {
// If it doesn't, we have to use SO_BINDTODEVICE on our sockets instead. // If it doesn't, we have to use SO_BINDTODEVICE on our sockets instead.
func useSocketMark() bool { func useSocketMark() bool {
socketMarkWorksOnce.Do(func() { socketMarkWorksOnce.Do(func() {
ipRuleWorks := exec.Command("ip", "rule").Run() == nil socketMarkWorksOnce.v = socketMarkWorks()
socketMarkWorksOnce.v = ipRuleWorks && socketMarkWorks()
}) })
return socketMarkWorksOnce.v return socketMarkWorksOnce.v
} }

Loading…
Cancel
Save