diff options
| author | Andrea Gottardo <andrea@tailscale.com> | 2023-05-24 16:14:56 -0700 |
|---|---|---|
| committer | Andrea Gottardo <andrea@tailscale.com> | 2023-05-24 16:14:56 -0700 |
| commit | 9536e1f931dbb54038caa079ddb12f0c30bd0be3 (patch) | |
| tree | 680bb2a0e5912bbcd0263e4e4075cf486481b6d7 | |
| parent | 66f97f4bea043230e4e0bc30a0124a1eae3208cc (diff) | |
| download | tailscale-angott/allow-thunderbolt-bridge.tar.xz tailscale-angott/allow-thunderbolt-bridge.zip | |
Check for Thunderbolt interfaceangott/allow-thunderbolt-bridge
| -rw-r--r-- | net/interfaces/interfaces.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/net/interfaces/interfaces.go b/net/interfaces/interfaces.go index e9e21eabc..a5b4e5b34 100644 --- a/net/interfaces/interfaces.go +++ b/net/interfaces/interfaces.go @@ -82,6 +82,13 @@ func isProblematicInterface(nif *net.Interface) bool { return false } +func isThunderboltBridgeInterface(nif *net.Interface) bool { + if runtime.GOOS != "darwin" { + return false + } + return strings.HasPrefix(nif.Name, "bridge") +} + // LocalAddresses returns the machine's IP addresses, separated by // whether they're loopback addresses. If there are no regular addresses // it will return any IPv4 linklocal or IPv6 unique local addresses because we @@ -125,7 +132,7 @@ func LocalAddresses() (regular, loopback []netip.Addr, err error) { } if ip.IsLoopback() || ifcIsLoopback { loopback = append(loopback, ip) - } else if ip.IsLinkLocalUnicast() { + } else if ip.IsLinkLocalUnicast() && !isThunderboltBridgeInterface(stdIf) { if ip.Is4() { linklocal4 = append(linklocal4, ip) } |
