]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3503: DNS PTR queries timeout due to wrong QIDs.
authorAlex Rousskov <rousskov@measurement-factory.com>
Sat, 3 Mar 2012 23:57:44 +0000 (16:57 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 3 Mar 2012 23:57:44 +0000 (16:57 -0700)
Supply query ID (rather than zero) to rfc3596BuildPTRQuery*() calls.

This code was broken since trunk r11015 "Fixed DNS query leaks and increased
defense against DNS cache poisoning" dated 2010-11-03.

src/dns_internal.cc

index 9d88a7f348551114da90a4d0b4971b7e75a32d67..b14953baf51505c4b5f1d1da3eaf910ca1a7a34c 100644 (file)
@@ -1710,12 +1710,12 @@ idnsPTRLookup(const Ip::Address &addr, IDNSCB * callback, void *data)
     if (addr.IsIPv6()) {
         struct in6_addr addr6;
         addr.GetInAddr(addr6);
-        q->sz = rfc3596BuildPTRQuery6(addr6, q->buf, sizeof(q->buf), 0, &q->query, Config.dns.packet_max);
+        q->sz = rfc3596BuildPTRQuery6(addr6, q->buf, sizeof(q->buf), q->query_id, &q->query, Config.dns.packet_max);
     } else {
         struct in_addr addr4;
         addr.GetInAddr(addr4);
         // see EDNS notes at top of file why this sends 0
-        q->sz = rfc3596BuildPTRQuery4(addr4, q->buf, sizeof(q->buf), 0, &q->query, 0);
+        q->sz = rfc3596BuildPTRQuery4(addr4, q->buf, sizeof(q->buf), q->query_id, &q->query, 0);
     }
 
     if (q->sz < 0) {