From: Ian Jackson Date: Fri, 9 Dec 2016 20:06:46 +0000 (+0000) Subject: adnshost: Offer ability to set adns checkc flags X-Git-Tag: adns-1.6.0~16 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=adns.git;a=commitdiff_plain;h=a93410072c36d1085aabada3b316de4329a56219 adnshost: Offer ability to set adns checkc flags This is mostly for debugging, fuzzing, etc. Signed-off-by: Ian Jackson --- diff --git a/client/adh-opts.c b/client/adh-opts.c index 7dbedcd..590fce4 100644 --- a/client/adh-opts.c +++ b/client/adh-opts.c @@ -32,6 +32,7 @@ int ov_verbose= 0; adns_rrtype ov_type= adns_r_none; int ov_search=0, ov_qc_query=0, ov_qc_anshost=0, ov_qc_cname=1; int ov_tcp=0, ov_cname=0, ov_afflags=0, ov_v6map=0, ov_format=fmt_default; +int ov_checkc=0; char *ov_id= 0; struct perqueryflags_remember ov_pqfr = { 1,1,1, tm_none }; @@ -59,6 +60,13 @@ static const struct optioninfo global_options[]= { "Vn", "no-quiet", &ov_verbose, 0 }, { ot_value, "Debugging mode", "Vd", "debug", &ov_verbose, adns_if_debug }, + + { ot_value, "Do not do for-developer consistency checks", + 0, "no-checkc", &ov_checkc, 0 }, + { ot_value, "Do for-developer consistency checks", + 0, "checkc", &ov_checkc, adns_if_checkc_freq }, + { ot_value, "Do for-developer consistency checks very often", + 0, "checkc-freq", &ov_checkc, adns_if_checkc_freq }, { ot_desconly, "other global options:" }, { ot_funcarg, "Configuration to use instead of /etc/resolv.conf", diff --git a/client/adh-query.c b/client/adh-query.c index 56e7b9e..f24c573 100644 --- a/client/adh-query.c +++ b/client/adh-query.c @@ -40,7 +40,7 @@ void ensure_adns_init(void) { if (signal(SIGPIPE,SIG_IGN) == SIG_ERR) sysfail("ignore SIGPIPE",errno); - initflags= adns_if_noautosys|adns_if_nosigpipe|ov_verbose; + initflags= adns_if_noautosys|adns_if_nosigpipe|ov_verbose|ov_checkc; if (!ov_env) initflags |= adns_if_noenv; if (config_text) { diff --git a/client/adnshost.h b/client/adnshost.h index a633217..fd2d80d 100644 --- a/client/adnshost.h +++ b/client/adnshost.h @@ -82,6 +82,7 @@ extern int ov_verbose; extern adns_rrtype ov_type; extern int ov_search, ov_qc_query, ov_qc_anshost, ov_qc_cname; extern int ov_tcp, ov_cname, ov_afflags, ov_v6map, ov_format; +extern int ov_checkc; extern char *ov_id; extern struct perqueryflags_remember ov_pqfr;