Skip to content
Snippets Groups Projects

resolve_ipnets(): Canonicalize resolved addresses

1 file
+ 5
1
Compare changes
  • Side-by-side
  • Inline
@@ -103,7 +103,11 @@ module Puppet::Parser::Functions
ips[info[4]] = []
found_families << info[4]
end
ips.fetch(info[4]) << info[3]
# Canonicalize address using IPAddr so the same representation
# is returned regardless of interpreter.
# JRuby's Socket.getaddrinfo returns IPv6 addresses without
# compressed zeros, while CRuby's does compress zeros.
ips.fetch(info[4]) << IPAddr.new(info[3]).to_s
end
end
ipaddrs = [ ]
Loading