File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ def self.new(*args)
42
42
end
43
43
44
44
# @return [String] the interface for networking operations
45
- attr_reader :interface
45
+ attr_reader :interface , :link_type
46
46
47
47
# @param interface [String] Name of the network interface to manage
48
48
def initialize ( interface )
@@ -61,7 +61,8 @@ def reload
61
61
return false
62
62
end
63
63
64
- addr_info = ip_output [ "addr_info" ]
64
+ @link_type = ip_output [ "link_type" ]
65
+ addr_info = ip_output [ "addr_info" ]
65
66
66
67
parse_ip4 ( addr_info )
67
68
parse_ip6 ( addr_info , "global" )
@@ -75,6 +76,10 @@ def reload
75
76
true
76
77
end
77
78
79
+ def loopback?
80
+ @link_type == "loopback"
81
+ end
82
+
78
83
# Retrieve the IPv4 address assigned to the interface
79
84
#
80
85
# @return [String] IPv4 address for the managed interface
You can’t perform that action at this time.
0 commit comments