Commit 7ba05518 authored by Brian Wellington's avatar Brian Wellington
Browse files

ipv4-less operation

parent db237e54
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: nsupdate.c,v 1.63 2000/11/22 02:54:15 bwelling Exp $ */ /* $Id: nsupdate.c,v 1.64 2000/11/22 21:25:38 bwelling Exp $ */
#include <config.h> #include <config.h>
...@@ -85,6 +85,7 @@ extern int h_errno; ...@@ -85,6 +85,7 @@ extern int h_errno;
static isc_boolean_t debugging = ISC_FALSE, ddebugging = ISC_FALSE; static isc_boolean_t debugging = ISC_FALSE, ddebugging = ISC_FALSE;
static isc_boolean_t memdebugging = ISC_FALSE; static isc_boolean_t memdebugging = ISC_FALSE;
static isc_boolean_t have_ipv4 = ISC_FALSE;
static isc_boolean_t have_ipv6 = ISC_FALSE; static isc_boolean_t have_ipv6 = ISC_FALSE;
static isc_boolean_t is_dst_up = ISC_FALSE; static isc_boolean_t is_dst_up = ISC_FALSE;
static isc_boolean_t usevc = ISC_FALSE; static isc_boolean_t usevc = ISC_FALSE;
...@@ -366,12 +367,16 @@ setup_system(void) { ...@@ -366,12 +367,16 @@ setup_system(void) {
dns_result_register(); dns_result_register();
result = isc_net_probeipv4(); result = isc_net_probeipv4();
check_result(result, "isc_net_probeipv4"); if (result == ISC_R_SUCCESS)
have_ipv4 = ISC_TRUE;
result = isc_net_probeipv6(); result = isc_net_probeipv6();
if (result == ISC_R_SUCCESS) if (result == ISC_R_SUCCESS)
have_ipv6 = ISC_TRUE; have_ipv6 = ISC_TRUE;
if (!have_ipv4 && !have_ipv6)
fatal("couldn't find either IPv4 or IPv6");
result = isc_mem_create(0, 0, &mctx); result = isc_mem_create(0, 0, &mctx);
check_result(result, "isc_mem_create"); check_result(result, "isc_mem_create");
...@@ -445,14 +450,17 @@ setup_system(void) { ...@@ -445,14 +450,17 @@ setup_system(void) {
check_result(result, "dns_dispatch_getudp (v6)"); check_result(result, "dns_dispatch_getudp (v6)");
} }
attrs = DNS_DISPATCHATTR_UDP; if (have_ipv4) {
attrs |= DNS_DISPATCHATTR_MAKEQUERY; attrs = DNS_DISPATCHATTR_UDP;
attrs |= DNS_DISPATCHATTR_IPV4; attrs |= DNS_DISPATCHATTR_MAKEQUERY;
isc_sockaddr_any(&bind_any); attrs |= DNS_DISPATCHATTR_IPV4;
result = dns_dispatch_getudp(dispatchmgr, socketmgr, taskmgr, isc_sockaddr_any(&bind_any);
&bind_any, PACKETSIZE, 4, 2, 3, 5, result = dns_dispatch_getudp(dispatchmgr, socketmgr, taskmgr,
attrs, attrmask, &dispatchv4); &bind_any, PACKETSIZE,
check_result(result, "dns_dispatch_getudp (v4)"); 4, 2, 3, 5,
attrs, attrmask, &dispatchv4);
check_result(result, "dns_dispatch_getudp (v4)");
}
result = dns_requestmgr_create(mctx, timermgr, result = dns_requestmgr_create(mctx, timermgr,
socketmgr, taskmgr, dispatchmgr, socketmgr, taskmgr, dispatchmgr,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment