diff options
Diffstat (limited to 'usr.sbin/bind/bin/dig/dig.c')
| -rw-r--r-- | usr.sbin/bind/bin/dig/dig.c | 22 |
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, |
