summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/ohai/plugins/linux/network.rb4
-rw-r--r--spec/unit/plugins/linux/network_spec.rb1
2 files changed, 2 insertions, 3 deletions
diff --git a/lib/ohai/plugins/linux/network.rb b/lib/ohai/plugins/linux/network.rb
index b38df361..54523e11 100644
--- a/lib/ohai/plugins/linux/network.rb
+++ b/lib/ohai/plugins/linux/network.rb
@@ -518,8 +518,8 @@ Ohai.plugin(:Network) do
return false if default_route[:via].nil?
- dest_ipaddr = IPAddress(route[:destination])
- default_route_via = IPAddress(default_route[:via])
+ dest_ipaddr = IPAddr.new(route[:destination])
+ default_route_via = IPAddr.new(default_route[:via])
# check if nexthop is the same address family
return false if dest_ipaddr.ipv4? != default_route_via.ipv4?
diff --git a/spec/unit/plugins/linux/network_spec.rb b/spec/unit/plugins/linux/network_spec.rb
index 5ee364c0..978160bb 100644
--- a/spec/unit/plugins/linux/network_spec.rb
+++ b/spec/unit/plugins/linux/network_spec.rb
@@ -18,7 +18,6 @@
#
require "spec_helper"
-require "ipaddress" unless defined?(IPAddress)
describe Ohai::System, "Linux Network Plugin" do
let(:plugin) { get_plugin("linux/network") }