Home page logo
/

nmap-dev logo Nmap Development mailing list archives

get_max_open_descriptors() is more generous than Nsock.
From: "Luis MartinGarcia." <luis.mgarc () gmail com>
Date: Mon, 19 Dec 2011 13:36:11 +0100

Hi,

I am using libnetutil::get_max_open_descriptors() to determine the
maximum number of TCP connects that I can do in Nping before I start
closing old sockets. The thing is that on my Linux box, that function
returns 4096. However, when I schedule more than 1024 TCP connect
events, nsock fatals:

[...]
SENT (1.0150s) Starting TCP Handshake > ::1:80
SENT (1.0160s) Starting TCP Handshake > ::1:80
SENT (1.0170s) Starting TCP Handshake > ::1:80
SENT (1.0180s) Starting TCP Handshake > ::1:80
nsock_core.c:186: Attempt to FD_SET fd 1024, which is not less than
FD_SETSIZE (1024). Try using a lower parallelism.

Has anyone experienced this behavior? Is nsock failing to determine the
maximum number of descriptors per process? Is it
get_max_open_descriptors()'s fault?

Regards,

Luis MartinGarcia.


PS: Debug output


NSOCK (7.8530s) msevent_new (IOD #NULL) (EID #16364)
NSOCK (7.8530s) Timer created - 2ms from now.  EID 16364
NSOCK (7.8530s) NSE #16364: Adding event
NSOCK (7.8530s) nsock_loop() started (timeout=2ms). 3 events pending
NSOCK (7.8530s) wait_for_events
NSOCK (7.8530s) before iterating, list 0
NSOCK (7.8530s) before iterating, list 1
NSOCK (7.8530s) before iterating, list 2
NSOCK (7.8530s) before iterating, list 3
NSOCK (7.8530s) before iterating 16332
NSOCK (7.8530s) before iterating 16356
NSOCK (7.8530s) before iterating 16364
NSOCK (7.8530s) before iterating, list 4
NSOCK (7.8530s) list 3, iterating 16332
NSOCK (7.8530s) NSE #16332: Removing event from event_lists[3]
NSOCK (7.8530s) Callback: TIMER SUCCESS for EID 16332
NSOCK (7.8530s) msevent_new (IOD #1022) (EID #16368)
NSOCK (7.8530s) TCP connection requested to ::1:80 (IOD #1022) EID 16368
NSOCK (7.8530s) NSE #16368: Adding event
nsock_core.c:186: Attempt to FD_SET fd 1024, which is not less than
FD_SETSIZE (1024). Try using a lower parallelism.

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]
AlienVault