summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bind/bin/dig/dig.c
diff options
context:
space:
mode:
authorsthen <sthen@openbsd.org>2019-12-17 01:52:25 +0000
committersthen <sthen@openbsd.org>2019-12-17 01:52:25 +0000
commitc35d4ceefb31c7618476a2ff3efb06eb269767ef (patch)
tree11cba913b0cf0a84e2f37d15e06a6a94e33f09a6 /usr.sbin/bind/bin/dig/dig.c
parentupdate to 9.10.8-P1, last isc-licensed release (diff)
downloadwireguard-openbsd-c35d4ceefb31c7618476a2ff3efb06eb269767ef.tar.xz
wireguard-openbsd-c35d4ceefb31c7618476a2ff3efb06eb269767ef.zip
merge in https://github.com/isc-projects/bind9/commit/b8a04d50a361.patch
(pre MPL), v4/v6-only wasn't working correctly (trying to use an v6-mapped v4 address when set for v6-only)
Diffstat (limited to 'usr.sbin/bind/bin/dig/dig.c')
-rw-r--r--usr.sbin/bind/bin/dig/dig.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/usr.sbin/bind/bin/dig/dig.c b/usr.sbin/bind/bin/dig/dig.c
index 592c530c040..8288b30660d 100644
--- a/usr.sbin/bind/bin/dig/dig.c
+++ b/usr.sbin/bind/bin/dig/dig.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dig.c,v 1.20 2019/12/17 01:46:31 sthen Exp $ */
+/* $Id: dig.c,v 1.21 2019/12/17 01:52:25 sthen Exp $ */
/*! \file */
@@ -83,7 +83,8 @@ static char sitvalue[256];
static isc_boolean_t short_form = ISC_FALSE, printcmd = ISC_TRUE,
ip6_int = ISC_FALSE, plusquest = ISC_FALSE, pluscomm = ISC_FALSE,
multiline = ISC_FALSE, nottl = ISC_FALSE, noclass = ISC_FALSE,
- onesoa = ISC_FALSE, use_usec = ISC_FALSE, nocrypto = ISC_FALSE;
+ onesoa = ISC_FALSE, use_usec = ISC_FALSE, nocrypto = ISC_FALSE,
+ ipv4only = ISC_FALSE, ipv6only = ISC_FALSE;
static isc_uint32_t splitwidth = 0xffffffff;
/*% rrcomments are neither explicitly enabled nor disabled by default */
@@ -1788,11 +1789,22 @@ preparse_args(int argc, char **argv) {
continue;
option = &rv[0][1];
while (strpbrk(option, single_dash_opts) == &option[0]) {
- if (option[0] == 'm') {
+ switch (option[0]) {
+ case 'm':
memdebugging = ISC_TRUE;
isc_mem_debugging = ISC_MEM_DEBUGTRACE |
ISC_MEM_DEBUGRECORD;
- return;
+ break;
+ case '4':
+ if (ipv6only)
+ fatal("only one of -4 and -6 allowed");
+ ipv4only = ISC_TRUE;
+ break;
+ case '6':
+ if (ipv4only)
+ fatal("only one of -4 and -6 allowed");
+ ipv6only = ISC_TRUE;
+ break;
}
option = &option[1];
}
@@ -2173,7 +2185,7 @@ void dig_setup(int argc, char **argv)
check_result(result, "isc_app_start");
setup_libs();
- setup_system();
+ setup_system(ipv4only, ipv6only);
}
void dig_query_setup(isc_boolean_t is_batchfile, isc_boolean_t config_only,