From: Peter van Dijk Date: Fri, 31 Aug 2018 20:41:21 +0000 (+0200) Subject: actually truncate truncated responses; fixes #6912 X-Git-Tag: dnsdist-1.3.3~120^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F6913%2Fhead;p=thirdparty%2Fpdns.git actually truncate truncated responses; fixes #6912 --- diff --git a/pdns/dnspacket.cc b/pdns/dnspacket.cc index c7c1d486f4..b5fcdb51c1 100644 --- a/pdns/dnspacket.cc +++ b/pdns/dnspacket.cc @@ -319,6 +319,7 @@ void DNSPacket::wrapup() if(pw.size() + 20U > (d_tcp ? 65535 : getMaxReplyLen())) { // 20 = room for EDNS0 pw.rollback(); if(pos->dr.d_place == DNSResourceRecord::ANSWER || pos->dr.d_place == DNSResourceRecord::AUTHORITY) { + pw.truncate(); pw.getHeader()->tc=1; } goto noCommit; diff --git a/regression-tests/tests/too-big-for-udp-query/expected_result b/regression-tests/tests/too-big-for-udp-query/expected_result index 96f7bf9a30..c45a3aa2e5 100644 --- a/regression-tests/tests/too-big-for-udp-query/expected_result +++ b/regression-tests/tests/too-big-for-udp-query/expected_result @@ -1,30 +1,2 @@ -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. -0 toomuchinfo-b.example.com. IN A 120 192.168.99. Rcode: 0 (No Error), RD: 0, QR: 1, TC: 1, AA: 1, opcode: 0 Reply to question for qname='toomuchinfo-b.example.com.', qtype=A