From: Alex Rousskov Date: Sat, 3 Mar 2012 23:57:44 +0000 (-0700) Subject: Bug 3503: DNS PTR queries timeout due to wrong QIDs. X-Git-Tag: SQUID_3_2_0_16~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91c7ec58fed63980bb7f9c7269f4702f985ec6c6;p=thirdparty%2Fsquid.git Bug 3503: DNS PTR queries timeout due to wrong QIDs. 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. --- diff --git a/src/dns_internal.cc b/src/dns_internal.cc index 9d88a7f348..b14953baf5 100644 --- a/src/dns_internal.cc +++ b/src/dns_internal.cc @@ -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) {