File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 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
2222local AF_INET = cs .AF_INET
2323local AF_INET6 = cs .AF_INET6
2424
25+ local DNS_SECTION_ANSWER = cqueues_dns_record .ANSWER
2526local DNS_CLASS_IN = cqueues_dns_record .IN
2627local DNS_TYPE_A = cqueues_dns_record .A
2728local DNS_TYPE_AAAA = cqueues_dns_record .AAAA
107108local function each_matching_record (pkt , name , type )
108109 -- First need to do CNAME chasing
109110 local params = {
110- section = " answer " ;
111+ section = DNS_SECTION_ANSWER ;
111112 class = DNS_CLASS_IN ;
112113 type = DNS_TYPE_CNAME ;
113114 name = name .. " ." ;
@@ -239,13 +240,17 @@ local function lookup_records(options, timeout)
239240
240241 local ipv4 = IPv4address :match (host )
241242 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
243246 return records
244247 end
245248
246249 local ipv6 = IPv6addrz :match (host )
247250 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
249254 return records
250255 end
251256
You can’t perform that action at this time.
0 commit comments