]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
unbound-checkconf test.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 28 Sep 2007 14:33:35 +0000 (14:33 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 28 Sep 2007 14:33:35 +0000 (14:33 +0000)
git-svn-id: file:///svn/unbound/trunk@649 be551aaa-1e26-0410-a405-d3ace91eadb9

checkconf/unbound-checkconf.c
doc/Changelog
iterator/iter_donotq.c
testdata/04-checkconf.tpkg [new file with mode: 0644]
util/configlexer.lex

index 02480ca7f1de2f450e8967b9da3340198d89f68b..ded21e4b08a00f66d125da344c2efb8ffe2e2d9c 100644 (file)
@@ -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; 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)
                fatal_exit("verbosity value < 0");
        if(cfg->num_threads < 0 || cfg->num_threads > 10000)
index 06185afd053c163dd52de55acf1b3a8a87e4c27f..7f5b2dd09c1170d7b5b6a7d38675c568ccf4f01f 100644 (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
        - SIGHUP will reopen the log file.
        - Option to log to syslog.
index bfd39ef483bd6a1faf263dfd02aeb3fb26028e12..185e2b4030046884543dee0649b0d1bbc8926f4a 100644 (file)
@@ -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 (file)
index 0000000..66d5589
Binary files /dev/null and b/testdata/04-checkconf.tpkg differ
index 5e537fd996fa951e69bd7bfc48da4e4795243183..97f6624b75f846049b540ca11437492cd9c6a981 100644 (file)
@@ -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;}