Skip to content

Instantly share code, notes, and snippets.

@WindyNova
Created September 5, 2024 20:27
Show Gist options
  • Select an option

  • Save WindyNova/8d78effdfa1d2e3c403109a507ed872b to your computer and use it in GitHub Desktop.

Select an option

Save WindyNova/8d78effdfa1d2e3c403109a507ed872b to your computer and use it in GitHub Desktop.
Is it problematic for Tailscale?
// https://github.com/tailscale/tailscale/blob/e7b5e8c8cd9f88bb39442e099a237a2fcd75b180/net/netmon/state.go#L56
package main
import (
"fmt"
"net"
"runtime"
"strings"
)
func isProblematicInterface(nif *net.Interface) bool {
name := nif.Name
// 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:
// https://github.com/tailscale/tailscale/issues/1208
if strings.HasPrefix(name, "zt") || (runtime.GOOS == "windows" && strings.Contains(name, "ZeroTier")) {
return true
}
return false
}
func main() {
ifaces, err := net.Interfaces()
if err != nil {
fmt.Println("Error getting interfaces:", err)
return
}
for _, iface := range ifaces {
if isProblematicInterface(&iface) {
fmt.Printf("Interface %s is problematic.\n", iface.Name)
} else {
fmt.Printf("Interface %s is not problematic.\n", iface.Name)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment