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

When version detection changes the state of a port, the reason field is now updated as well (to udp-response or tcp-response as applicable). Thanks to Thomas Buchanan for the patch.

This commit is contained in:
fyodor
2007-11-15 23:41:12 +00:00
parent c5244fb05f
commit 5e67f7db4c
2 changed files with 8 additions and 0 deletions

View File

@@ -1694,6 +1694,10 @@ static void adjustPortStateIfNeccessary(ServiceNFO *svc) {
if (svc->port->state == PORT_OPENFILTERED) {
svc->target->ports.addPort(svc->portno, svc->proto, NULL, PORT_OPEN);
if (svc->proto == IPPROTO_TCP)
svc->target->ports.setStateReason(svc->portno, svc->proto, ER_TCPRESPONSE, 0, 0);
if (svc->proto == IPPROTO_UDP)
svc->target->ports.setStateReason(svc->portno, svc->proto, ER_UDPRESPONSE, 0, 0);
if (o.verbose || o.debugging > 1) {
svc->target->NameIP(host, sizeof(host));