Commit d040fa2f authored by Mark Andrews's avatar Mark Andrews

4011. [bug] master's list port and dscp inheritance was not

                        properly implemented. [RT #37792]
parent 092d3b76
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]
......
......@@ -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;
......
......@@ -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*
......@@ -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; }; };
/*
* 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";
};
......@@ -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
......@@ -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
......@@ -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=<FH>) {
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=<FH>) {
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`;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment