tailscale/net/interfaces
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
..
interfaces_bsd.go net/interfaces: redo how we get the default interface on macOS and iOS 2023-02-10 16:23:37 -08:00
interfaces_darwin_test.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
interfaces_darwin.go ipn/ipnlocal: add delegated interface information to /interfaces PeerAPI handler 2023-02-27 09:39:49 -08:00
interfaces_default_route_test.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
interfaces_defaultrouteif_todo.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
interfaces_freebsd.go net/interfaces: redo how we get the default interface on macOS and iOS 2023-02-10 16:23:37 -08:00
interfaces_linux_test.go all: use tstest.Replace more 2023-03-04 12:24:55 -08:00
interfaces_linux.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
interfaces_test.go net/interfaces: add better test for LikelyHomeRouterIP 2023-03-03 20:52:57 -05:00
interfaces_windows_test.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
interfaces_windows.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
interfaces.go net/interfaces: also allow link-local for AzureAppServices. 2023-03-20 13:40:38 -07:00