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

Change PortList::getPortState to return the default port state if the

port is unknown, instead of -1. This makes it a better fit with the
other accessor functions. For those callers that need to know whether a
port is in the default state or not, add PortList::portIsDefault.

Having getPortState return -1 for ports in the default state would cause
the slightly wrong

Discovered unknown port 88/udp on 192.168.0.190 is actually open

to be printed instead of

Discovered open|filtered port 88/udp on 192.168.0.190 is actually open
This commit is contained in:
david
2010-01-26 20:46:26 +00:00
parent 1f6c6d1aac
commit 549dc85ad3
4 changed files with 13 additions and 7 deletions

View File

@@ -2630,10 +2630,11 @@ static bool ultrascan_port_pspec_update(UltraScanInfo *USI,
portno = pspec->pd.sctp.dport;
} else assert(0);
oldstate = hss->target->ports.getPortState(portno, proto);
if (oldstate == -1) {
if (hss->target->ports.portIsDefault(portno, proto)) {
oldstate = PORT_TESTING;
hss->ports_finished++;
} else {
oldstate = hss->target->ports.getPortState(portno, proto);
}
/* printf("TCP port %hu has changed from state %s to %s!\n", portno, statenum2str(oldstate), statenum2str(newstate)); */