Adam Tkac aa9e28
diff -up bind-9.7.2b1/bin/dig/dighost.c.rh570851 bind-9.7.2b1/bin/dig/dighost.c
Adam Tkac aa9e28
--- bind-9.7.2b1/bin/dig/dighost.c.rh570851	2010-08-10 12:55:14.219403986 +0200
Adam Tkac aa9e28
+++ bind-9.7.2b1/bin/dig/dighost.c	2010-08-10 12:56:40.716015777 +0200
Adam Tkac aa9e28
@@ -126,7 +126,8 @@ isc_boolean_t
Adam Tkac aa9e28
 	usesearch = ISC_FALSE,
Adam Tkac aa9e28
 	showsearch = ISC_FALSE,
Adam Tkac aa9e28
 	qr = ISC_FALSE,
Adam Tkac aa9e28
-	is_dst_up = ISC_FALSE;
Adam Tkac aa9e28
+	is_dst_up = ISC_FALSE,
Adam Tkac aa9e28
+	verbose = ISC_FALSE;
Adam Tkac aa9e28
 in_port_t port = 53;
Adam Tkac aa9e28
 unsigned int timeout = 0;
Adam Tkac aa9e28
 unsigned int extrabytes;
Adam Tkac aa9e28
@@ -1240,10 +1241,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))
Adam Tkac aa9e28
diff -up bind-9.7.2b1/bin/dig/host.c.rh570851 bind-9.7.2b1/bin/dig/host.c
Adam Tkac aa9e28
--- bind-9.7.2b1/bin/dig/host.c.rh570851	2010-08-10 12:57:16.032758098 +0200
Adam Tkac aa9e28
+++ bind-9.7.2b1/bin/dig/host.c	2010-08-10 13:02:12.848559845 +0200
Adam Tkac aa9e28
@@ -659,6 +659,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) {
Adam Tkac aa9e28
@@ -869,8 +870,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();
Adam Tkac aa9e28
diff -up bind-9.7.2b1/bin/dig/include/dig/dig.h.rh570851 bind-9.7.2b1/bin/dig/include/dig/dig.h
Adam Tkac aa9e28
--- bind-9.7.2b1/bin/dig/include/dig/dig.h.rh570851	2010-08-10 13:02:32.722244088 +0200
Adam Tkac aa9e28
+++ bind-9.7.2b1/bin/dig/include/dig/dig.h	2010-08-10 13:02:48.465158159 +0200
Adam Tkac aa9e28
@@ -278,6 +278,7 @@ extern isc_boolean_t debugging, memdebug
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
Adam Tkac aa9e28
diff -up bind-9.7.2b1/lib/lwres/include/lwres/lwres.h.rh570851 bind-9.7.2b1/lib/lwres/include/lwres/lwres.h
Adam Tkac aa9e28
--- bind-9.7.2b1/lib/lwres/include/lwres/lwres.h.rh570851	2010-08-10 13:04:40.465780506 +0200
Adam Tkac aa9e28
+++ bind-9.7.2b1/lib/lwres/include/lwres/lwres.h	2010-08-10 13:05:57.559867830 +0200
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 */
Adam Tkac aa9e28
diff -up bind-9.7.2b1/lib/lwres/lwconfig.c.rh570851 bind-9.7.2b1/lib/lwres/lwconfig.c
Adam Tkac aa9e28
--- bind-9.7.2b1/lib/lwres/lwconfig.c.rh570851	2010-08-10 13:06:08.051778429 +0200
Adam Tkac aa9e28
+++ bind-9.7.2b1/lib/lwres/lwconfig.c	2010-08-10 13:09:53.972555776 +0200
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')
Adam Tkac aa9e28
@@ -716,6 +736,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