pull/14575/merge
Cezar Craciunoiu 13 hours ago committed by GitHub
commit 8013664f76
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -9,6 +9,8 @@ import (
"net" "net"
"net/http" "net/http"
"net/netip" "net/netip"
"os"
"regexp"
"runtime" "runtime"
"slices" "slices"
"sort" "sort"
@ -37,6 +39,13 @@ func isLoopback(nif *net.Interface) bool { return nif.Flags&net.FlagLoopback !=
func isProblematicInterface(nif *net.Interface) bool { func isProblematicInterface(nif *net.Interface) bool {
name := nif.Name 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 // Don't try to send disco/etc packets over zerotier; they effectively
// DoS each other by doing traffic amplification, both of them // DoS each other by doing traffic amplification, both of them
// preferring/trying to use each other for transport. See: // preferring/trying to use each other for transport. See:
@ -208,6 +217,9 @@ func ForeachInterface(fn func(Interface, []netip.Prefix)) error {
// the interface, and Bits are the subnet mask. // the interface, and Bits are the subnet mask.
func (ifaces InterfaceList) ForeachInterface(fn func(Interface, []netip.Prefix)) error { func (ifaces InterfaceList) ForeachInterface(fn func(Interface, []netip.Prefix)) error {
for _, iface := range ifaces { for _, iface := range ifaces {
if isProblematicInterface(iface.Interface) {
continue
}
addrs, err := iface.Addrs() addrs, err := iface.Addrs()
if err != nil { if err != nil {
return err return err

Loading…
Cancel
Save