unbound-checkconf test.

git-svn-id: file:///svn/unbound/trunk@649 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2007-09-28 14:33:35 +00:00
parent dc34bb36b3
commit 1115d50dce
5 changed files with 17 additions and 2 deletions

View file

@ -46,6 +46,7 @@
#include "util/log.h" #include "util/log.h"
#include "util/config_file.h" #include "util/config_file.h"
#include "util/module.h" #include "util/module.h"
#include "util/net_help.h"
#include "util/region-allocator.h" #include "util/region-allocator.h"
#include "iterator/iterator.h" #include "iterator/iterator.h"
#include "validator/validator.h" #include "validator/validator.h"
@ -85,6 +86,16 @@ check_mod(struct config_file* cfg, struct module_func_block* fb)
static void static void
morechecks(struct config_file* cfg) morechecks(struct config_file* cfg)
{ {
int i;
for(i=0; i<cfg->num_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) if(cfg->verbosity < 0)
fatal_exit("verbosity value < 0"); fatal_exit("verbosity value < 0");
if(cfg->num_threads < 0 || cfg->num_threads > 10000) if(cfg->num_threads < 0 || cfg->num_threads > 10000)

View file

@ -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 26 September 2007: Wouter
- SIGHUP will reopen the log file. - SIGHUP will reopen the log file.
- Option to log to syslog. - Option to log to syslog.

View file

@ -95,7 +95,7 @@ donotq_insert(struct iter_donotq* dq, struct sockaddr_storage* addr,
memcpy(&node->addr, addr, addrlen); memcpy(&node->addr, addr, addrlen);
node->addrlen = addrlen; node->addrlen = addrlen;
if(!rbtree_insert(dq->tree, &node->node)) { if(!rbtree_insert(dq->tree, &node->node)) {
log_warn("duplicate donotquery address ignored."); verbose(VERB_DETAIL, "duplicate donotquery address ignored.");
} }
return 1; return 1;
} }

BIN
testdata/04-checkconf.tpkg vendored Normal file

Binary file not shown.

View file

@ -143,7 +143,7 @@ hide-identity{COLON} { YDOUT; return VAR_HIDE_IDENTITY;}
hide-version{COLON} { YDOUT; return VAR_HIDE_VERSION;} hide-version{COLON} { YDOUT; return VAR_HIDE_VERSION;}
identity{COLON} { YDOUT; return VAR_IDENTITY;} identity{COLON} { YDOUT; return VAR_IDENTITY;}
version{COLON} { YDOUT; return VAR_VERSION;} 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;} trust-anchor-file{COLON} { YDOUT; return VAR_TRUST_ANCHOR_FILE;}
trusted-keys-file{COLON} { YDOUT; return VAR_TRUSTED_KEYS_FILE;} trusted-keys-file{COLON} { YDOUT; return VAR_TRUSTED_KEYS_FILE;}
trust-anchor{COLON} { YDOUT; return VAR_TRUST_ANCHOR;} trust-anchor{COLON} { YDOUT; return VAR_TRUST_ANCHOR;}