From 91ba9ccefe37f5d661dc29d0e581c709030453c5 Mon Sep 17 00:00:00 2001 From: Mahmood Ali Date: Tue, 21 Jul 2020 15:40:41 -0400 Subject: [PATCH] honor config.NetworkInterface in NodeNetworks --- client/fingerprint/network.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/fingerprint/network.go b/client/fingerprint/network.go index 32565d7a0..1c77a7657 100644 --- a/client/fingerprint/network.go +++ b/client/fingerprint/network.go @@ -235,13 +235,17 @@ func deriveAddressAlias(iface net.Interface, addr net.IP, config *config.Config) } } - ri, err := sockaddr.NewRouteInfo() - if err == nil { + if config.NetworkInterface != "" { + if config.NetworkInterface == iface.Name { + return "default" + } + } else if ri, err := sockaddr.NewRouteInfo(); err == nil { defaultIface, err := ri.GetDefaultInterfaceName() if err == nil && iface.Name == defaultIface { return "default" } } + return "" }