1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-05 22:19:03 +00:00

Change some references to o.ipprotscan into (rangetype & SCAN_PROTOCOLS) to avoid using global knowledge in getpts_aux.

This commit is contained in:
david
2007-11-01 08:11:15 +00:00
parent b17c82a0b0
commit f020df112f

14
nmap.cc
View File

@@ -2175,11 +2175,14 @@ static void getpts_aux(char *origexpr, int nested, u8 *porttbl, int range_type,
return;
} else if (*current_range == '-') {
rangestart = o.ipprotscan ? 0 : 1;
if (range_type & SCAN_PROTOCOLS)
rangestart = 0;
else
rangestart = 1;
}
else if (isdigit((int) *current_range)) {
rangestart = strtol(current_range, &endptr, 10);
if (o.ipprotscan) {
if (range_type & SCAN_PROTOCOLS) {
if (rangestart < 0 || rangestart > 255)
fatal("Protocols to be scanned must be between 0 and 255 inclusive");
} else {
@@ -2219,10 +2222,13 @@ static void getpts_aux(char *origexpr, int nested, u8 *porttbl, int range_type,
current_range++;
if (!*current_range || *current_range == ',' || *current_range == ']') {
/* Ended with a -, meaning up until the last possible port */
rangeend = o.ipprotscan ? 255 : 65535;
if (range_type & SCAN_PROTOCOLS)
rangeend = 255;
else
rangeend = 65535;
} else if (isdigit((int) *current_range)) {
rangeend = strtol(current_range, &endptr, 10);
if (o.ipprotscan) {
if (range_type & SCAN_PROTOCOLS) {
if (rangeend < 0 || rangeend > 255)
fatal("Protocols to be scanned must be between 0 and 255 inclusive");
} else {