tailscale/net
Denton Gentry ebc630c6c0 net/interfaces: also allow link-local for AzureAppServices.
In May 2021, Azure App Services used 172.16.x.x addresses:
```
10: eth0@if11: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP
    link/ether 02:42:ac:10:01:03 brd ff:ff:ff:ff:ff:ff
    inet 172.16.1.3/24 brd 172.16.1.255 scope global eth0
       valid_lft forever preferred_lft forever
```

Now it uses link-local:
```
2: eth0@if6: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP
    link/ether 8a:30:1f:50:1d:23 brd ff:ff:ff:ff:ff:ff
    inet 169.254.129.3/24 brd 169.254.129.255 scope global eth0
       valid_lft forever preferred_lft forever
```

This is reasonable for them to choose to do, it just broke the handling in net/interfaces.

This PR proposes to:
1. Always allow link-local in LocalAddresses() if we have no better
   address available.
2. Continue to make isUsableV4() conditional on an environment we know
   requires it.

I don't love the idea of having to discover these environments one by
one, but I don't understand the consequences of making isUsableV4()
return true unconditionally. It makes isUsableV4() essentially always
return true and perform no function.

Fixes https://github.com/tailscale/tailscale/issues/7603

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2023-03-20 13:40:38 -07:00
..
connstats net/connstats: fix ticker in NewStatistics (#7225) 2023-02-09 01:24:52 -08:00
dns various: pass logger.Logf through to more places 2023-03-12 12:38:38 -04:00
dnscache tstest: add method to Replace values for tests 2023-03-03 17:02:33 -08:00
dnsfallback various: pass logger.Logf through to more places 2023-03-12 12:38:38 -04:00
flowtrack all: update copyright and license headers 2023-01-27 15:36:29 -08:00
interfaces net/interfaces: also allow link-local for AzureAppServices. 2023-03-20 13:40:38 -07:00
memnet net/memnet: rename from net/nettest 2023-01-30 13:03:32 -08:00
netaddr all: update copyright and license headers 2023-01-27 15:36:29 -08:00
netcheck sockstats: switch label to enum 2023-03-06 15:54:35 -08:00
neterror all: update copyright and license headers 2023-01-27 15:36:29 -08:00
netknob all: update copyright and license headers 2023-01-27 15:36:29 -08:00
netns net/interfaces, net/netns: add node attributes to control default interface getting and binding 2023-02-08 13:15:10 -08:00
netstat net/{netns,netstat}: use new x/sys/cpu.IsBigEndian 2023-02-02 07:41:49 -08:00
netutil all: replace /kb/ links with /s/ equivalents 2023-03-13 14:21:15 -07:00
packet all: update copyright and license headers 2023-01-27 15:36:29 -08:00
ping all: update copyright and license headers 2023-01-27 15:36:29 -08:00
portmapper sockstats: switch label to enum 2023-03-06 15:54:35 -08:00
proxymux all: update copyright and license headers 2023-01-27 15:36:29 -08:00
routetable net/routetable: include unknown flags in the routetable doctor output 2023-02-10 15:54:31 -08:00
socks5 net/socks5: add password auth support 2023-03-05 14:08:34 -08:00
sockstats sockstats: remove per-interface stats from Get 2023-03-14 15:38:41 -07:00
speedtest all: update copyright and license headers 2023-01-27 15:36:29 -08:00
stun all: use Go 1.20's bytes.Clone 2023-02-01 17:39:18 -08:00
tlsdial health, net/tlsdial: add healthcheck for self-signed cert 2023-02-01 23:17:41 -05:00
tsaddr all: replace /kb/ links with /s/ equivalents 2023-03-13 14:21:15 -07:00
tsdial all: update copyright and license headers 2023-01-27 15:36:29 -08:00
tshttpproxy all: use tstest.Replace more 2023-03-04 12:24:55 -08:00
tstun wgengine: start logging DISCO frames to pcap stream 2023-02-10 11:22:34 -10:00
wsconn all: update copyright and license headers 2023-01-27 15:36:29 -08:00