|
Tomas Hozza |
abe4be |
diff -up bind-9.9.5b1/bin/dig/dighost.c.rh570851 bind-9.9.5b1/bin/dig/dighost.c
|
|
Tomas Hozza |
abe4be |
--- bind-9.9.5b1/bin/dig/dighost.c.rh570851 2014-01-06 13:49:25.230380554 +0100
|
|
Tomas Hozza |
abe4be |
+++ bind-9.9.5b1/bin/dig/dighost.c 2014-01-06 13:54:25.804839409 +0100
|
|
Tomas Hozza |
abe4be |
@@ -131,6 +131,7 @@ isc_boolean_t
|
|
Adam Tkac |
aa9e28 |
showsearch = ISC_FALSE,
|
|
Adam Tkac |
aa9e28 |
qr = ISC_FALSE,
|
|
Tomas Hozza |
abe4be |
is_dst_up = ISC_FALSE,
|
|
Tomas Hozza |
abe4be |
+ verbose = ISC_FALSE,
|
|
Tomas Hozza |
abe4be |
keep_open = ISC_FALSE;
|
|
Adam Tkac |
aa9e28 |
in_port_t port = 53;
|
|
Adam Tkac |
aa9e28 |
unsigned int timeout = 0;
|
|
Tomas Hozza |
abe4be |
@@ -1257,10 +1258,24 @@ setup_system(void) {
|
|
Adam Tkac |
aa9e28 |
}
|
|
Adam Tkac |
aa9e28 |
}
|
|
Adam Tkac |
aa9e28 |
|
|
Adam Tkac |
aa9e28 |
+ if (lwconf->resdebug) {
|
|
Adam Tkac |
aa9e28 |
+ verbose = ISC_TRUE;
|
|
Adam Tkac |
aa9e28 |
+ debug("verbose is on");
|
|
Adam Tkac |
aa9e28 |
+ }
|
|
Adam Tkac |
aa9e28 |
if (ndots == -1) {
|
|
Adam Tkac |
aa9e28 |
ndots = lwconf->ndots;
|
|
Adam Tkac |
aa9e28 |
debug("ndots is %d.", ndots);
|
|
Adam Tkac |
aa9e28 |
}
|
|
Adam Tkac |
aa9e28 |
+ if (lwconf->attempts) {
|
|
Adam Tkac |
aa9e28 |
+ tries = lwconf->attempts + 1;
|
|
Adam Tkac |
aa9e28 |
+ if (tries < 2)
|
|
Adam Tkac |
aa9e28 |
+ tries = 2;
|
|
Adam Tkac |
aa9e28 |
+ debug("tries is %d.", tries);
|
|
Adam Tkac |
aa9e28 |
+ }
|
|
Adam Tkac |
aa9e28 |
+ if (lwconf->timeout) {
|
|
Adam Tkac |
aa9e28 |
+ timeout = lwconf->timeout;
|
|
Adam Tkac |
aa9e28 |
+ debug("timeout is %d.", timeout);
|
|
Adam Tkac |
aa9e28 |
+ }
|
|
Adam Tkac |
aa9e28 |
|
|
Adam Tkac |
aa9e28 |
/* If user doesn't specify server use nameservers from resolv.conf. */
|
|
Adam Tkac |
aa9e28 |
if (ISC_LIST_EMPTY(server_list))
|
|
Tomas Hozza |
abe4be |
diff -up bind-9.9.5b1/bin/dig/host.c.rh570851 bind-9.9.5b1/bin/dig/host.c
|
|
Tomas Hozza |
abe4be |
--- bind-9.9.5b1/bin/dig/host.c.rh570851 2013-12-12 06:59:59.000000000 +0100
|
|
Tomas Hozza |
abe4be |
+++ bind-9.9.5b1/bin/dig/host.c 2014-01-06 13:49:25.241380571 +0100
|
|
Tomas Hozza |
abe4be |
@@ -672,6 +672,7 @@ parse_args(isc_boolean_t is_batchfile, i
|
|
Adam Tkac |
aa9e28 |
|
|
Adam Tkac |
aa9e28 |
lookup->servfail_stops = ISC_FALSE;
|
|
Adam Tkac |
aa9e28 |
lookup->comments = ISC_FALSE;
|
|
Adam Tkac |
aa9e28 |
+ short_form = !verbose;
|
|
Adam Tkac |
aa9e28 |
|
|
Adam Tkac |
aa9e28 |
while ((c = isc_commandline_parse(argc, argv, optstring)) != -1) {
|
|
Adam Tkac |
aa9e28 |
switch (c) {
|
|
Tomas Hozza |
abe4be |
@@ -882,8 +883,8 @@ main(int argc, char **argv) {
|
|
Adam Tkac |
aa9e28 |
result = isc_app_start();
|
|
Adam Tkac |
aa9e28 |
check_result(result, "isc_app_start");
|
|
Adam Tkac |
aa9e28 |
setup_libs();
|
|
Adam Tkac |
aa9e28 |
- parse_args(ISC_FALSE, argc, argv);
|
|
Adam Tkac |
aa9e28 |
setup_system();
|
|
Adam Tkac |
aa9e28 |
+ parse_args(ISC_FALSE, argc, argv);
|
|
Adam Tkac |
aa9e28 |
result = isc_app_onrun(mctx, global_task, onrun_callback, NULL);
|
|
Adam Tkac |
aa9e28 |
check_result(result, "isc_app_onrun");
|
|
Adam Tkac |
aa9e28 |
isc_app_run();
|
|
Tomas Hozza |
abe4be |
diff -up bind-9.9.5b1/bin/dig/include/dig/dig.h.rh570851 bind-9.9.5b1/bin/dig/include/dig/dig.h
|
|
Tomas Hozza |
abe4be |
--- bind-9.9.5b1/bin/dig/include/dig/dig.h.rh570851 2013-12-12 06:59:59.000000000 +0100
|
|
Tomas Hozza |
abe4be |
+++ bind-9.9.5b1/bin/dig/include/dig/dig.h 2014-01-06 13:49:25.241380571 +0100
|
|
Tomas Hozza |
abe4be |
@@ -281,6 +281,7 @@ extern isc_boolean_t keep_open;
|
|
Adam Tkac |
aa9e28 |
extern char *progname;
|
|
Adam Tkac |
aa9e28 |
extern int tries;
|
|
Adam Tkac |
aa9e28 |
extern int fatalexit;
|
|
Adam Tkac |
aa9e28 |
+extern isc_boolean_t verbose;
|
|
Adam Tkac |
aa9e28 |
#ifdef WITH_IDN
|
|
Adam Tkac |
aa9e28 |
extern int idnoptions;
|
|
Adam Tkac |
aa9e28 |
#endif
|
|
Tomas Hozza |
abe4be |
diff -up bind-9.9.5b1/lib/lwres/include/lwres/lwres.h.rh570851 bind-9.9.5b1/lib/lwres/include/lwres/lwres.h
|
|
Tomas Hozza |
abe4be |
--- bind-9.9.5b1/lib/lwres/include/lwres/lwres.h.rh570851 2013-12-12 06:59:59.000000000 +0100
|
|
Tomas Hozza |
abe4be |
+++ bind-9.9.5b1/lib/lwres/include/lwres/lwres.h 2014-01-06 13:49:25.241380571 +0100
|
|
Adam Tkac |
aa9e28 |
@@ -243,6 +243,8 @@ typedef struct {
|
|
Adam Tkac |
aa9e28 |
lwres_uint8_t resdebug; /*%< non-zero if 'options debug' set */
|
|
Adam Tkac |
aa9e28 |
lwres_uint8_t ndots; /*%< set to n in 'options ndots:n' */
|
|
Adam Tkac |
aa9e28 |
lwres_uint8_t no_tld_query; /*%< non-zero if 'options no_tld_query' */
|
|
Adam Tkac |
aa9e28 |
+ lwres_int32_t attempts; /*%< set to n in 'options attempts:n' */
|
|
Adam Tkac |
aa9e28 |
+ lwres_int32_t timeout; /*%< set to n in 'options timeout:n' */
|
|
Adam Tkac |
aa9e28 |
} lwres_conf_t;
|
|
Adam Tkac |
aa9e28 |
|
|
Adam Tkac |
aa9e28 |
#define LWRES_ADDRTYPE_V4 0x00000001U /*%< ipv4 */
|
|
Tomas Hozza |
abe4be |
diff -up bind-9.9.5b1/lib/lwres/lwconfig.c.rh570851 bind-9.9.5b1/lib/lwres/lwconfig.c
|
|
Tomas Hozza |
abe4be |
--- bind-9.9.5b1/lib/lwres/lwconfig.c.rh570851 2013-12-12 06:59:59.000000000 +0100
|
|
Tomas Hozza |
abe4be |
+++ bind-9.9.5b1/lib/lwres/lwconfig.c 2014-01-06 13:49:25.241380571 +0100
|
|
Adam Tkac |
aa9e28 |
@@ -237,6 +237,8 @@ lwres_conf_init(lwres_context_t *ctx) {
|
|
Adam Tkac |
aa9e28 |
confdata->resdebug = 0;
|
|
Adam Tkac |
aa9e28 |
confdata->ndots = 1;
|
|
Adam Tkac |
aa9e28 |
confdata->no_tld_query = 0;
|
|
Adam Tkac |
aa9e28 |
+ confdata->attempts = 0;
|
|
Adam Tkac |
aa9e28 |
+ confdata->timeout = 0;
|
|
Adam Tkac |
aa9e28 |
|
|
Adam Tkac |
aa9e28 |
for (i = 0; i < LWRES_CONFMAXNAMESERVERS; i++)
|
|
Adam Tkac |
aa9e28 |
lwres_resetaddr(&confdata->nameservers[i]);
|
|
Adam Tkac |
aa9e28 |
@@ -289,6 +291,8 @@ lwres_conf_clear(lwres_context_t *ctx) {
|
|
Adam Tkac |
aa9e28 |
confdata->resdebug = 0;
|
|
Adam Tkac |
aa9e28 |
confdata->ndots = 1;
|
|
Adam Tkac |
aa9e28 |
confdata->no_tld_query = 0;
|
|
Adam Tkac |
aa9e28 |
+ confdata->attempts = 0;
|
|
Adam Tkac |
aa9e28 |
+ confdata->timeout = 0;
|
|
Adam Tkac |
aa9e28 |
}
|
|
Adam Tkac |
aa9e28 |
|
|
Adam Tkac |
aa9e28 |
static lwres_result_t
|
|
Adam Tkac |
aa9e28 |
@@ -530,6 +534,8 @@ static lwres_result_t
|
|
Adam Tkac |
aa9e28 |
lwres_conf_parseoption(lwres_context_t *ctx, FILE *fp) {
|
|
Adam Tkac |
aa9e28 |
int delim;
|
|
Adam Tkac |
aa9e28 |
long ndots;
|
|
Adam Tkac |
aa9e28 |
+ long attempts;
|
|
Adam Tkac |
aa9e28 |
+ long timeout;
|
|
Adam Tkac |
aa9e28 |
char *p;
|
|
Adam Tkac |
aa9e28 |
char word[LWRES_CONFMAXLINELEN];
|
|
Adam Tkac |
aa9e28 |
lwres_conf_t *confdata;
|
|
Adam Tkac |
aa9e28 |
@@ -546,6 +552,8 @@ lwres_conf_parseoption(lwres_context_t *
|
|
Adam Tkac |
aa9e28 |
confdata->resdebug = 1;
|
|
Adam Tkac |
aa9e28 |
} else if (strcmp("no_tld_query", word) == 0) {
|
|
Adam Tkac |
aa9e28 |
confdata->no_tld_query = 1;
|
|
Adam Tkac |
aa9e28 |
+ } else if (strcmp("debug", word) == 0) {
|
|
Adam Tkac |
aa9e28 |
+ confdata->resdebug = 1;
|
|
Adam Tkac |
aa9e28 |
} else if (strncmp("ndots:", word, 6) == 0) {
|
|
Adam Tkac |
aa9e28 |
ndots = strtol(word + 6, &p, 10);
|
|
Adam Tkac |
aa9e28 |
if (*p != '\0') /* Bad string. */
|
|
Adam Tkac |
aa9e28 |
@@ -553,6 +561,18 @@ lwres_conf_parseoption(lwres_context_t *
|
|
Adam Tkac |
aa9e28 |
if (ndots < 0 || ndots > 0xff) /* Out of range. */
|
|
Adam Tkac |
aa9e28 |
return (LWRES_R_FAILURE);
|
|
Adam Tkac |
aa9e28 |
confdata->ndots = (lwres_uint8_t)ndots;
|
|
Adam Tkac |
aa9e28 |
+ } else if (strncmp("timeout:", word, 8) == 0) {
|
|
Adam Tkac |
aa9e28 |
+ timeout = strtol(word + 8, &p, 10);
|
|
Adam Tkac |
aa9e28 |
+ if (*p != '\0') /* Bad string. */
|
|
Adam Tkac |
aa9e28 |
+ return (LWRES_R_FAILURE);
|
|
Adam Tkac |
aa9e28 |
+ confdata->timeout = (lwres_int32_t)timeout;
|
|
Adam Tkac |
aa9e28 |
+ } else if (strncmp("attempts:", word, 9) == 0) {
|
|
Adam Tkac |
aa9e28 |
+ attempts = strtol(word + 9, &p, 10);
|
|
Adam Tkac |
aa9e28 |
+ if (*p != '\0') /* Bad string. */
|
|
Adam Tkac |
aa9e28 |
+ return (LWRES_R_FAILURE);
|
|
Adam Tkac |
aa9e28 |
+ if (attempts < 0) /* Out of range. */
|
|
Adam Tkac |
aa9e28 |
+ return (LWRES_R_FAILURE);
|
|
Adam Tkac |
aa9e28 |
+ confdata->attempts = (lwres_int32_t)attempts;
|
|
Adam Tkac |
aa9e28 |
}
|
|
Adam Tkac |
aa9e28 |
|
|
Adam Tkac |
aa9e28 |
if (delim == EOF || delim == '\n')
|
|
Tomas Hozza |
abe4be |
@@ -717,6 +737,12 @@ lwres_conf_print(lwres_context_t *ctx, F
|
|
Adam Tkac |
aa9e28 |
if (confdata->no_tld_query)
|
|
Adam Tkac |
aa9e28 |
fprintf(fp, "options no_tld_query\n");
|
|
Adam Tkac |
aa9e28 |
|
|
Adam Tkac |
aa9e28 |
+ if (confdata->attempts)
|
|
Adam Tkac |
aa9e28 |
+ fprintf(fp, "options attempts:%d\n", confdata->attempts);
|
|
Adam Tkac |
aa9e28 |
+
|
|
Adam Tkac |
aa9e28 |
+ if (confdata->timeout)
|
|
Adam Tkac |
aa9e28 |
+ fprintf(fp, "options timeout:%d\n", confdata->timeout);
|
|
Adam Tkac |
aa9e28 |
+
|
|
Adam Tkac |
aa9e28 |
return (LWRES_R_SUCCESS);
|
|
Adam Tkac |
aa9e28 |
}
|
|
Adam Tkac |
aa9e28 |
|