You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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>
1 year ago
..
interfaces.go net/interfaces: also allow link-local for AzureAppServices. 1 year ago
interfaces_bsd.go net/interfaces: redo how we get the default interface on macOS and iOS 1 year ago
interfaces_darwin.go ipn/ipnlocal: add delegated interface information to /interfaces PeerAPI handler 1 year ago
interfaces_darwin_test.go all: update copyright and license headers 1 year ago
interfaces_default_route_test.go all: update copyright and license headers 1 year ago
interfaces_defaultrouteif_todo.go all: update copyright and license headers 1 year ago
interfaces_freebsd.go net/interfaces: redo how we get the default interface on macOS and iOS 1 year ago
interfaces_linux.go all: update copyright and license headers 1 year ago
interfaces_linux_test.go all: use tstest.Replace more 1 year ago
interfaces_test.go net/interfaces: add better test for LikelyHomeRouterIP 1 year ago
interfaces_windows.go all: update copyright and license headers 1 year ago
interfaces_windows_test.go all: update copyright and license headers 1 year ago