From 546ae352661d4043cc7a5c0f41df9a639aeaf40c Mon Sep 17 00:00:00 2001 From: Alex Rousskov Date: Fri, 2 Mar 2012 10:33:04 -0700 Subject: [PATCH] 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. --- src/dns_internal.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) { -- 2.47.2