2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

Test NOTIMP being returned to an IXFR request in xfrin

The server is expected to retry the transfer using SOA and if
the returned serial is greater than the current serial AXFR.

Check the log that IXFR is request.
This commit is contained in:
Mark Andrews 2023-10-18 18:13:52 +11:00
parent 30e182ea56
commit a99adb9efa
4 changed files with 45 additions and 1 deletions

View File

@ -82,6 +82,7 @@ Files: **/*.after*
bin/tests/system/xfer/ans5/badkeydata
bin/tests/system/xfer/ans5/badmessageid
bin/tests/system/xfer/ans5/goodaxfr
bin/tests/system/xfer/ans5/ixfrnotimp
bin/tests/system/xfer/ans5/partial
bin/tests/system/xfer/ans5/soamismatch
bin/tests/system/xfer/ans5/unknownkey

View File

@ -65,6 +65,11 @@
# pattern, only this data will be signed. Currently, this is only
# done for TCP.
#
# /pattern NOTIMP <key> <key_data>/
# /pattern NOTIMP/
#
# Return a NOTIMP response
#
# /pattern bad-id <key> <key_data>/
# /pattern bad-id/
#
@ -376,13 +381,20 @@ sub handleTCP {
if ("$qname $qtype" =~ /$dbtype/) {
$count_these++;
my $a;
my $done = 0;
foreach $a (@{$r->{answer}}) {
$packet->push("answer", $a);
}
if (defined($key_name) && $key_name eq "NOTIMP") {
$packet->header->rcode('NOTIMP');
$key_name = $key_data;
($key_data, $tname) = split(/ /,$tname);
$done = 1;
}
if (defined($key_name) && $key_name eq "bad-id") {
$packet->header->id(($id+50)%0xffff);
$key_name = $key_data;
($key_data, $tname) = split(/ /,$tname)
($key_data, $tname) = split(/ /,$tname);
}
if (defined($key_name) && defined($key_data)) {
my $tsig;
@ -453,6 +465,7 @@ sub handleTCP {
}
#$packet->print;
push(@results,$packet->data);
last if ($done);
if ($tname eq "") {
$tname = $qname;
}

View File

@ -0,0 +1,11 @@
/SOA tsig_key LSAnCU+Z/
nil. 300 SOA ns.nil. root.nil. 2 300 300 604800 300
/IXFR NOTIMP tsig_key LSAnCU+Z/
/AXFR tsig_key LSAnCU+Z/
nil. 300 SOA ns.nil. root.nil. 2 300 300 604800 300
/AXFR tsig_key LSAnCU+Z/
nil. 300 NS ns.nil.
nil. 300 TXT "IXFR NOTIMP"
a.nil. 60 A 10.0.0.61
/AXFR tsig_key LSAnCU+Z/
nil. 300 SOA ns.nil. root.nil. 2 300 300 604800 300

View File

@ -307,6 +307,25 @@ $DIGCMD nil. TXT | grep 'initial AXFR' >/dev/null || {
status=$((status+1))
}
n=$((n+1))
echo_i "handle IXFR NOTIMP ($n)"
sendcmd < ans5/ixfrnotimp
$RNDCCMD 10.53.0.4 refresh nil | sed 's/^/ns4 /' | cat_i
sleep 2
nextpart ns4/named.run | grep "zone nil/IN: requesting IXFR from 10.53.0.5" > /dev/null || {
echo_i "failed: expected status was not logged"
status=$((status+1))
}
$DIGCMD nil. TXT | grep 'IXFR NOTIMP' >/dev/null || {
echo_i "failed"
status=$((status+1))
}
n=$((n+1))
echo_i "unsigned transfer ($n)"