]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
4194. [bug] named-checkconf -p failed to properly print a port
authorMark Andrews <marka@isc.org>
Wed, 9 Sep 2015 06:49:11 +0000 (16:49 +1000)
committerMark Andrews <marka@isc.org>
Wed, 9 Sep 2015 06:49:11 +0000 (16:49 +1000)
                        range.  [RT #40634]

CHANGES
bin/tests/system/checkconf/portrange-good.conf [new file with mode: 0644]
bin/tests/system/checkconf/tests.sh
lib/isccfg/namedconf.c

diff --git a/CHANGES b/CHANGES
index 0d3f2edc138ed97aadabbc95fc97f85e6d6efd3e..5769b16166cf9ad685f3493a8aa1f806d59682dc 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+4194.  [bug]           named-checkconf -p failed to properly print a port
+                       range.  [RT #40634]
+
 4193.  [bug]           Handle broken servers that return BADVERS incorrectly.
                        [RT #40427]
 
diff --git a/bin/tests/system/checkconf/portrange-good.conf b/bin/tests/system/checkconf/portrange-good.conf
new file mode 100644 (file)
index 0000000..fe25efa
--- /dev/null
@@ -0,0 +1,9 @@
+options {
+       avoid-v4-udp-ports {
+                1935;
+                2605;
+                4321;
+                6514;
+                range 8610 8614;
+        };
+};
index 6a77f7738be6cde96bf7ce9e27c216b4b10e1fc7..54792f6b5733ef353e7416aeb2495502311bf56d 100644 (file)
@@ -247,5 +247,12 @@ grep "zone check-mx-cname/IN: loaded serial" < checkconf.out6 > /dev/null && ret
 if [ $ret != 0 ]; then echo "I:failed"; ret=1; fi
 status=`expr $status + $ret`
 
+echo "I: check that named-checkconf -p properly print a port range"
+ret=0
+$CHECKCONF -p portrange-good.conf > checkconf.out7 2>&1 || ret=1
+grep "range 8610 8614;" checkconf.out7 > /dev/null || ret=1
+if [ $ret != 0 ]; then echo "I:failed"; ret=1; fi
+status=`expr $status + $ret`
+
 echo "I:exit status: $status"
 exit $status
index 12830e0c6a1b7a3eb25a9c1bd476233f0280a783..613961c24f4cf35920bb00049a5a3a7de05ef0f3 100644 (file)
@@ -809,13 +809,18 @@ static cfg_type_t cfg_type_serverid = {
 /*%
  * Port list.
  */
+static void
+print_porttuple(cfg_printer_t *pctx, const cfg_obj_t *obj) {
+       cfg_print_cstr(pctx, "range ");
+       cfg_print_tuple(pctx, obj);
+}
 static cfg_tuplefielddef_t porttuple_fields[] = {
        { "loport", &cfg_type_uint32, 0 },
        { "hiport", &cfg_type_uint32, 0 },
        { NULL, NULL, 0 }
 };
 static cfg_type_t cfg_type_porttuple = {
-       "porttuple", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
+       "porttuple", cfg_parse_tuple, print_porttuple, cfg_doc_tuple,
        &cfg_rep_tuple, porttuple_fields
 };