MIME-Version: 1.0 Date: Thu, 27 Jul 2017 17:58:34 -1000 Message-ID: To: bind9-public@isc.org Content-Transfer-Encoding: binary From: marka@isc.org X-Mailer: MIME-tools 5.508 (Entity 5.508) Content-Disposition: inline Subject: rndc various: class is not being treated as optional when it should be X-RT-Interface: Web Content-Type: text/plain; charset="utf-8" X-RT-Original-Encoding: utf-8 Content-Length: 1849 When developing server-stale it was noted: > * If IN class string is only passed to rndc ttl-stretching, it doesn't > look like it skips non-matching classes The code matches that from other options with the same documentation. These all need fixing to address this in a manner similar to this: diff --git a/bin/named/server.c b/bin/named/server.c index a444aef231..66ffec0939 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -13930,17 +13930,16 @@ ns_server_servestale(ns_server_t *server, isc_lex_t *lex, viewtxt = next_token(lex, text); } - if (classtxt == NULL) { - rdclass = dns_rdataclass_in; - } else { + if (classtxt != NULL) { isc_textregion_t r; + r.base = classtxt; r.length = strlen(classtxt); result = dns_rdataclass_fromtext(&rdclass, &r); if (result != ISC_R_SUCCESS) { if (viewtxt == NULL) { - rdclass = dns_rdataclass_in; viewtxt = classtxt; + classtxt = NULL; result = ISC_R_SUCCESS; } else { snprintf(msg, sizeof(msg), @@ -13961,9 +13960,10 @@ ns_server_servestale(ns_server_t *server, isc_lex_t *lex, dns_ttl_t stale_ttl = 0; dns_db_t *db = NULL; - if (viewtxt != NULL && - (rdclass != view->rdclass || - strcmp(view->name, viewtxt) != 0)) + if (classtxt != NULL && rdclass != view->rdclass) + continue; + + if (viewtxt != NULL && strcmp(view->name, viewtxt) != 0) continue; if (!wantstatus) {