1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-20 14:39:02 +00:00

Fix grepable output "Ignored State" reporting. Only one ignored state (the one

with the highest numbers of ports) is output.
This commit is contained in:
david
2008-05-29 20:05:02 +00:00
parent 6992d545e1
commit d3263f0f1a

View File

@@ -751,8 +751,12 @@ void printportoutput(Target *currenths, PortList *plist) {
} }
/* log_write(LOG_PLAIN,"\n"); */ /* log_write(LOG_PLAIN,"\n"); */
if (plist->getStateCounts(istate) > 0) /* Grepable output supports only one ignored state. */
log_write(LOG_MACHINE, "\tIgnored State: %s (%d)", statenum2str(istate), plist->getStateCounts(istate)); if (plist->numIgnoredStates() == 1) {
istate = plist->nextIgnoredState(PORT_UNKNOWN);
if (plist->getStateCounts(istate) > 0)
log_write(LOG_MACHINE, "\tIgnored State: %s (%d)", statenum2str(istate), plist->getStateCounts(istate));
}
log_write(LOG_XML, "</ports>\n"); log_write(LOG_XML, "</ports>\n");
// Now we write the table for the user // Now we write the table for the user