net/interfaces: get Linux default route from netlink as fallback

If it's in a non-standard table, as it is on Unifi UDM Pro, apparently.

Updates #4038 (probably fixes, but don't have hardware to verify)

Change-Id: I2cb9a098d8bb07d1a97a6045b686aca31763a937
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2022-02-28 14:49:37 -08:00
committed by Brad Fitzpatrick
parent 518f6cee63
commit 55095df644
5 changed files with 87 additions and 7 deletions

View File

@@ -687,7 +687,8 @@ func netInterfaces() ([]Interface, error) {
return ret, nil
}
// DefaultRouteDetails are the
// DefaultRouteDetails are the details about a default route returned
// by DefaultRoute.
type DefaultRouteDetails struct {
// InterfaceName is the interface name. It must always be populated.
// It's like "eth0" (Linux), "Ethernet 2" (Windows), "en0" (macOS).