From 1df4141279200f1d689bc04492f142cb1ae0f78e Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Tue, 5 May 2020 12:48:31 -0700 Subject: [PATCH] initialize sockaddrdscp to prevent spurious output from 'named-checkconf -p' (cherry picked from commit f8d753d452fdbe18a89d9cedab58a51c9b48f113) --- CHANGES | 4 ++++ bin/tests/system/checkconf/good.conf | 6 ++++++ lib/isccfg/parser.c | 1 + 3 files changed, 11 insertions(+) diff --git a/CHANGES b/CHANGES index ec7b332433..8df68389ae 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +5405. [bug] 'named-checkconf -p' could include spurious text + in server-addresses statements due to an uninitialized + DSCP value. [GL #1812] + 5404. [bug] 'named-checkconf -z' could incorrectly indicate success if errors were found in one view but not in a subsequent one. [GL #1807] diff --git a/bin/tests/system/checkconf/good.conf b/bin/tests/system/checkconf/good.conf index 9ab35b38a5..09d188abe0 100644 --- a/bin/tests/system/checkconf/good.conf +++ b/bin/tests/system/checkconf/good.conf @@ -104,6 +104,12 @@ view "second" { }; zone-statistics no; }; + zone "example3" { + type static-stub; + server-addresses { + 1.2.3.4; + }; + }; zone "clone" { in-view "first"; }; diff --git a/lib/isccfg/parser.c b/lib/isccfg/parser.c index 794780068e..e2af054661 100644 --- a/lib/isccfg/parser.c +++ b/lib/isccfg/parser.c @@ -2522,6 +2522,7 @@ parse_netaddr(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) { CHECK(cfg_create_obj(pctx, type, &obj)); CHECK(cfg_parse_rawaddr(pctx, flags, &netaddr)); isc_sockaddr_fromnetaddr(&obj->value.sockaddr, &netaddr, 0); + obj->value.sockaddrdscp.dscp = -1; *ret = obj; return (ISC_R_SUCCESS); cleanup: