diff options
Diffstat (limited to 'lib/ohai/plugins/network.rb')
-rw-r--r-- | lib/ohai/plugins/network.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ohai/plugins/network.rb b/lib/ohai/plugins/network.rb index 8e9425ef..c1b15ced 100644 --- a/lib/ohai/plugins/network.rb +++ b/lib/ohai/plugins/network.rb @@ -88,9 +88,9 @@ Ohai.plugin(:NetworkAddresses) do r = gw_if_ips.first else # checking network masks - r = gw_if_ips.select do |v| + r = gw_if_ips.find do |v| network_contains_address(network[gw_attr], v[:ipaddress], v[:iface]) - end.first + end if r.nil? r = gw_if_ips.first logger.trace("Plugin Network: [#{family}] no ipaddress/mask on #{network[int_attr]} matching the gateway #{network[gw_attr]}, picking #{r[:ipaddress]}") |