Bugzilla – Bug 1407
Add ECS options check to unbound-checkconf
Last modified: 2017-08-22 09:43:44 CEST
Add to smallapp/unbound-checkconf.c include "edns-subnet/subnet-whitelist.h" /** check ECS configuration */ static void ecs_conf_checks(struct config_file* cfg) { struct ednssubnet_upstream* upstream = NULL; if(!(upstream = upstream_create())) fatal_exit("Could not create ednssubnet upstream: out of memory"); if(!upstream_apply_cfg(upstream, cfg)) fatal_exit("Could not setup ednssubnet upstream"); upstream_delete(upstream); } /** check configuration for errors */ static void morechecks(struct config_file* cfg, const char* fname) { ... localzonechecks(cfg); view_and_respipchecks(cfg); ecs_conf_checks(cfg); // <------ new added function }
Hi Uladzimir, Thanks for the code, I have adjust it like below and committed it! Best regards, Wouter #ifdef CLIENT_SUBNET /** check ECS configuration */ static void ecs_conf_checks(struct config_file* cfg) { struct ecs_whitelist* whitelist = NULL; if(!(whitelist = ecs_whitelist_create())) fatal_exit("Could not create ednssubnet whitelist: out of memory"); if(!ecs_whitelist_apply_cfg(whitelist, cfg)) fatal_exit("Could not setup ednssubnet whitelist"); ecs_whitelist_delete(whitelist); } #endif /* CLIENT_SUBNET */