1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-29 02:49:01 +00:00

Simplify AF checking for literal IP addresses.

This commit is contained in:
dmiller
2017-08-03 22:05:18 +00:00
parent a24a02b087
commit d5e7649829
2 changed files with 4 additions and 14 deletions

View File

@@ -260,6 +260,10 @@ static NetBlock *parse_expr_without_netmask(const char *hostexp, int af) {
sslen = sizeof(ss);
if (resolve_numeric(hostexp, 0, &ss, &sslen, AF_INET6) == 0) {
if (af != AF_INET6) {
error("%s looks like an IPv6 target specification -- you have to use the -6 option.", hostexp);
return NULL;
}
NetBlockIPv6Netmask *netblock_ipv6;
netblock_ipv6 = new NetBlockIPv6Netmask();