From: Evan Hunt Date: Wed, 12 Mar 2014 15:45:44 +0000 (-0700) Subject: [master] fixed 'fixed' X-Git-Tag: v9.10.0b2~20 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=89740699cd2191d9b84e67716c281b2dfeba5e56;p=thirdparty%2Fbind9.git [master] fixed 'fixed' 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] --- diff --git a/CHANGES b/CHANGES index aa2656dd370..b14faa51d38 100644 --- 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. diff --git a/bin/named/server.c b/bin/named/server.c index 80481a79df9..14bbdf28c11 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -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")) diff --git a/bin/tests/system/rrsetorder/tests.sh b/bin/tests/system/rrsetorder/tests.sh index a533b02e9a4..2725a0e6659 100644 --- a/bin/tests/system/rrsetorder/tests.sh +++ b/bin/tests/system/rrsetorder/tests.sh @@ -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 #