1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-11 00:49:02 +00:00

Allow -4 option signifying IPv4 mode

This commit is contained in:
dmiller
2015-12-21 04:10:38 +00:00
parent dd0050598b
commit 4e73ed7efd

View File

@@ -700,7 +700,7 @@ void parse_options(int argc, char **argv) {
/* OK, lets parse these args! */
optind = 1; /* so it can be called multiple times */
while ((arg = getopt_long_only(argc, argv, "6Ab:D:d::e:Ffg:hIi:M:m:nO::o:P:p:qRrS:s:T:Vv::", long_options, &option_index)) != EOF) {
while ((arg = getopt_long_only(argc, argv, "46Ab:D:d::e:Ffg:hIi:M:m:nO::o:P:p:qRrS:s:T:Vv::", long_options, &option_index)) != EOF) {
switch (arg) {
case 0:
#ifndef NOLUA
@@ -1028,6 +1028,11 @@ void parse_options(int argc, char **argv) {
fatal("Unknown long option (%s) given@#!$#$", long_options[option_index].name);
}
break;
case '4':
/* This is basically useless for now, but serves as a placeholder to
* ensure that -4 is a valid option */
o.setaf(AF_INET);
break;
case '6':
#if !HAVE_IPV6
fatal("I am afraid IPv6 is not available because your host doesn't support it or you chose to compile Nmap w/o IPv6 support.");