From: Alex Rousskov Date: Fri, 2 Mar 2012 17:33:04 +0000 (-0700) Subject: Bug 3503: DNS PTR queries timeout due to wrong QIDs. X-Git-Tag: BumpSslServerFirst.take06~2^2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=546ae352661d4043cc7a5c0f41df9a639aeaf40c;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 5bcda7a8b0..bdd079a06b 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) {