|
Adam Tkac |
9dbbf5 |
diff -up bind-9.7.3/bin/dig/dig.c.rh674334 bind-9.7.3/bin/dig/dig.c
|
|
Adam Tkac |
9dbbf5 |
--- bind-9.7.3/bin/dig/dig.c.rh674334 2010-05-13 02:42:26.000000000 +0200
|
|
Adam Tkac |
9dbbf5 |
+++ bind-9.7.3/bin/dig/dig.c 2011-02-18 13:37:45.830518968 +0100
|
|
Adam Tkac |
9dbbf5 |
@@ -44,8 +44,6 @@
|
|
Adam Tkac |
9dbbf5 |
#include <dns/result.h>
|
|
Adam Tkac |
9dbbf5 |
#include <dns/tsig.h>
|
|
Adam Tkac |
9dbbf5 |
|
|
Adam Tkac |
9dbbf5 |
-#include <bind9/getaddresses.h>
|
|
Adam Tkac |
9dbbf5 |
-
|
|
Adam Tkac |
9dbbf5 |
#include <dig/dig.h>
|
|
Adam Tkac |
9dbbf5 |
|
|
Adam Tkac |
9dbbf5 |
#define ADD_STRING(b, s) { \
|
|
Adam Tkac |
9dbbf5 |
@@ -1429,30 +1427,6 @@ preparse_args(int argc, char **argv) {
|
|
Adam Tkac |
9dbbf5 |
}
|
|
Adam Tkac |
9dbbf5 |
|
|
Adam Tkac |
9dbbf5 |
static void
|
|
Adam Tkac |
9dbbf5 |
-getaddresses(dig_lookup_t *lookup, const char *host) {
|
|
Adam Tkac |
9dbbf5 |
- isc_result_t result;
|
|
Adam Tkac |
9dbbf5 |
- isc_sockaddr_t sockaddrs[DIG_MAX_ADDRESSES];
|
|
Adam Tkac |
9dbbf5 |
- isc_netaddr_t netaddr;
|
|
Adam Tkac |
9dbbf5 |
- int count, i;
|
|
Adam Tkac |
9dbbf5 |
- dig_server_t *srv;
|
|
Adam Tkac |
9dbbf5 |
- char tmp[ISC_NETADDR_FORMATSIZE];
|
|
Adam Tkac |
9dbbf5 |
-
|
|
Adam Tkac |
9dbbf5 |
- result = bind9_getaddresses(host, 0, sockaddrs,
|
|
Adam Tkac |
9dbbf5 |
- DIG_MAX_ADDRESSES, &count);
|
|
Adam Tkac |
9dbbf5 |
- if (result != ISC_R_SUCCESS)
|
|
Adam Tkac |
9dbbf5 |
- fatal("couldn't get address for '%s': %s",
|
|
Adam Tkac |
9dbbf5 |
- host, isc_result_totext(result));
|
|
Adam Tkac |
9dbbf5 |
-
|
|
Adam Tkac |
9dbbf5 |
- for (i = 0; i < count; i++) {
|
|
Adam Tkac |
9dbbf5 |
- isc_netaddr_fromsockaddr(&netaddr, &sockaddrs[i]);
|
|
Adam Tkac |
9dbbf5 |
- isc_netaddr_format(&netaddr, tmp, sizeof(tmp));
|
|
Adam Tkac |
9dbbf5 |
- srv = make_server(tmp, host);
|
|
Adam Tkac |
9dbbf5 |
- ISC_LIST_APPEND(lookup->my_server_list, srv, link);
|
|
Adam Tkac |
9dbbf5 |
- }
|
|
Adam Tkac |
9dbbf5 |
- addresscount = count;
|
|
Adam Tkac |
9dbbf5 |
-}
|
|
Adam Tkac |
9dbbf5 |
-
|
|
Adam Tkac |
9dbbf5 |
-static void
|
|
Adam Tkac |
9dbbf5 |
parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
|
|
Adam Tkac |
9dbbf5 |
int argc, char **argv) {
|
|
Adam Tkac |
9dbbf5 |
isc_result_t result;
|
|
Adam Tkac |
9dbbf5 |
@@ -1546,7 +1520,7 @@ parse_args(isc_boolean_t is_batchfile, i
|
|
Adam Tkac |
9dbbf5 |
if (strncmp(rv[0], "%", 1) == 0)
|
|
Adam Tkac |
9dbbf5 |
break;
|
|
Adam Tkac |
9dbbf5 |
if (strncmp(rv[0], "@", 1) == 0) {
|
|
Adam Tkac |
9dbbf5 |
- getaddresses(lookup, &rv[0][1]);
|
|
Adam Tkac |
9dbbf5 |
+ addresscount = getaddresses(lookup, &rv[0][1]);
|
|
Adam Tkac |
9dbbf5 |
} else if (rv[0][0] == '+') {
|
|
Adam Tkac |
9dbbf5 |
plus_option(&rv[0][1], is_batchfile,
|
|
Adam Tkac |
9dbbf5 |
lookup);
|
|
Adam Tkac |
9dbbf5 |
diff -up bind-9.7.3/bin/dig/dighost.c.rh674334 bind-9.7.3/bin/dig/dighost.c
|
|
Adam Tkac |
9dbbf5 |
--- bind-9.7.3/bin/dig/dighost.c.rh674334 2011-02-18 13:37:45.820518990 +0100
|
|
Adam Tkac |
9dbbf5 |
+++ bind-9.7.3/bin/dig/dighost.c 2011-02-18 13:37:45.830518968 +0100
|
|
Adam Tkac |
9dbbf5 |
@@ -1808,8 +1808,7 @@ followup_lookup(dns_message_t *msg, dig_
|
|
Adam Tkac |
9dbbf5 |
dns_rdata_freestruct(&ns);
|
|
Adam Tkac |
9dbbf5 |
|
|
Adam Tkac |
9dbbf5 |
/* Initialize lookup if we've not yet */
|
|
Adam Tkac |
9dbbf5 |
- debug("found NS %d %s", numLookups, namestr);
|
|
Adam Tkac |
9dbbf5 |
- numLookups++;
|
|
Adam Tkac |
9dbbf5 |
+ debug("found NS %s", namestr);
|
|
Adam Tkac |
9dbbf5 |
if (!success) {
|
|
Adam Tkac |
9dbbf5 |
success = ISC_TRUE;
|
|
Adam Tkac |
9dbbf5 |
lookup_counter++;
|
|
Adam Tkac |
9dbbf5 |
@@ -1831,9 +1830,8 @@ followup_lookup(dns_message_t *msg, dig_
|
|
Adam Tkac |
9dbbf5 |
domain = dns_fixedname_name(&lookup->fdomain);
|
|
Adam Tkac |
9dbbf5 |
dns_name_copy(name, domain, NULL);
|
|
Adam Tkac |
9dbbf5 |
}
|
|
Adam Tkac |
9dbbf5 |
- srv = make_server(namestr, namestr);
|
|
Adam Tkac |
9dbbf5 |
- debug("adding server %s", srv->servername);
|
|
Adam Tkac |
9dbbf5 |
- ISC_LIST_APPEND(lookup->my_server_list, srv, link);
|
|
Adam Tkac |
9dbbf5 |
+ debug("adding server %s", namestr);
|
|
Adam Tkac |
9dbbf5 |
+ numLookups += getaddresses(lookup, namestr);
|
|
Adam Tkac |
9dbbf5 |
dns_rdata_reset(&rdata);
|
|
Adam Tkac |
9dbbf5 |
}
|
|
Adam Tkac |
9dbbf5 |
}
|
|
Adam Tkac |
9dbbf5 |
@@ -3608,6 +3606,31 @@ get_address(char *host, in_port_t port,
|
|
Adam Tkac |
9dbbf5 |
return (ISC_R_SUCCESS);
|
|
Adam Tkac |
9dbbf5 |
}
|
|
Adam Tkac |
9dbbf5 |
|
|
Adam Tkac |
9dbbf5 |
+int
|
|
Adam Tkac |
9dbbf5 |
+getaddresses(dig_lookup_t *lookup, const char *host) {
|
|
Adam Tkac |
9dbbf5 |
+ isc_result_t result;
|
|
Adam Tkac |
9dbbf5 |
+ isc_sockaddr_t sockaddrs[DIG_MAX_ADDRESSES];
|
|
Adam Tkac |
9dbbf5 |
+ isc_netaddr_t netaddr;
|
|
Adam Tkac |
9dbbf5 |
+ int count, i;
|
|
Adam Tkac |
9dbbf5 |
+ dig_server_t *srv;
|
|
Adam Tkac |
9dbbf5 |
+ char tmp[ISC_NETADDR_FORMATSIZE];
|
|
Adam Tkac |
9dbbf5 |
+
|
|
Adam Tkac |
9dbbf5 |
+ result = bind9_getaddresses(host, 0, sockaddrs,
|
|
Adam Tkac |
9dbbf5 |
+ DIG_MAX_ADDRESSES, &count);
|
|
Adam Tkac |
9dbbf5 |
+ if (result != ISC_R_SUCCESS)
|
|
Adam Tkac |
9dbbf5 |
+ fatal("couldn't get address for '%s': %s",
|
|
Adam Tkac |
9dbbf5 |
+ host, isc_result_totext(result));
|
|
Adam Tkac |
9dbbf5 |
+
|
|
Adam Tkac |
9dbbf5 |
+ for (i = 0; i < count; i++) {
|
|
Adam Tkac |
9dbbf5 |
+ isc_netaddr_fromsockaddr(&netaddr, &sockaddrs[i]);
|
|
Adam Tkac |
9dbbf5 |
+ isc_netaddr_format(&netaddr, tmp, sizeof(tmp));
|
|
Adam Tkac |
9dbbf5 |
+ srv = make_server(tmp, host);
|
|
Adam Tkac |
9dbbf5 |
+ ISC_LIST_APPEND(lookup->my_server_list, srv, link);
|
|
Adam Tkac |
9dbbf5 |
+ }
|
|
Adam Tkac |
9dbbf5 |
+
|
|
Adam Tkac |
9dbbf5 |
+ return count;
|
|
Adam Tkac |
9dbbf5 |
+}
|
|
Adam Tkac |
9dbbf5 |
+
|
|
Adam Tkac |
9dbbf5 |
/*%
|
|
Adam Tkac |
9dbbf5 |
* Initiate either a TCP or UDP lookup
|
|
Adam Tkac |
9dbbf5 |
*/
|
|
Adam Tkac |
9dbbf5 |
diff -up bind-9.7.3/bin/dig/include/dig/dig.h.rh674334 bind-9.7.3/bin/dig/include/dig/dig.h
|
|
Adam Tkac |
9dbbf5 |
--- bind-9.7.3/bin/dig/include/dig/dig.h.rh674334 2011-02-18 13:37:45.820518990 +0100
|
|
Adam Tkac |
9dbbf5 |
+++ bind-9.7.3/bin/dig/include/dig/dig.h 2011-02-18 13:37:45.830518968 +0100
|
|
Adam Tkac |
9dbbf5 |
@@ -289,6 +289,9 @@ extern int idnoptions;
|
|
Adam Tkac |
9dbbf5 |
isc_result_t
|
|
Adam Tkac |
9dbbf5 |
get_address(char *host, in_port_t port, isc_sockaddr_t *sockaddr);
|
|
Adam Tkac |
9dbbf5 |
|
|
Adam Tkac |
9dbbf5 |
+int
|
|
Adam Tkac |
9dbbf5 |
+getaddresses(dig_lookup_t *lookup, const char *host);
|
|
Adam Tkac |
9dbbf5 |
+
|
|
Adam Tkac |
9dbbf5 |
isc_result_t
|
|
Adam Tkac |
9dbbf5 |
get_reverse(char *reverse, size_t len, char *value, isc_boolean_t ip6_int,
|
|
Adam Tkac |
9dbbf5 |
isc_boolean_t strict);
|