From: Mark Andrews Date: Wed, 29 Aug 2018 06:09:09 +0000 (+1000) Subject: use pack to construct the reply as Net::DNS just get it wrong X-Git-Tag: v9.13.3~13^2 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=feaf381adb6d2f75caebefff95ddd66511ac056c;p=thirdparty%2Fbind9.git use pack to construct the reply as Net::DNS just get it wrong --- diff --git a/bin/tests/system/resolver/ans8/ans.pl b/bin/tests/system/resolver/ans8/ans.pl index 80e288219e9..f8430098cd2 100644 --- a/bin/tests/system/resolver/ans8/ans.pl +++ b/bin/tests/system/resolver/ans8/ans.pl @@ -76,18 +76,15 @@ sub handleUDP { return $packet->data; } - # Ensure the QUESTION section is empty in the response. - $packet->pop("question"); + # don't use Net::DNS to construct the header only reply as early + # versions just get it completely wrong. if ($qname eq "truncated.no-questions") { - $packet->header->tc(1); + # QR, AA, TC + return (pack("nnnnnn", $packet->header->id, 0x8600, 0, 0, 0, 0)); } - - # Net::DNS versions < 0.68 insert an ./ANY RR into the QUESTION section - # if the latter is empty. Make sure Net::DNS version does not - # influence the return value of this function by returning the query ID - # and flags generated by Net::DNS with 8 zero bytes appended. - return substr($packet->data, 0, 4) . "\x00" x 8; + # QR, AA + return (pack("nnnnnn", $packet->header->id, 0x8400, 0, 0, 0, 0)); } sub handleTCP {