]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[master] fixed 'fixed'
authorEvan Hunt <each@isc.org>
Wed, 12 Mar 2014 15:45:44 +0000 (08:45 -0700)
committerEvan Hunt <each@isc.org>
Wed, 12 Mar 2014 15:45:44 +0000 (08:45 -0700)
3784. [bug] Using "rrset-order fixed" when it had not been
enabled at compile time caused inconsistent
results. It now works as documented, defaulting
to cyclic mode. [RT #28104]

CHANGES
bin/named/server.c
bin/tests/system/rrsetorder/tests.sh

diff --git a/CHANGES b/CHANGES
index aa2656dd370c5f7ba276418007fd7a7f8edffb3a..b14faa51d386ab18aed8b4ff57b1f5a093c57782 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,8 @@
+3784.  [bug]           Using "rrset-order fixed" when it had not been
+                       enabled at compile time caused inconsistent
+                       results. It now works as documented, defaulting
+                       to cyclic mode. [RT #28104]
+
 3783.  [func]          "tsig-keygen" is now available as an alternate
                        command name for "ddns-confgen".  It generates
                        a TSIG key in named.conf format without comments.
index 80481a79df97d80da4c3e5b7979a7c30dd009fa2..14bbdf28c11296702eb03111b8c0e74d7614d97d 100644 (file)
@@ -1113,7 +1113,11 @@ configure_order(dns_order_t *order, const cfg_obj_t *ent) {
        INSIST(cfg_obj_isstring(obj));
        str = cfg_obj_asstring(obj);
        if (!strcasecmp(str, "fixed"))
+#if DNS_RDATASET_FIXED
                mode = DNS_RDATASETATTR_FIXEDORDER;
+#else
+               mode = 0;
+#endif /* DNS_RDATASET_FIXED */
        else if (!strcasecmp(str, "random"))
                mode = DNS_RDATASETATTR_RANDOMIZE;
        else if (!strcasecmp(str, "cyclic"))
index a533b02e9a4a72b02e6bbdb2ae3b3dadb95b7f23..2725a0e6659d9c8ede7d8e9c3fff635bf76221bf 100644 (file)
@@ -42,6 +42,29 @@ if $test_fixed; then
     done
     if [ $ret != 0 ]; then echo "I:failed"; fi
     status=`expr $status + $ret`
+else
+    echo "I: Checking order fixed behaves as cyclic when disabled (master)"
+    ret=0
+    for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
+    do
+        j=`expr $i % 4`
+        $DIG +nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm +nostat +short \
+                -p 5300 @10.53.0.1 fixed.example > dig.out.fixed  || ret=1
+        if [ $i -le 4 ]; then
+            cp dig.out.fixed  dig.out.$j
+        else
+            cmp -s dig.out.fixed dig.out.$j && matches=`expr $matches + 1`
+        fi
+    done
+    cmp -s dig.out.0 dig.out.1 && ret=1
+    cmp -s dig.out.0 dig.out.2 && ret=1
+    cmp -s dig.out.0 dig.out.3 && ret=1
+    cmp -s dig.out.1 dig.out.2 && ret=1
+    cmp -s dig.out.1 dig.out.3 && ret=1
+    cmp -s dig.out.2 dig.out.3 && ret=1
+    if [ $matches -ne 16 ]; then ret=1; fi
+    if [ $ret != 0 ]; then echo "I:failed"; fi
+    status=`expr $status + $ret`
 fi
 
 #