From: Wouter Wijngaards Date: Fri, 28 Sep 2007 14:33:35 +0000 (+0000) Subject: unbound-checkconf test. X-Git-Tag: release-0.6~95 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1115d50dcefa5b12a66bca469b9dcfae2d0af9ba;p=thirdparty%2Funbound.git unbound-checkconf test. git-svn-id: file:///svn/unbound/trunk@649 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/checkconf/unbound-checkconf.c b/checkconf/unbound-checkconf.c index 02480ca7f..ded21e4b0 100644 --- a/checkconf/unbound-checkconf.c +++ b/checkconf/unbound-checkconf.c @@ -46,6 +46,7 @@ #include "util/log.h" #include "util/config_file.h" #include "util/module.h" +#include "util/net_help.h" #include "util/region-allocator.h" #include "iterator/iterator.h" #include "validator/validator.h" @@ -85,6 +86,16 @@ check_mod(struct config_file* cfg, struct module_func_block* fb) static void morechecks(struct config_file* cfg) { + int i; + for(i=0; inum_ifs; i++) { + struct sockaddr_storage a; + socklen_t alen; + if(!ipstrtoaddr(cfg->ifs[i], UNBOUND_DNS_PORT, &a, &alen)) { + fatal_exit("cannot parse interface specified as '%s'", + cfg->ifs[i]); + } + } + if(cfg->verbosity < 0) fatal_exit("verbosity value < 0"); if(cfg->num_threads < 0 || cfg->num_threads > 10000) diff --git a/doc/Changelog b/doc/Changelog index 06185afd0..7f5b2dd09 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,7 @@ +28 September 2007: Wouter + - test case for unbound-checkconf, fixed so it also checks the + interface: statements. + 26 September 2007: Wouter - SIGHUP will reopen the log file. - Option to log to syslog. diff --git a/iterator/iter_donotq.c b/iterator/iter_donotq.c index bfd39ef48..185e2b403 100644 --- a/iterator/iter_donotq.c +++ b/iterator/iter_donotq.c @@ -95,7 +95,7 @@ donotq_insert(struct iter_donotq* dq, struct sockaddr_storage* addr, memcpy(&node->addr, addr, addrlen); node->addrlen = addrlen; if(!rbtree_insert(dq->tree, &node->node)) { - log_warn("duplicate donotquery address ignored."); + verbose(VERB_DETAIL, "duplicate donotquery address ignored."); } return 1; } diff --git a/testdata/04-checkconf.tpkg b/testdata/04-checkconf.tpkg new file mode 100644 index 000000000..66d5589a5 Binary files /dev/null and b/testdata/04-checkconf.tpkg differ diff --git a/util/configlexer.lex b/util/configlexer.lex index 5e537fd99..97f6624b7 100644 --- a/util/configlexer.lex +++ b/util/configlexer.lex @@ -143,7 +143,7 @@ hide-identity{COLON} { YDOUT; return VAR_HIDE_IDENTITY;} hide-version{COLON} { YDOUT; return VAR_HIDE_VERSION;} identity{COLON} { YDOUT; return VAR_IDENTITY;} version{COLON} { YDOUT; return VAR_VERSION;} -module-conf{COLON} { YDOUT; return VAR_MODULE_CONF;} +module-config{COLON} { YDOUT; return VAR_MODULE_CONF;} trust-anchor-file{COLON} { YDOUT; return VAR_TRUST_ANCHOR_FILE;} trusted-keys-file{COLON} { YDOUT; return VAR_TRUSTED_KEYS_FILE;} trust-anchor{COLON} { YDOUT; return VAR_TRUST_ANCHOR;}