Skip to content

Commit

Permalink
Merge pull request #8486 from hashicorp/b-node-network-devices-1
Browse files Browse the repository at this point in the history
honor config.NetworkInterface in NodeNetworks
  • Loading branch information
Mahmood Ali committed Jul 22, 2020
2 parents 94f09bf + 6bf248c commit e6f5fb6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions client/fingerprint/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
}

Expand Down

0 comments on commit e6f5fb6

Please sign in to comment.