mirror of
https://github.com/nmap/nmap.git
synced 2026-01-19 04:39:01 +00:00
Fix some switch-case logic in massping that made all connection-refused responses look like syn-acks when doing TCP connect ping scan.
This commit is contained in:
25
targets.cc
25
targets.cc
@@ -1181,19 +1181,20 @@ while(pt->block_unaccounted) {
|
||||
int sock_err = socket_errno();
|
||||
switch(sock_err) {
|
||||
case ECONNREFUSED:
|
||||
foundsomething = 1;
|
||||
newstate = HOST_UP;
|
||||
hostbatch[hostindex]->reason.reason_id = ER_CONREFUSED;
|
||||
case EAGAIN:
|
||||
#ifdef WIN32
|
||||
case WSAENOTCONN:
|
||||
#endif
|
||||
if (sock_err == EAGAIN && o.verbose) {
|
||||
log_write(LOG_STDOUT, "Machine %s MIGHT actually be listening on probe port %d\n", hostbatch[hostindex]->targetipstr(), o.ping_synprobes[p]);
|
||||
}
|
||||
foundsomething = 1;
|
||||
newstate = HOST_UP;
|
||||
hostbatch[hostindex]->reason.reason_id = ER_CONACCEPT;
|
||||
newstate = HOST_UP;
|
||||
hostbatch[hostindex]->reason.reason_id = ER_CONREFUSED;
|
||||
break;
|
||||
case EAGAIN:
|
||||
if (o.verbose)
|
||||
log_write(LOG_STDOUT, "Machine %s MIGHT actually be listening on probe port %d\n", hostbatch[hostindex]->targetipstr(), o.ping_synprobes[p]);
|
||||
/* Fall through. */
|
||||
#ifdef WIN32
|
||||
case WSAENOTCONN:
|
||||
#endif
|
||||
foundsomething = 1;
|
||||
newstate = HOST_UP;
|
||||
hostbatch[hostindex]->reason.reason_id = ER_CONACCEPT;
|
||||
break;
|
||||
case ENETDOWN:
|
||||
case ENETUNREACH:
|
||||
|
||||
Reference in New Issue
Block a user