lib/net/ip/route/collection.rb in net-ip-0.0.7 vs lib/net/ip/route/collection.rb in net-ip-0.0.8

- old
+ new

@@ -47,10 +47,11 @@ # route = Net::IP::Route.new(:prefix => '10.0.0.0/8', :dev => 'eth0') # Net::IP::Route.add_route(route) # @param route {Route} Route to add to the table. # @return {void} def add(route) - result = `ip route add table #{@table} #{route.to_params}` + cmd = "ip route add table #{@table} #{route.prefix} #{route.to_params}" + result = `#{cmd}` raise result unless $?.success? end # Flush the routing table based on a selector # @example Flush the routing table cache