From 43b504051e7156e818081ff302ec17eef6980ac5 Mon Sep 17 00:00:00 2001 From: Christian Hofstaedtler Date: Mon, 12 Oct 2015 12:14:21 +0200 Subject: [PATCH] Don't reply to truncated queries --- pdns/packethandler.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pdns/packethandler.cc b/pdns/packethandler.cc index 2ed23adc2..6f5c8a6c5 100644 --- a/pdns/packethandler.cc +++ b/pdns/packethandler.cc @@ -1130,6 +1130,14 @@ DNSPacket *PacketHandler::questionOrRecurse(DNSPacket *p, bool *shouldRecurse) return 0; } + if(p->d.tc) { // truncated query. MOADNSParser would silently parse this packet in an incomplete way. + if(d_logDNSDetails) + L<getRemote()<<", dropping"<d_remote); + return 0; + } + if (p->hasEDNS() && p->getEDNSVersion() > 0) { r = p->replyPacket(); r->setRcode(16 & 0xF); -- 2.40.0