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

Unconditionally set the port state to PORT_OPEN when receiving a service

scan response, instead of checking for a current state of
PORT_OPENFILTERED. The code calls getPortState, but the port may not
have been assigned a state, again because of the new Port allocation
architecture, so the function returns -1.

It would make sense to have getPortState return the default port state
if a Port has not been allocated, but there are two other places it is
used where the code relies on it returning -1 to indicate that a port
has not received a state yet.
This commit is contained in:
david
2010-01-23 02:01:50 +00:00
parent 12ccaa7786
commit 4c57d3f8c8
2 changed files with 15 additions and 12 deletions

View File

@@ -533,6 +533,9 @@ void PortList::setPortState(u16 portno, u8 protocol, int state) {
return;
}
/* Return the current port state, if a Port has been allocated for this port.
Returns -1 if the port hasn't had anything about it set yet--in particular,
this function does not return the default port state by default. */
int PortList::getPortState(u16 portno, u8 protocol) {
const Port *port;