net/netmon: Allow excluding custom interfaces

Providing a regex env variable ensures that any other specific
interface that interferes with tailscale can be disabled on startup.

Updates: #1552

Signed-off-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
pull/14575/head
Cezar Craciunoiu 11 months ago
parent 599e84f194
commit bc5bb1d64c

@ -9,6 +9,8 @@ import (
"net"
"net/http"
"net/netip"
"os"
"regexp"
"runtime"
"slices"
"sort"
@ -30,6 +32,13 @@ func isLoopback(nif *net.Interface) bool { return nif.Flags&net.FlagLoopback !=
func isProblematicInterface(nif *net.Interface) bool {
name := nif.Name
if regex := os.Getenv("TS_NETMON_IGNORE"); regex != "" {
if match, _ := regexp.MatchString(regex, name); match {
return true
}
}
// Don't try to send disco/etc packets over zerotier; they effectively
// DoS each other by doing traffic amplification, both of them
// preferring/trying to use each other for transport. See:

Loading…
Cancel
Save