net.resolvers.basic: Obey extra.use_ipv4/use_ipv6

This commit is contained in:
Matthew Wild 2020-01-25 14:38:17 +00:00
parent c5fcad823a
commit d1fbb9197f

View file

@ -43,7 +43,7 @@ function methods:next(cb)
-- Resolve DNS to target list -- Resolve DNS to target list
local dns_resolver = adns.resolver(); local dns_resolver = adns.resolver();
if self.connector_options.use_ipv4 ~= false then if not self.extra or self.extra.use_ipv4 ~= false then
dns_resolver:lookup(function (answer) dns_resolver:lookup(function (answer)
if answer then if answer then
for _, record in ipairs(answer) do for _, record in ipairs(answer) do
@ -54,7 +54,7 @@ function methods:next(cb)
end, self.hostname, "A", "IN"); end, self.hostname, "A", "IN");
end end
if self.connector_options.use_ipv6 ~= false then if not self.extra or self.extra.use_ipv6 ~= false then
dns_resolver:lookup(function (answer) dns_resolver:lookup(function (answer)
if answer then if answer then
for _, record in ipairs(answer) do for _, record in ipairs(answer) do