diff options
| author | Brad Fitzpatrick <bradfitz@tailscale.com> | 2021-03-16 12:20:44 -0700 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@tailscale.com> | 2021-03-16 12:22:08 -0700 |
| commit | 52e83d87fb5b9c59d971990a3b088439ee17fc34 (patch) | |
| tree | de430b0702890d719156e63d1aa8e9e0f9099182 | |
| parent | 9eb65601ef3a1f5e4627173340e1157bc1d64e8c (diff) | |
| download | tailscale-bradfitz/ipv6_link_local_strip.tar.xz tailscale-bradfitz/ipv6_link_local_strip.zip | |
net/interfaces: skip IPv6 link-local interfaces like we do for IPv4bradfitz/ipv6_link_local_strip
We strip them control-side anyway, and we already strip IPv4 link
local, so there's no point uploading them. And iOS has a ton of them,
which results in somewhat silly amount of traffic in the MapRequest.
We'll be doing same-LAN-inter-tailscaled link-local traffic a
different way, with same-LAN discovery.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
| -rw-r--r-- | net/interfaces/interfaces.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/net/interfaces/interfaces.go b/net/interfaces/interfaces.go index 19d97787d..3a0ffeb0b 100644 --- a/net/interfaces/interfaces.go +++ b/net/interfaces/interfaces.go @@ -113,7 +113,7 @@ func LocalAddresses() (regular, loopback []netaddr.IP, err error) { if tsaddr.IsTailscaleIP(ip) { continue } - if linkLocalIPv4.Contains(ip) { + if ip.IsLinkLocalUnicast() { continue } if ip.IsLoopback() || ifcIsLoopback { @@ -483,12 +483,11 @@ func mustCIDR(s string) netaddr.IPPrefix { } var ( - private1 = mustCIDR("10.0.0.0/8") - private2 = mustCIDR("172.16.0.0/12") - private3 = mustCIDR("192.168.0.0/16") - privatev4s = []netaddr.IPPrefix{private1, private2, private3} - linkLocalIPv4 = mustCIDR("169.254.0.0/16") - v6Global1 = mustCIDR("2000::/3") + private1 = mustCIDR("10.0.0.0/8") + private2 = mustCIDR("172.16.0.0/12") + private3 = mustCIDR("192.168.0.0/16") + privatev4s = []netaddr.IPPrefix{private1, private2, private3} + v6Global1 = mustCIDR("2000::/3") ) // anyInterestingIP reports whether pfxs contains any IP that matches |
