]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
fix chaosnet address comparison
authorEvan Hunt <each@isc.org>
Fri, 28 Sep 2018 00:17:30 +0000 (17:17 -0700)
committerEvan Hunt <each@isc.org>
Fri, 28 Sep 2018 07:42:03 +0000 (00:42 -0700)
CHANGES
bin/tests/system/auth/clean.sh
bin/tests/system/auth/ns1/chaos.db [new file with mode: 0644]
bin/tests/system/auth/ns1/named.conf.in
bin/tests/system/auth/tests.sh
lib/dns/rdata/ch_3/a_1.c
util/copyrights

diff --git a/CHANGES b/CHANGES
index d58c1882a1a175f240d6a7deeaa0d9b29f9fe139..ab92f4d4b6bdd9d76f0c9179b6f3973a0949d1c8 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+5038.  [bug]           Chaosnet addresses were compared incorrectly.
+                       [GL #562]
+
 5037.  [func]          "allow-recursion-on" and "allow-query-cache-on"
                        each now default to the other if only one of them
                        is set, in order to be more consistent with the way
index a3efd21a4b3aaae75a50d7b7680981a3cd0eb64a..f44ecc493118077827319f6fc9fe67ca4cfaac8f 100644 (file)
@@ -13,4 +13,4 @@ rm -f */named.conf
 rm -f dig.out.test*
 rm -f ns2/example.com.bk
 rm -f ns2/example.net.bk
-rm -f ns*/managed-keys.bind*
+rm -f ns*/managed-keys.bind* ns*/*mkeys*
diff --git a/bin/tests/system/auth/ns1/chaos.db b/bin/tests/system/auth/ns1/chaos.db
new file mode 100644 (file)
index 0000000..758f4f6
--- /dev/null
@@ -0,0 +1,21 @@
+; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+;
+; This Source Code Form is subject to the terms of the Mozilla Public
+; License, v. 2.0. If a copy of the MPL was not distributed with this
+; file, You can obtain one at http://mozilla.org/MPL/2.0/.
+;
+; See the COPYRIGHT file distributed with this work for additional
+; information regarding copyright ownership.
+
+$TTL 300       ; 5 minutes
+@                      CH SOA  ns root (
+                               2018010100 ; serial
+                               1800       ; refresh (30 minutes)
+                               1800       ; retry (30 minutes)
+                               1814400    ; expire (3 weeks)
+                               3600       ; minimum (1 hour)
+                               )
+                       NS      ns
+ns                     A       ch-addr.net. 1001
+test                   A       ch-addr.net. 1002
+                       A       ch-addr.net. 1003
index f239e15a736331d3616ef1eb043d37dfa75ccd72..1cddc494034493296c84ce6c4f7be0034df5227d 100644 (file)
@@ -21,12 +21,21 @@ options {
        notify yes;
 };
 
-zone example.net {
-       type master;
-       file "example.net.db";
+view main in {
+       zone example.net {
+               type master;
+               file "example.net.db";
+       };
+
+       zone example.com {
+               type master;
+               file "example.com.db";
+       };
 };
 
-zone example.com {
-       type master;
-       file "example.com.db";
+view alt chaos {
+       zone example.chaos chaos {
+               type master;
+               file "chaos.db";
+       };
 };
index 348fcf8975d75260415772413df8f1efe3a69c74..cc47c39b92dd0cf9db05221d742e88b249ea63a7 100644 (file)
@@ -128,5 +128,14 @@ grep "a.example.com.*A.*10.53.0.1" dig.out.test$n > /dev/null || ret=1
 [ $ret -eq 0 ] || echo_i "failed"
 status=`expr $status + $ret`
 
+n=`expr $n + 1`
+echo_i "check that CHAOS addresses are compared correctly ($n)"
+ret=0
+$DIG $DIGOPTS @10.53.0.1 +noall +answer ch test.example.chaos > dig.out.test$n
+lines=`wc -l < dig.out.test$n`
+[ ${lines:-0} -eq 2 ] || ret=1
+[ $ret -eq 0 ] || echo_i "failed"
+status=`expr $status + $ret`
+
 echo_i "exit status: $status"
 [ $status -eq 0 ] || exit 1
index a1b571fa14582bd207b7aa598e2ed2f496686cd4..94cae92c3c0a69e30e49df76d971050c91ff7128 100644 (file)
@@ -179,7 +179,7 @@ compare_ch_a(ARGS_COMPARE) {
        if (order != 0)
                return (order);
 
-       order = memcmp(rdata1->data, rdata2->data, 2);
+       order = memcmp(region1.base, region2.base, 2);
        if (order != 0)
                order = (order < 0) ? -1 : 1;
        return (order);
index 8b942e52a76fe81f5d2cb45b1b0290e99475ae56..bd7e66e020f30ee81fe9e569595dbb408476bcaa 100644 (file)
 ./bin/tests/system/allow-query/tests.sh                SH      2010,2012,2013,2016,2018
 ./bin/tests/system/ans.pl                      PERL    2011,2012,2014,2016,2017,2018
 ./bin/tests/system/auth/clean.sh               SH      2018
+./bin/tests/system/auth/ns1/chaos.db           ZONE    2018
 ./bin/tests/system/auth/ns1/example.com.db     ZONE    2018
 ./bin/tests/system/auth/ns1/example.net.db     ZONE    2018
 ./bin/tests/system/auth/ns1/named.conf.in      CONF-C  2018