Skip to content

Commit 4cd0620

Browse files
committed
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> (cherry picked from commit 51bc9a6)
1 parent 04a7f50 commit 4cd0620

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

net/netns/netns_linux.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"fmt"
1212
"net"
1313
"os"
14-
"os/exec"
1514
"sync"
1615
"syscall"
1716

@@ -67,8 +66,7 @@ func socketMarkWorks() bool {
6766
// If it doesn't, we have to use SO_BINDTODEVICE on our sockets instead.
6867
func useSocketMark() bool {
6968
socketMarkWorksOnce.Do(func() {
70-
ipRuleWorks := exec.Command("ip", "rule").Run() == nil
71-
socketMarkWorksOnce.v = ipRuleWorks && socketMarkWorks()
69+
socketMarkWorksOnce.v = socketMarkWorks()
7270
})
7371
return socketMarkWorksOnce.v
7472
}

0 commit comments

Comments
 (0)