From 86a4a21099f77b33401a0e96ec0865ba2cc26022 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Fri, 21 Dec 2012 00:30:14 +1100 Subject: [PATCH] TSIG no longer has a mac_size method; arcount no longer need to be adjusted --- bin/tests/system/ans.pl | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/bin/tests/system/ans.pl b/bin/tests/system/ans.pl index b18b9803ef..4caa1f6e42 100644 --- a/bin/tests/system/ans.pl +++ b/bin/tests/system/ans.pl @@ -162,11 +162,13 @@ sub handleUDP { # function will attempt to decrement it, # which is incorrect in a response. Finally # we set request_mac to the previous digest. - $packet->{"compnames"} = {}; - $packet->{"header"}{"arcount"} += 1; + $packet->{"compnames"} = {} + if ($Net::DNS::VERSION < 0.70); + $packet->{"header"}{"arcount"} += 1 + if ($Net::DNS::VERSION < 0.70); if (defined($prev_tsig)) { my $rmac = pack('n H*', - $prev_tsig->mac_size, + length($prev_tsig->mac)/2, $prev_tsig->mac); $tsig->{"request_mac"} = unpack("H*", $rmac); @@ -356,11 +358,13 @@ sub handleTCP { # function will attempt to decrement it, # which is incorrect in a response. Finally # we set request_mac to the previous digest. - $packet->{"compnames"} = {}; - $packet->{"header"}{"arcount"} += 1; + $packet->{"compnames"} = {} + if ($Net::DNS::VERSION < 0.70); + $packet->{"header"}{"arcount"} += 1 + if ($Net::DNS::VERSION < 0.70); if (defined($prev_tsig)) { my $rmac = pack('n H*', - $prev_tsig->mac_size, + length($prev_tsig->mac)/2, $prev_tsig->mac); $tsig->{"request_mac"} = unpack("H*", $rmac);