diff --git a/CHANGELOG b/CHANGELOG index d16a961e9..d45a79257 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,10 @@ o When an NSE script changes the state of a port (e.g. from scripts through a "reason" element in the port-table. Thanks to Matthew Boyle for the patch. +o 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. + o Reworded an error message after a woman reported that it was "highly offensive and sexist". She also noted that "times have changed and many women now use your software" and "a sexist remark like the one diff --git a/service_scan.cc b/service_scan.cc index 809a6dc48..a3e1c1b32 100644 --- a/service_scan.cc +++ b/service_scan.cc @@ -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));