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:
@@ -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)); */
|
||||
|
||||
Reference in New Issue
Block a user