isc_result_t result = ISC_R_SUCCESS;
isc_result_t tresult = ISC_R_SUCCESS;
cfg_aclconfctx_t actx;
+ const cfg_obj_t *options = NULL;
const cfg_obj_t *obj;
isc_boolean_t enablednssec, enablevalidation;
+ /*
+ * Get global options block.
+ */
+ (void)cfg_map_get(config, "options", &options);
+
/*
* Check that all zone statements are syntactically correct and
* there are no duplicate zones.
* Check that forwarding is reasonable.
*/
if (voptions == NULL) {
- const cfg_obj_t *options = NULL;
- (void)cfg_map_get(config, "options", &options);
- if (options != NULL) {
+ if (options != NULL)
if (check_forward(options, NULL,
logctx) != ISC_R_SUCCESS)
result = ISC_R_FAILURE;
- if (check_nonzero(options, logctx) != ISC_R_SUCCESS)
- result = ISC_R_FAILURE;
- }
} else {
if (check_forward(voptions, NULL, logctx) != ISC_R_SUCCESS)
result = ISC_R_FAILURE;
- if (check_nonzero(voptions, logctx) != ISC_R_SUCCESS)
- result = ISC_R_FAILURE;
}
+ /*
+ * Check non-zero options at the global and view levels.
+ */
+ if (options != NULL && check_nonzero(options, logctx) != ISC_R_SUCCESS)
+ result = ISC_R_FAILURE;
+ if (voptions != NULL &&check_nonzero(voptions, logctx) != ISC_R_SUCCESS)
+ result = ISC_R_FAILURE;
+
/*
* Check that dual-stack-servers is reasonable.
*/
if (voptions == NULL) {
- const cfg_obj_t *options = NULL;
- (void)cfg_map_get(config, "options", &options);
if (options != NULL)
if (check_dual_stack(options, logctx) != ISC_R_SUCCESS)
result = ISC_R_FAILURE;