chiark / gitweb /
adnshost: Offer ability to set adns checkc flags
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 9 Dec 2016 20:06:46 +0000 (20:06 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 11 Jun 2020 15:13:02 +0000 (16:13 +0100)
This is mostly for debugging, fuzzing, etc.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
client/adh-opts.c
client/adh-query.c
client/adnshost.h

index 7dbedcd04e16bc403d8ae694b009b99b499ff167..590fce4fe988f555e5b0acb999c3b3ac5bbd6251 100644 (file)
@@ -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;
 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 };
 
 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 },
     "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",
                         
   { ot_desconly, "other global options:" },
   { ot_funcarg,          "Configuration to use instead of /etc/resolv.conf",
index 56e7b9e9f007fed407dab376fc62f33e661c7c6e..f24c573be0f1e0dab6e25b4bb5b43276abf976d1 100644 (file)
@@ -40,7 +40,7 @@ void ensure_adns_init(void) {
 
   if (signal(SIGPIPE,SIG_IGN) == SIG_ERR) sysfail("ignore SIGPIPE",errno);
 
 
   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) {
   if (!ov_env) initflags |= adns_if_noenv;
 
   if (config_text) {
index a6332175afa0a4a655864e1dcfae0bd45cc0fc3f..fd2d80d8f302d3983f7f7a3cc93eed7f1088180c 100644 (file)
@@ -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 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;
 
 extern char *ov_id;
 extern struct perqueryflags_remember ov_pqfr;