mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
A couple of typos corrected
Improvement to host8 compatibility.
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: dig.c,v 1.91 2000/09/13 00:03:25 mws Exp $ */
|
/* $Id: dig.c,v 1.92 2000/09/13 00:27:21 mws Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -960,7 +960,7 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
|
|||||||
rv++;
|
rv++;
|
||||||
rc--;
|
rc--;
|
||||||
}
|
}
|
||||||
get_address(address, 0, &bind_address);
|
get_address(address, 0, &bind_address, ISC_FALSE);
|
||||||
specified_source = ISC_TRUE;
|
specified_source = ISC_TRUE;
|
||||||
} else if (strncmp(rv[0], "-h", 2) == 0) {
|
} else if (strncmp(rv[0], "-h", 2) == 0) {
|
||||||
show_usage();
|
show_usage();
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: dighost.c,v 1.123 2000/09/13 00:13:54 gson Exp $ */
|
/* $Id: dighost.c,v 1.124 2000/09/13 00:27:23 mws Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Notice to programmers: Do not use this code as an example of how to
|
* Notice to programmers: Do not use this code as an example of how to
|
||||||
@@ -2208,7 +2208,8 @@ recv_done(isc_task_t *task, isc_event_t *event) {
|
|||||||
* routines, since they may be using a non-DNS system for these lookups.
|
* routines, since they may be using a non-DNS system for these lookups.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
get_address(char *host, in_port_t port, isc_sockaddr_t *sockaddr) {
|
get_address(char *host, in_port_t port, isc_sockaddr_t *sockaddr,
|
||||||
|
isc_boolean_t running) {
|
||||||
struct in_addr in4;
|
struct in_addr in4;
|
||||||
struct in6_addr in6;
|
struct in6_addr in6;
|
||||||
#if defined(HAVE_ADDRINFO) && defined(HAVE_GETADDRINFO)
|
#if defined(HAVE_ADDRINFO) && defined(HAVE_GETADDRINFO)
|
||||||
@@ -2227,9 +2228,11 @@ get_address(char *host, in_port_t port, isc_sockaddr_t *sockaddr) {
|
|||||||
else {
|
else {
|
||||||
#if defined(HAVE_ADDRINFO) && defined(HAVE_GETADDRINFO)
|
#if defined(HAVE_ADDRINFO) && defined(HAVE_GETADDRINFO)
|
||||||
debug ("before getaddrinfo()");
|
debug ("before getaddrinfo()");
|
||||||
isc_app_block();
|
if (running)
|
||||||
|
isc_app_block();
|
||||||
result = getaddrinfo(host, NULL, NULL, &res);
|
result = getaddrinfo(host, NULL, NULL, &res);
|
||||||
isc_app_unblock();
|
if (running)
|
||||||
|
isc_app_unblock();
|
||||||
if (result != 0) {
|
if (result != 0) {
|
||||||
fatal("Couldn't find server '%s': %s",
|
fatal("Couldn't find server '%s': %s",
|
||||||
host, gai_strerror(result));
|
host, gai_strerror(result));
|
||||||
@@ -2240,9 +2243,11 @@ get_address(char *host, in_port_t port, isc_sockaddr_t *sockaddr) {
|
|||||||
freeaddrinfo(res);
|
freeaddrinfo(res);
|
||||||
#else
|
#else
|
||||||
debug ("before gethostbyname()");
|
debug ("before gethostbyname()");
|
||||||
isc_app_block();
|
if (running)
|
||||||
|
isc_app_block();
|
||||||
he = gethostbyname(host);
|
he = gethostbyname(host);
|
||||||
isc_app_unblock();
|
if (running)
|
||||||
|
isc_app_unblock();
|
||||||
if (he == NULL)
|
if (he == NULL)
|
||||||
fatal("Couldn't find server '%s' (h_errno=%d)",
|
fatal("Couldn't find server '%s' (h_errno=%d)",
|
||||||
host, h_errno);
|
host, h_errno);
|
||||||
@@ -2283,15 +2288,16 @@ do_lookup_tcp(dig_lookup_t *lookup) {
|
|||||||
query != NULL;
|
query != NULL;
|
||||||
query = ISC_LIST_NEXT(query, link)) {
|
query = ISC_LIST_NEXT(query, link)) {
|
||||||
query->waiting_connect = ISC_TRUE;
|
query->waiting_connect = ISC_TRUE;
|
||||||
get_address(query->servname, port, &query->sockaddr);
|
get_address(query->servname, port, &query->sockaddr,
|
||||||
|
ISC_TRUE);
|
||||||
|
|
||||||
if (specified_source &&
|
if (specified_source &&
|
||||||
(isc_sockaddr_pf(&query->sockaddr) !=
|
(isc_sockaddr_pf(&query->sockaddr) !=
|
||||||
isc_sockaddr_pf(&bind_address))) {
|
isc_sockaddr_pf(&bind_address))) {
|
||||||
printf(";; Skipping server %s, incompatible "
|
printf(";; Skipping server %s, incompatible "
|
||||||
"address family\n", query->servname);
|
"address family\n", query->servname);
|
||||||
continue;
|
|
||||||
query->waiting_connect = ISC_FALSE;
|
query->waiting_connect = ISC_FALSE;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
INSIST(query->sock == NULL);
|
INSIST(query->sock == NULL);
|
||||||
result = isc_socket_create(socketmgr,
|
result = isc_socket_create(socketmgr,
|
||||||
@@ -2333,7 +2339,8 @@ do_lookup_udp(dig_lookup_t *lookup) {
|
|||||||
query = ISC_LIST_NEXT(query, link)) {
|
query = ISC_LIST_NEXT(query, link)) {
|
||||||
/* XXX Check the sense of this, need assertion? */
|
/* XXX Check the sense of this, need assertion? */
|
||||||
query->waiting_connect = ISC_FALSE;
|
query->waiting_connect = ISC_FALSE;
|
||||||
get_address(query->servname, port, &query->sockaddr);
|
get_address(query->servname, port, &query->sockaddr,
|
||||||
|
ISC_TRUE);
|
||||||
|
|
||||||
result = isc_socket_create(socketmgr,
|
result = isc_socket_create(socketmgr,
|
||||||
isc_sockaddr_pf(&query->sockaddr),
|
isc_sockaddr_pf(&query->sockaddr),
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: host.c,v 1.52 2000/09/13 00:12:49 gson Exp $ */
|
/* $Id: host.c,v 1.53 2000/09/13 00:27:24 mws Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -415,6 +415,20 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
|
|||||||
|
|
||||||
UNUSED(headers);
|
UNUSED(headers);
|
||||||
|
|
||||||
|
if (listed_server) {
|
||||||
|
printf("Using domain server:\n");
|
||||||
|
printf("Name: %s\n", query->servname);
|
||||||
|
result = isc_buffer_allocate(mctx, &b, MXNAME);
|
||||||
|
check_result(result, "isc_buffer_allocate");
|
||||||
|
result = isc_sockaddr_totext(&query->sockaddr, b);
|
||||||
|
check_result(result, "isc_sockaddr_totext");
|
||||||
|
printf("Address: %.*s\n",
|
||||||
|
(int)isc_buffer_usedlength(b),
|
||||||
|
(char*)isc_buffer_base(b));
|
||||||
|
isc_buffer_free(&b);
|
||||||
|
printf("Aliases: \n\n");
|
||||||
|
}
|
||||||
|
|
||||||
if (msg->rcode != 0) {
|
if (msg->rcode != 0) {
|
||||||
result = isc_buffer_allocate(mctx, &b, MXNAME);
|
result = isc_buffer_allocate(mctx, &b, MXNAME);
|
||||||
check_result(result, "isc_buffer_allocate");
|
check_result(result, "isc_buffer_allocate");
|
||||||
@@ -492,20 +506,6 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
|
|||||||
ISC_TF(!short_form), query);
|
ISC_TF(!short_form), query);
|
||||||
if (result != ISC_R_SUCCESS)
|
if (result != ISC_R_SUCCESS)
|
||||||
return (result);
|
return (result);
|
||||||
} else {
|
|
||||||
if (short_form && listed_server) {
|
|
||||||
printf("Using domain server:\n");
|
|
||||||
printf("Name: %s\n", query->servname);
|
|
||||||
result = isc_buffer_allocate(mctx, &b, MXNAME);
|
|
||||||
check_result(result, "isc_buffer_allocate");
|
|
||||||
result = isc_sockaddr_totext(&query->sockaddr, b);
|
|
||||||
check_result(result, "isc_sockaddr_totext");
|
|
||||||
printf("Address: %.*s\n",
|
|
||||||
(int)isc_buffer_usedlength(b),
|
|
||||||
(char*)isc_buffer_base(b));
|
|
||||||
isc_buffer_free(&b);
|
|
||||||
printf("Aliases: \n\n");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! ISC_LIST_EMPTY(msg->sections[DNS_SECTION_AUTHORITY]) &&
|
if (! ISC_LIST_EMPTY(msg->sections[DNS_SECTION_AUTHORITY]) &&
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: dig.h,v 1.44 2000/09/13 00:03:28 mws Exp $ */
|
/* $Id: dig.h,v 1.45 2000/09/13 00:27:27 mws Exp $ */
|
||||||
|
|
||||||
#ifndef DIG_H
|
#ifndef DIG_H
|
||||||
#define DIG_H
|
#define DIG_H
|
||||||
@@ -164,7 +164,8 @@ struct dig_searchlist {
|
|||||||
* Routines in dighost.c.
|
* Routines in dighost.c.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
get_address(char *host, in_port_t port, isc_sockaddr_t *sockaddr);
|
get_address(char *host, in_port_t port, isc_sockaddr_t *sockaddr,
|
||||||
|
isc_boolean_t running);
|
||||||
|
|
||||||
void
|
void
|
||||||
fatal(const char *format, ...);
|
fatal(const char *format, ...);
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: nslookup.c,v 1.41 2000/09/01 23:43:55 bwelling Exp $ */
|
/* $Id: nslookup.c,v 1.42 2000/09/13 00:27:25 mws Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -545,7 +545,7 @@ show_settings(isc_boolean_t full) {
|
|||||||
while (srv != NULL) {
|
while (srv != NULL) {
|
||||||
result = isc_buffer_allocate(mctx, &b, MXNAME);
|
result = isc_buffer_allocate(mctx, &b, MXNAME);
|
||||||
check_result(result, "isc_buffer_allocate");
|
check_result(result, "isc_buffer_allocate");
|
||||||
get_address(srv->servername, 53, &sockaddr);
|
get_address(srv->servername, 53, &sockaddr, ISC_FALSE);
|
||||||
result = isc_sockaddr_totext(&sockaddr, b);
|
result = isc_sockaddr_totext(&sockaddr, b);
|
||||||
check_result(result, "isc_sockaddr_totext");
|
check_result(result, "isc_sockaddr_totext");
|
||||||
printf("Default server: %s\nAddress: %.*s\n",
|
printf("Default server: %s\nAddress: %.*s\n",
|
||||||
|
Reference in New Issue
Block a user