From: Mark Andrews Date: Mon, 22 Dec 2014 21:37:46 +0000 (+1100) Subject: 4027. [port] Net::DNS 0.81 compatibility. [RT #38165 X-Git-Tag: v9.11.0a1~1159 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=511ec77fca2e2df66b36f4756fd2459cfe7998d9;p=thirdparty%2Fbind9.git 4027. [port] Net::DNS 0.81 compatibility. [RT #38165 --- diff --git a/CHANGES b/CHANGES index e8f11677c4c..467a3ba6ba0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +4027. [port] Net::DNS 0.81 compatibility. [RT #38165] + 4026. [bug] Fix RFC 3658 reference in dig +sigchase. [RT #38173] 4025. [port] bsdi: failed to build. [RT #38047] diff --git a/bin/tests/system/ans.pl b/bin/tests/system/ans.pl index e76542797af..b1e02d37ec1 100644 --- a/bin/tests/system/ans.pl +++ b/bin/tests/system/ans.pl @@ -327,6 +327,8 @@ sub handleTCP { my $qclass = $questions[0]->qclass; my $id = $request->header->id; + my $opaque; + my $packet = new Net::DNS::Packet($qname, $qtype, $qclass); $packet->header->qr(1); $packet->header->aa(1); @@ -336,9 +338,11 @@ sub handleTCP { my $prev_tsig; my $signer; my $continuation = 0; - while (my $rr = $request->pop("additional")) { - if ($rr->type eq "TSIG") { - $prev_tsig = $rr; + if ($Net::DNS::VERSION < 0.81) { + while (my $rr = $request->pop("additional")) { + if ($rr->type eq "TSIG") { + $prev_tsig = $rr; + } } } @@ -356,7 +360,7 @@ sub handleTCP { foreach $a (@{$r->{answer}}) { $packet->push("answer", $a); } - if(defined($key_name) && defined($key_data)) { + if (defined($key_name) && defined($key_data)) { my $tsig; # sign the packet print " Signing the data with " . @@ -365,6 +369,8 @@ sub handleTCP { if ($Net::DNS::VERSION < 0.69) { $tsig = Net::DNS::RR->new( "$key_name TSIG $key_data"); + } elsif ($Net::DNS::VERSION >= 0.81 && + $continuation) { } elsif ($Net::DNS::VERSION >= 0.75 && $continuation) { $tsig = $prev_tsig; @@ -394,7 +400,7 @@ sub handleTCP { $prev_tsig->mac); $tsig->{"request_mac"} = unpack("H*", $rmac); - } else { + } elsif ($Net::DNS::VERSION < 0.81) { $tsig->request_mac( $prev_tsig->mac); } @@ -404,7 +410,13 @@ sub handleTCP { $tsig->continuation($continuation) if ($Net::DNS::VERSION >= 0.71 && $Net::DNS::VERSION <= 0.74 ); - $packet->sign_tsig($tsig); + if ($Net::DNS::VERSION < 0.81) { + $packet->sign_tsig($tsig); + } elsif ($continuation) { + $opaque = $packet->sign_tsig($opaque); + } else { + $opaque = $packet->sign_tsig($request); + } $signer = \&sign_tcp_continuation if ($Net::DNS::VERSION < 0.70); $continuation = 1;