Project

General

Profile

Feature #14922 ยป resolv-use_ipv6-14922.patch

jeremyevans0 (Jeremy Evans), 08/27/2019 03:36 AM

View differences:

lib/resolv.rb
##
# Creates a new Resolv using +resolvers+.
def initialize(resolvers=[Hosts.new, DNS.new])
@resolvers = resolvers
def initialize(resolvers=nil, use_ipv6: nil)
@resolvers = resolvers || [Hosts.new, DNS.new(DNS::Config.default_config_hash.merge(use_ipv6: use_ipv6))]
end
##
......
end
def use_ipv6? # :nodoc:
use_ipv6 = @config.use_ipv6?
unless use_ipv6.nil?
return use_ipv6
end
begin
list = Socket.ip_address_list
rescue NotImplementedError
......
@mutex.synchronize {
unless @initialized
@nameserver_port = []
@use_ipv6 = nil
@search = nil
@ndots = 1
case @config_info
......
if config_hash.include? :nameserver_port
@nameserver_port = config_hash[:nameserver_port].map {|ns, port| [ns, (port || Port)] }
end
if config_hash.include? :use_ipv6
@use_ipv6 = config_hash[:use_ipv6]
end
@search = config_hash[:search] if config_hash.include? :search
@ndots = config_hash[:ndots] if config_hash.include? :ndots
......
@nameserver_port
end
def use_ipv6?
@use_ipv6
end
def generate_candidates(name)
candidates = nil
name = Name.create(name)
    (1-1/1)