Commit 23fff6c5 authored by Ondřej Surý's avatar Ondřej Surý
Browse files

Hint the compiler with ISC_UNREACHABLE(); that code after INSIST(0); cannot be reached

parent b992b5b8
...@@ -282,8 +282,10 @@ configure_zone(const char *vclass, const char *view, ...@@ -282,8 +282,10 @@ configure_zone(const char *vclass, const char *view,
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) { } else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
zone_options &= ~DNS_ZONEOPT_CHECKDUPRR; zone_options &= ~DNS_ZONEOPT_CHECKDUPRR;
zone_options &= ~DNS_ZONEOPT_CHECKDUPRRFAIL; zone_options &= ~DNS_ZONEOPT_CHECKDUPRRFAIL;
} else } else {
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
}
} else { } else {
zone_options |= DNS_ZONEOPT_CHECKDUPRR; zone_options |= DNS_ZONEOPT_CHECKDUPRR;
zone_options &= ~DNS_ZONEOPT_CHECKDUPRRFAIL; zone_options &= ~DNS_ZONEOPT_CHECKDUPRRFAIL;
...@@ -300,8 +302,10 @@ configure_zone(const char *vclass, const char *view, ...@@ -300,8 +302,10 @@ configure_zone(const char *vclass, const char *view,
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) { } else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
zone_options &= ~DNS_ZONEOPT_CHECKMX; zone_options &= ~DNS_ZONEOPT_CHECKMX;
zone_options &= ~DNS_ZONEOPT_CHECKMXFAIL; zone_options &= ~DNS_ZONEOPT_CHECKMXFAIL;
} else } else {
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
}
} else { } else {
zone_options |= DNS_ZONEOPT_CHECKMX; zone_options |= DNS_ZONEOPT_CHECKMX;
zone_options &= ~DNS_ZONEOPT_CHECKMXFAIL; zone_options &= ~DNS_ZONEOPT_CHECKMXFAIL;
...@@ -327,8 +331,10 @@ configure_zone(const char *vclass, const char *view, ...@@ -327,8 +331,10 @@ configure_zone(const char *vclass, const char *view,
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) { } else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
zone_options |= DNS_ZONEOPT_WARNMXCNAME; zone_options |= DNS_ZONEOPT_WARNMXCNAME;
zone_options |= DNS_ZONEOPT_IGNOREMXCNAME; zone_options |= DNS_ZONEOPT_IGNOREMXCNAME;
} else } else {
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
}
} else { } else {
zone_options |= DNS_ZONEOPT_WARNMXCNAME; zone_options |= DNS_ZONEOPT_WARNMXCNAME;
zone_options &= ~DNS_ZONEOPT_IGNOREMXCNAME; zone_options &= ~DNS_ZONEOPT_IGNOREMXCNAME;
...@@ -345,8 +351,10 @@ configure_zone(const char *vclass, const char *view, ...@@ -345,8 +351,10 @@ configure_zone(const char *vclass, const char *view,
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) { } else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
zone_options |= DNS_ZONEOPT_WARNSRVCNAME; zone_options |= DNS_ZONEOPT_WARNSRVCNAME;
zone_options |= DNS_ZONEOPT_IGNORESRVCNAME; zone_options |= DNS_ZONEOPT_IGNORESRVCNAME;
} else } else {
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
}
} else { } else {
zone_options |= DNS_ZONEOPT_WARNSRVCNAME; zone_options |= DNS_ZONEOPT_WARNSRVCNAME;
zone_options &= ~DNS_ZONEOPT_IGNORESRVCNAME; zone_options &= ~DNS_ZONEOPT_IGNORESRVCNAME;
...@@ -366,8 +374,10 @@ configure_zone(const char *vclass, const char *view, ...@@ -366,8 +374,10 @@ configure_zone(const char *vclass, const char *view,
zone_options |= DNS_ZONEOPT_CHECKSPF; zone_options |= DNS_ZONEOPT_CHECKSPF;
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) { } else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
zone_options &= ~DNS_ZONEOPT_CHECKSPF; zone_options &= ~DNS_ZONEOPT_CHECKSPF;
} else } else {
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
}
} else { } else {
zone_options |= DNS_ZONEOPT_CHECKSPF; zone_options |= DNS_ZONEOPT_CHECKSPF;
} }
...@@ -383,8 +393,10 @@ configure_zone(const char *vclass, const char *view, ...@@ -383,8 +393,10 @@ configure_zone(const char *vclass, const char *view,
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) { } else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
zone_options &= ~DNS_ZONEOPT_CHECKNAMES; zone_options &= ~DNS_ZONEOPT_CHECKNAMES;
zone_options &= ~DNS_ZONEOPT_CHECKNAMESFAIL; zone_options &= ~DNS_ZONEOPT_CHECKNAMESFAIL;
} else } else {
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
}
} else { } else {
zone_options |= DNS_ZONEOPT_CHECKNAMES; zone_options |= DNS_ZONEOPT_CHECKNAMES;
zone_options |= DNS_ZONEOPT_CHECKNAMESFAIL; zone_options |= DNS_ZONEOPT_CHECKNAMESFAIL;
...@@ -394,14 +406,16 @@ configure_zone(const char *vclass, const char *view, ...@@ -394,14 +406,16 @@ configure_zone(const char *vclass, const char *view,
fmtobj = NULL; fmtobj = NULL;
if (get_maps(maps, "masterfile-format", &fmtobj)) { if (get_maps(maps, "masterfile-format", &fmtobj)) {
const char *masterformatstr = cfg_obj_asstring(fmtobj); const char *masterformatstr = cfg_obj_asstring(fmtobj);
if (strcasecmp(masterformatstr, "text") == 0) if (strcasecmp(masterformatstr, "text") == 0) {
masterformat = dns_masterformat_text; masterformat = dns_masterformat_text;
else if (strcasecmp(masterformatstr, "raw") == 0) } else if (strcasecmp(masterformatstr, "raw") == 0) {
masterformat = dns_masterformat_raw; masterformat = dns_masterformat_raw;
else if (strcasecmp(masterformatstr, "map") == 0) } else if (strcasecmp(masterformatstr, "map") == 0) {
masterformat = dns_masterformat_map; masterformat = dns_masterformat_map;
else } else {
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
}
} }
obj = NULL; obj = NULL;
......
...@@ -139,12 +139,14 @@ main(int argc, char **argv) { ...@@ -139,12 +139,14 @@ main(int argc, char **argv) {
#define PROGCMP(X) \ #define PROGCMP(X) \
(strcasecmp(prog_name, X) == 0 || strcasecmp(prog_name, X ".exe") == 0) (strcasecmp(prog_name, X) == 0 || strcasecmp(prog_name, X ".exe") == 0)
if (PROGCMP("named-checkzone")) if (PROGCMP("named-checkzone")) {
progmode = progmode_check; progmode = progmode_check;
else if (PROGCMP("named-compilezone")) } else if (PROGCMP("named-compilezone")) {
progmode = progmode_compile; progmode = progmode_compile;
else } else {
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
}
/* Compilation specific defaults */ /* Compilation specific defaults */
if (progmode == progmode_compile) { if (progmode == progmode_compile) {
......
...@@ -125,10 +125,12 @@ main(int argc, char **argv) { ...@@ -125,10 +125,12 @@ main(int argc, char **argv) {
if (PROGCMP("tsig-keygen")) { if (PROGCMP("tsig-keygen")) {
progmode = progmode_keygen; progmode = progmode_keygen;
quiet = true; quiet = true;
} else if (PROGCMP("ddns-confgen")) } else if (PROGCMP("ddns-confgen")) {
progmode = progmode_confgen; progmode = progmode_confgen;
else } else {
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
}
isc_commandline_errprint = false; isc_commandline_errprint = false;
......
...@@ -1224,6 +1224,7 @@ dash_option(char *option, char *next, bool *open_type_class) { ...@@ -1224,6 +1224,7 @@ dash_option(char *option, char *next, bool *open_type_class) {
/* NOTREACHED */ /* NOTREACHED */
default: default:
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
} }
if (strlen(option) > 1U) if (strlen(option) > 1U)
option = &option[1]; option = &option[1];
......
...@@ -2348,6 +2348,7 @@ setup_lookup(dig_lookup_t *lookup) { ...@@ -2348,6 +2348,7 @@ setup_lookup(dig_lookup_t *lookup) {
break; break;
default: default:
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
} }
isc_buffer_init(&b, ecsbuf, sizeof(ecsbuf)); isc_buffer_init(&b, ecsbuf, sizeof(ecsbuf));
......
...@@ -457,6 +457,7 @@ named_config_getzonetype(const cfg_obj_t *zonetypeobj) { ...@@ -457,6 +457,7 @@ named_config_getzonetype(const cfg_obj_t *zonetypeobj) {
ztype = dns_zone_redirect; ztype = dns_zone_redirect;
} else { } else {
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
} }
return (ztype); return (ztype);
} }
...@@ -1029,6 +1030,7 @@ named_config_getkeyalgorithm2(const char *str, const dns_name_t **name, ...@@ -1029,6 +1030,7 @@ named_config_getkeyalgorithm2(const char *str, const dns_name_t **name,
case hmacsha512: *name = dns_tsig_hmacsha512_name; break; case hmacsha512: *name = dns_tsig_hmacsha512_name; break;
default: default:
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
} }
} }
if (typep != NULL) if (typep != NULL)
......
...@@ -157,6 +157,7 @@ channel_fromconf(const cfg_obj_t *channel, isc_logconfig_t *logconfig) { ...@@ -157,6 +157,7 @@ channel_fromconf(const cfg_obj_t *channel, isc_logconfig_t *logconfig) {
break; break;
default: default:
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
} }
type = ISC_LOG_TOFILE; type = ISC_LOG_TOFILE;
......
...@@ -1145,6 +1145,7 @@ get_view_querysource_dispatch(const cfg_obj_t **maps, int af, ...@@ -1145,6 +1145,7 @@ get_view_querysource_dispatch(const cfg_obj_t **maps, int af,
break; break;
default: default:
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
} }
sa = *(cfg_obj_assockaddr(obj)); sa = *(cfg_obj_assockaddr(obj));
...@@ -1166,6 +1167,7 @@ get_view_querysource_dispatch(const cfg_obj_t **maps, int af, ...@@ -1166,6 +1167,7 @@ get_view_querysource_dispatch(const cfg_obj_t **maps, int af,
break; break;
default: default:
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
} }
if (result != ISC_R_SUCCESS) if (result != ISC_R_SUCCESS)
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
...@@ -1273,20 +1275,22 @@ configure_order(dns_order_t *order, const cfg_obj_t *ent) { ...@@ -1273,20 +1275,22 @@ configure_order(dns_order_t *order, const cfg_obj_t *ent) {
obj = cfg_tuple_get(ent, "ordering"); obj = cfg_tuple_get(ent, "ordering");
INSIST(cfg_obj_isstring(obj)); INSIST(cfg_obj_isstring(obj));
str = cfg_obj_asstring(obj); str = cfg_obj_asstring(obj);
if (!strcasecmp(str, "fixed")) if (!strcasecmp(str, "fixed")) {
#if DNS_RDATASET_FIXED #if DNS_RDATASET_FIXED
mode = DNS_RDATASETATTR_FIXEDORDER; mode = DNS_RDATASETATTR_FIXEDORDER;
#else #else
mode = DNS_RDATASETATTR_CYCLIC; mode = DNS_RDATASETATTR_CYCLIC;
#endif /* DNS_RDATASET_FIXED */ #endif /* DNS_RDATASET_FIXED */
else if (!strcasecmp(str, "random")) } else if (!strcasecmp(str, "random")) {
mode = DNS_RDATASETATTR_RANDOMIZE; mode = DNS_RDATASETATTR_RANDOMIZE;
else if (!strcasecmp(str, "cyclic")) } else if (!strcasecmp(str, "cyclic")) {
mode = DNS_RDATASETATTR_CYCLIC; mode = DNS_RDATASETATTR_CYCLIC;
else if (!strcasecmp(str, "none")) } else if (!strcasecmp(str, "none")) {
mode = DNS_RDATASETATTR_NONE; mode = DNS_RDATASETATTR_NONE;
else } else {
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
}
/* /*
* "*" should match everything including the root (BIND 8 compat). * "*" should match everything including the root (BIND 8 compat).
...@@ -1418,14 +1422,16 @@ configure_peer(const cfg_obj_t *cpeer, isc_mem_t *mctx, dns_peer_t **peerp) { ...@@ -1418,14 +1422,16 @@ configure_peer(const cfg_obj_t *cpeer, isc_mem_t *mctx, dns_peer_t **peerp) {
(void)cfg_map_get(cpeer, "transfer-format", &obj); (void)cfg_map_get(cpeer, "transfer-format", &obj);
if (obj != NULL) { if (obj != NULL) {
str = cfg_obj_asstring(obj); str = cfg_obj_asstring(obj);
if (strcasecmp(str, "many-answers") == 0) if (strcasecmp(str, "many-answers") == 0) {
CHECK(dns_peer_settransferformat(peer, CHECK(dns_peer_settransferformat(peer,
dns_many_answers)); dns_many_answers));
else if (strcasecmp(str, "one-answer") == 0) } else if (strcasecmp(str, "one-answer") == 0) {
CHECK(dns_peer_settransferformat(peer, CHECK(dns_peer_settransferformat(peer,
dns_one_answer)); dns_one_answer));
else } else {
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
}
} }
obj = NULL; obj = NULL;
...@@ -3943,8 +3949,10 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, ...@@ -3943,8 +3949,10 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
view->checknames = false; view->checknames = false;
} else if (strcasecmp(str, "ignore") == 0) { } else if (strcasecmp(str, "ignore") == 0) {
view->checknames = false; view->checknames = false;
} else } else {
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
}
obj = NULL; obj = NULL;
result = named_config_get(maps, "zero-no-soa-ttl-cache", &obj); result = named_config_get(maps, "zero-no-soa-ttl-cache", &obj);
...@@ -4358,12 +4366,14 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, ...@@ -4358,12 +4366,14 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
const char *resp = cfg_obj_asstring(obj2); const char *resp = cfg_obj_asstring(obj2);
isc_result_t r = DNS_R_SERVFAIL; isc_result_t r = DNS_R_SERVFAIL;
if (strcasecmp(resp, "drop") == 0) if (strcasecmp(resp, "drop") == 0) {
r = DNS_R_DROP; r = DNS_R_DROP;
else if (strcasecmp(resp, "fail") == 0) } else if (strcasecmp(resp, "fail") == 0) {
r = DNS_R_SERVFAIL; r = DNS_R_SERVFAIL;
else } else {
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
}
dns_resolver_setquotaresponse(view->resolver, dns_resolver_setquotaresponse(view->resolver,
dns_quotatype_server, r); dns_quotatype_server, r);
...@@ -4709,20 +4719,24 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, ...@@ -4709,20 +4719,24 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
view->minimalresponses = dns_minimal_noauth; view->minimalresponses = dns_minimal_noauth;
} else if (strcasecmp(str, "no-auth-recursive") == 0) { } else if (strcasecmp(str, "no-auth-recursive") == 0) {
view->minimalresponses = dns_minimal_noauthrec; view->minimalresponses = dns_minimal_noauthrec;
} else } else {
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
}
} }
obj = NULL; obj = NULL;
result = named_config_get(maps, "transfer-format", &obj); result = named_config_get(maps, "transfer-format", &obj);
INSIST(result == ISC_R_SUCCESS); INSIST(result == ISC_R_SUCCESS);
str = cfg_obj_asstring(obj); str = cfg_obj_asstring(obj);
if (strcasecmp(str, "many-answers") == 0) if (strcasecmp(str, "many-answers") == 0) {
view->transfer_format = dns_many_answers; view->transfer_format = dns_many_answers;
else if (strcasecmp(str, "one-answer") == 0) } else if (strcasecmp(str, "one-answer") == 0) {
view->transfer_format = dns_one_answer; view->transfer_format = dns_one_answer;
else } else {
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
}
obj = NULL; obj = NULL;
result = named_config_get(maps, "trust-anchor-telemetry", &obj); result = named_config_get(maps, "trust-anchor-telemetry", &obj);
...@@ -5038,12 +5052,14 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, ...@@ -5038,12 +5052,14 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
const char *resp = cfg_obj_asstring(obj2); const char *resp = cfg_obj_asstring(obj2);
isc_result_t r = DNS_R_SERVFAIL; isc_result_t r = DNS_R_SERVFAIL;
if (strcasecmp(resp, "drop") == 0) if (strcasecmp(resp, "drop") == 0) {
r = DNS_R_DROP; r = DNS_R_DROP;
else if (strcasecmp(resp, "fail") == 0) } else if (strcasecmp(resp, "fail") == 0) {
r = DNS_R_SERVFAIL; r = DNS_R_SERVFAIL;
else } else {
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
}
dns_resolver_setquotaresponse(view->resolver, dns_resolver_setquotaresponse(view->resolver,
dns_quotatype_zone, r); dns_quotatype_zone, r);
...@@ -5059,10 +5075,12 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, ...@@ -5059,10 +5075,12 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
view->v4_aaaa = dns_aaaa_ok; view->v4_aaaa = dns_aaaa_ok;
} else { } else {
const char *v4_aaaastr = cfg_obj_asstring(obj); const char *v4_aaaastr = cfg_obj_asstring(obj);
if (strcasecmp(v4_aaaastr, "break-dnssec") == 0) if (strcasecmp(v4_aaaastr, "break-dnssec") == 0) {
view->v4_aaaa = dns_aaaa_break_dnssec; view->v4_aaaa = dns_aaaa_break_dnssec;
else } else {
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
}
} }
obj = NULL; obj = NULL;
...@@ -5075,10 +5093,12 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, ...@@ -5075,10 +5093,12 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
view->v6_aaaa = dns_aaaa_ok; view->v6_aaaa = dns_aaaa_ok;
} else { } else {
const char *v6_aaaastr = cfg_obj_asstring(obj); const char *v6_aaaastr = cfg_obj_asstring(obj);
if (strcasecmp(v6_aaaastr, "break-dnssec") == 0) if (strcasecmp(v6_aaaastr, "break-dnssec") == 0) {
view->v6_aaaa = dns_aaaa_break_dnssec; view->v6_aaaa = dns_aaaa_break_dnssec;
else } else {
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
}
} }
CHECK(configure_view_acl(vconfig, config, named_g_config, CHECK(configure_view_acl(vconfig, config, named_g_config,
...@@ -5319,14 +5339,16 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, ...@@ -5319,14 +5339,16 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
statlevel = dns_zonestat_none; statlevel = dns_zonestat_none;
} else { } else {
const char *levelstr = cfg_obj_asstring(obj); const char *levelstr = cfg_obj_asstring(obj);
if (strcasecmp(levelstr, "full") == 0) if (strcasecmp(levelstr, "full") == 0) {
statlevel = dns_zonestat_full; statlevel = dns_zonestat_full;
else if (strcasecmp(levelstr, "terse") == 0) } else if (strcasecmp(levelstr, "terse") == 0) {
statlevel = dns_zonestat_terse; statlevel = dns_zonestat_terse;
else if (strcasecmp(levelstr, "none") == 0) } else if (strcasecmp(levelstr, "none") == 0) {
statlevel = dns_zonestat_none; statlevel = dns_zonestat_none;
else } else {
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
}
} }
for (empty = empty_zones[empty_zone]; for (empty = empty_zones[empty_zone];
...@@ -5686,16 +5708,18 @@ configure_forward(const cfg_obj_t *config, dns_view_t *view, ...@@ -5686,16 +5708,18 @@ configure_forward(const cfg_obj_t *config, dns_view_t *view,
"forwarding"); "forwarding");
fwdpolicy = dns_fwdpolicy_none; fwdpolicy = dns_fwdpolicy_none;
} else { } else {
if (forwardtype == NULL) if (forwardtype == NULL) {
fwdpolicy = dns_fwdpolicy_first; fwdpolicy = dns_fwdpolicy_first;
else { } else {
const char *forwardstr = cfg_obj_asstring(forwardtype); const char *forwardstr = cfg_obj_asstring(forwardtype);
if (strcasecmp(forwardstr, "first") == 0) if (strcasecmp(forwardstr, "first") == 0) {
fwdpolicy = dns_fwdpolicy_first; fwdpolicy = dns_fwdpolicy_first;
else if (strcasecmp(forwardstr, "only") == 0) } else if (strcasecmp(forwardstr, "only") == 0) {
fwdpolicy = dns_fwdpolicy_only; fwdpolicy = dns_fwdpolicy_only;
else } else {
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
}
} }
} }
...@@ -9001,6 +9025,7 @@ load_configuration(const char *filename, named_server_t *server, ...@@ -9001,6 +9025,7 @@ load_configuration(const char *filename, named_server_t *server,
server->sctx->cookiealg = ns_cookiealg_sha256; server->sctx->cookiealg = ns_cookiealg_sha256;
} else { } else {
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
} }
obj = NULL; obj = NULL;
...@@ -12597,12 +12622,14 @@ newzone_parse(named_server_t *server, char *command, dns_view_t **viewp, ...@@ -12597,12 +12622,14 @@ newzone_parse(named_server_t *server, char *command, dns_view_t **viewp,
isc_buffer_init(&argbuf, command, (unsigned int) strlen(command)); isc_buffer_init(&argbuf, command, (unsigned int) strlen(command));
isc_buffer_add(&argbuf, strlen(command)); isc_buffer_add(&argbuf, strlen(command));
if (strncasecmp(command, "add", 3) == 0) if (strncasecmp(command, "add", 3) == 0) {
bn = "addzone"; bn = "addzone";
else if (strncasecmp(command, "mod", 3) == 0) } else if (strncasecmp(command, "mod", 3) == 0) {
bn = "modzone"; bn = "modzone";
else } else {
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
}
/* /*
* Convert the "addzone" or "modzone" to just "zone", for * Convert the "addzone" or "modzone" to just "zone", for
...@@ -14988,6 +15015,7 @@ named_server_mkeys(named_server_t *server, isc_lex_t *lex, ...@@ -14988,6 +15015,7 @@ named_server_mkeys(named_server_t *server, isc_lex_t *lex,
break; break;
default: default:
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
} }
if (viewtxt != NULL) { if (viewtxt != NULL) {
......
...@@ -125,7 +125,7 @@ configure_zone_acl(const cfg_obj_t *zconfig, const cfg_obj_t *vconfig, ...@@ -125,7 +125,7 @@ configure_zone_acl(const cfg_obj_t *zconfig, const cfg_obj_t *vconfig,
break; break;
default: default:
INSIST(0); INSIST(0);
return (ISC_R_FAILURE); ISC_UNREACHABLE();
} }
/* First check to see if ACL is defined within the zone */ /* First check to see if ACL is defined within the zone */
...@@ -231,12 +231,14 @@ configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone, ...@@ -231,12 +231,14 @@ configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone,
unsigned int i, n; unsigned int i, n;
str = cfg_obj_asstring(mode); str = cfg_obj_asstring(mode);
if (strcasecmp(str, "grant") == 0) if (strcasecmp(str, "grant") == 0) {
grant = true; grant = true;
else if (strcasecmp(str, "deny") == 0) } else if (strcasecmp(str, "deny") == 0) {
grant = false; grant = false;
else } else {
INSIST(0); INSIST(0);
ISC_UNREACHABLE();
}
str = cfg_obj_asstring(matchtype); str = cfg_obj_asstring(matchtype);
CHECK(dns_ssu_mtypefromstring(str, &mtype)); CHECK(dns_ssu_mtypefromstring(str, &mtype));
...@@ -764,6 +766,7 @@ checknames(dns_zonetype_t ztype, const cfg_obj_t **maps, ...@@ -764,6 +766,7 @@ checknames(dns_zonetype_t ztype, const cfg_obj_t **maps,
break; break;
default: default:
INSIST(0); INSIST(0);