diff --git a/CHANGES b/CHANGES index 3da1632ea4..dadb50602f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +4011. [bug] master's list port and dscp inheritance was not + properly implemented. [RT #37792] + 4010. [cleanup] Clear the prefetchable state when initiating a prefetch. [RT #37399] diff --git a/bin/named/config.c b/bin/named/config.c index f23083013e..6c7fe19fb5 100644 --- a/bin/named/config.c +++ b/bin/named/config.c @@ -588,6 +588,17 @@ ns_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list, REQUIRE(keysp != NULL && *keysp == NULL); REQUIRE(countp != NULL); + /* + * Get system defaults. + */ + result = ns_config_getport(config, &port); + if (result != ISC_R_SUCCESS) + goto cleanup; + + result = ns_config_getdscp(config, &dscp); + if (result != ISC_R_SUCCESS) + goto cleanup; + newlist: addrlist = cfg_tuple_get(list, "addresses"); portobj = cfg_tuple_get(list, "port"); @@ -602,10 +613,6 @@ ns_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list, goto cleanup; } port = (in_port_t) val; - } else { - result = ns_config_getport(config, &port); - if (result != ISC_R_SUCCESS) - goto cleanup; } if (dscpobj != NULL && cfg_obj_isuint32(dscpobj)) { @@ -616,10 +623,6 @@ ns_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list, return (ISC_R_RANGE); } dscp = (isc_dscp_t)cfg_obj_asuint32(dscpobj); - } else { - result = ns_config_getdscp(config, &dscp); - if (result != ISC_R_SUCCESS) - goto cleanup; } result = ISC_R_NOMEMORY; diff --git a/bin/tests/system/notify/clean.sh b/bin/tests/system/notify/clean.sh index 7fadeefe57..2f11059222 100644 --- a/bin/tests/system/notify/clean.sh +++ b/bin/tests/system/notify/clean.sh @@ -19,7 +19,12 @@ # Clean up after zone transfer tests. # -rm -f ns3/example.bk dig.out.ns2.test* dig.out.ns3.test* -rm -f ns2/example.db -rm -f log.out rm -f */named.memstats +rm -f dig.out.ns2.test* +rm -f dig.out.ns3.test* +rm -f dig.out.ns4.test* +rm -f log.out +rm -f ns2/example.db +rm -f ns2/x21.db* +rm -f ns3/example.bk +rm -f ns4/x21.bk* diff --git a/bin/tests/system/notify/ns2/named.conf b/bin/tests/system/notify/ns2/named.conf index 1fe1086c63..fe00aa5d26 100644 --- a/bin/tests/system/notify/ns2/named.conf +++ b/bin/tests/system/notify/ns2/named.conf @@ -42,6 +42,10 @@ zone "example" { also-notify { /* empty */ }; }; +masters noport { 10.53.0.4; }; + +masters x21 port 5301 { noport; }; + zone x1 { type master; file "generic.db"; also-notify { 10.53.0.3; }; }; zone x2 { type master; file "generic.db"; also-notify { 10.53.0.3; }; }; zone x3 { type master; file "generic.db"; also-notify { 10.53.0.3; }; }; @@ -62,3 +66,4 @@ zone x17 { type master; file "generic.db"; also-notify { 10.53.0.3; }; }; zone x18 { type master; file "generic.db"; also-notify { 10.53.0.3; }; }; zone x19 { type master; file "generic.db"; also-notify { 10.53.0.3; }; }; zone x20 { type master; file "generic.db"; also-notify { 10.53.0.3; }; }; +zone x21 { type master; file "x21.db"; allow-update { any; }; also-notify { x21; }; }; diff --git a/bin/tests/system/notify/ns4/named.conf b/bin/tests/system/notify/ns4/named.conf new file mode 100644 index 0000000000..e1084f236b --- /dev/null +++ b/bin/tests/system/notify/ns4/named.conf @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2000, 2001 Internet Software Consortium. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* $Id: named.conf,v 1.24 2007/06/18 23:47:29 tbox Exp $ */ + +controls { /* empty */ }; + +options { + query-source address 10.53.0.4; + notify-source 10.53.0.4; + transfer-source 10.53.0.4; + port 5301; + pid-file "named.pid"; + listen-on { 10.53.0.4; }; + listen-on-v6 { none; }; + recursion yes; + acache-enable yes; + notify yes; +}; + +zone "." { + type hint; + file "../../common/root.hint"; +}; + +zone "x21" { + type slave; + masters { 10.53.0.2 port 5300; }; + file "x21.bk"; +}; diff --git a/bin/tests/system/notify/ns4/named.port b/bin/tests/system/notify/ns4/named.port new file mode 100644 index 0000000000..3cda32bc25 --- /dev/null +++ b/bin/tests/system/notify/ns4/named.port @@ -0,0 +1 @@ +5301 diff --git a/bin/tests/system/notify/setup.sh b/bin/tests/system/notify/setup.sh index e989e4bb05..2e0b5e1830 100644 --- a/bin/tests/system/notify/setup.sh +++ b/bin/tests/system/notify/setup.sh @@ -18,3 +18,4 @@ # $Id: setup.sh,v 1.10 2007/06/19 23:47:04 tbox Exp $ cp -f ns2/example1.db ns2/example.db +cp -f ns2/generic.db ns2/x21.db diff --git a/bin/tests/system/notify/tests.sh b/bin/tests/system/notify/tests.sh index 1e2d7b8143..a6eeafb4ec 100644 --- a/bin/tests/system/notify/tests.sh +++ b/bin/tests/system/notify/tests.sh @@ -150,5 +150,25 @@ $PERL ../digcomp.pl dig.out.ns2.test$n dig.out.ns3.test$n || ret=1 [ $ret = 0 ] || echo "I:failed" status=`expr $ret + $status` +n=`expr $n + 1` +echo "I:checking notify to alternate port with master inheritance" +$NSUPDATE << EOF +server 10.53.0.2 5300 +zone x21 +update add added.x21 0 in txt "test string" +send +EOF +for i in 1 2 3 4 5 6 7 8 9 +do + $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd added.x21.\ + @10.53.0.4 txt -p 5301 > dig.out.ns4.test$n || ret=1 + grep "test string" dig.out.ns4.test$n > /dev/null && break + sleep 1 +done +grep "test string" dig.out.ns4.test$n > /dev/null || ret=1 + +[ $ret = 0 ] || echo "I:failed" +status=`expr $ret + $status` + echo "I:exit status: $status" exit $status diff --git a/bin/tests/system/start.pl b/bin/tests/system/start.pl index f5d2d352c1..c4863c60d9 100644 --- a/bin/tests/system/start.pl +++ b/bin/tests/system/start.pl @@ -104,14 +104,28 @@ if ($server) { sub check_ports { my $server = shift; my $options = ""; + my $port = 5300; + my $file = ""; + + $file = $testdir . "/" . $server . "/named.port" if ($server); if ($server && $server =~ /(\d+)$/) { $options = "-i $1"; } + if ($file ne "" && -e $file) { + open(FH, "<", $file); + while(my $line=) { + chomp $line; + $port = $line; + last; + } + close FH; + } + my $tries = 0; while (1) { - my $return = system("$PERL $topdir/testsock.pl -p 5300 $options"); + my $return = system("$PERL $topdir/testsock.pl -p $port $options"); last if ($return == 0); if (++$tries > 4) { print "$0: could not bind to server addresses, still running?\n"; @@ -258,11 +272,23 @@ sub start_server { sub verify_server { my $server = shift; my $n = $server; + my $port = 5300; + $n =~ s/^ns//; + if (-e "$testdir/$server/named.port") { + open(FH, "<", "$testdir/$server/named.port"); + while(my $line=) { + chomp $line; + $port = $line; + last; + } + close FH; + } + my $tries = 0; while (1) { - my $return = system("$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd +noedns -p 5300 version.bind. chaos txt \@10.53.0.$n > dig.out"); + my $return = system("$DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd +noedns -p $port version.bind. chaos txt \@10.53.0.$n > dig.out"); last if ($return == 0); if (++$tries >= 30) { print `grep ";" dig.out > /dev/null`;