File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ local AF_UNIX = cs.AF_UNIX
22
22
local AF_INET = cs .AF_INET
23
23
local AF_INET6 = cs .AF_INET6
24
24
25
+ local DNS_SECTION_ANSWER = cqueues_dns_record .ANSWER
25
26
local DNS_CLASS_IN = cqueues_dns_record .IN
26
27
local DNS_TYPE_A = cqueues_dns_record .A
27
28
local DNS_TYPE_AAAA = cqueues_dns_record .AAAA
107
108
local function each_matching_record (pkt , name , type )
108
109
-- First need to do CNAME chasing
109
110
local params = {
110
- section = " answer " ;
111
+ section = DNS_SECTION_ANSWER ;
111
112
class = DNS_CLASS_IN ;
112
113
type = DNS_TYPE_CNAME ;
113
114
name = name .. " ." ;
@@ -239,13 +240,17 @@ local function lookup_records(options, timeout)
239
240
240
241
local ipv4 = IPv4address :match (host )
241
242
if ipv4 then
242
- records :add_v4 (host , port )
243
+ if family == AF_UNSPEC or family == AF_INET then
244
+ records :add_v4 (host , port )
245
+ end
243
246
return records
244
247
end
245
248
246
249
local ipv6 = IPv6addrz :match (host )
247
250
if ipv6 then
248
- records :add_v6 (ipv6 , port )
251
+ if family == AF_UNSPEC or family == AF_INET6 then
252
+ records :add_v6 (ipv6 , port )
253
+ end
249
254
return records
250
255
end
251
256
You can’t perform that action at this time.
0 commit comments