We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d3447d7 commit f5d2b54Copy full SHA for f5d2b54
lib/facter/util/resolvers/networking/networking.rb
@@ -64,8 +64,23 @@ def find_valid_binding(bindings)
64
bindings.empty? ? nil : bindings.first
65
end
66
67
+ IPV4_LINK_LOCAL_ADDR = IPAddr.new('169.254.0.0/16').freeze # RFC5735
68
+ IPV6_LINK_LOCAL_ADDR = IPAddr.new('fe80::/16').freeze # RFC4291
69
+
70
def ignored_ip_address(addr)
- addr.empty? || addr.start_with?('127.', '169.254.') || addr.start_with?('fe80') || addr.eql?('::1')
71
+ return true if addr.empty?
72
73
+ ip = IPAddr.new(addr)
74
+ return true if ip.loopback?
75
76
+ [
77
+ IPV4_LINK_LOCAL_ADDR,
78
+ IPV6_LINK_LOCAL_ADDR
79
+ ].each do |range|
80
+ return true if range.include?(ip)
81
+ end
82
83
+ false
84
85
86
def calculate_mask_length(netmask)
0 commit comments