From e0870187de9d43a1175ceb3c9a505cb23069c682 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 12 Nov 2009 16:00:16 +0000 Subject: [PATCH] Remove a test if (tcp_rpc_socket > max_sd) max_sd = tcp_rpc_socket; The condition is always true because max_sd is initialized to -1 and that block of code is entered only if tcp_rpc_socket > -1. It looks like the kind of thing that would be managing a large set of sockets for select, but here we're only selecting on one socket at a time. This was suggested by Lionel Cons. --- nmap_rpc.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nmap_rpc.cc b/nmap_rpc.cc index 17630efb5..a705bd83c 100644 --- a/nmap_rpc.cc +++ b/nmap_rpc.cc @@ -519,8 +519,7 @@ void get_rpc_results(Target *target, struct portinfo *scan, max_sd = udp_rpc_socket; } else if (tcp_rpc_socket >= 0 && rsi->rpc_current_port->proto == IPPROTO_TCP) { FD_SET(tcp_rpc_socket, &fds_r); - if (tcp_rpc_socket > max_sd) - max_sd = tcp_rpc_socket; + max_sd = tcp_rpc_socket; } else { error("Unable to find listening socket in %s", __func__); return;