Nmap Development mailing list archives

Re: Possible bug in ncat 6.01?


From: Henri Doreau <henri.doreau () gmail com>
Date: Wed, 5 Sep 2012 16:08:45 +0200

2012/9/4 Jonas Wielicki <nmap-dev () sotecware net>:
On 04.09.2012 15:18, Alex Weber wrote:
I've attached a patch to ncat_core.c - I just set each socket to blocking
before the send, and back to non-blocking after the send. That may mean
Ncat has to block for a moment when sending a lot of data, but I can't
think of a better way to handle it.
It also causes two extra syscalls per send per socket - I don't know if
this will have an appreciable performance impact, just something to
consider.
I could think of two ways to handle that differently:
(a) correctly handle the EAGAIN code
(b) set the sockets to blocking once and for all and use MSG_DONTWAIT
flag at places where non-blocking behaviour is expected.

- Jonas
Hi,

Not sure which approach I prefer, I'd therefore propose another
one[1]: what about using nsock? At some point I think it would be nice
to have ncat fully leverage it anyway (nsock has to provide a "server"
mode first). I just wrote a small patch, attached, to illustrate it.
It works fine for me, even though it's just a simple draft without SSL
support.

Regards.

[1] http://xkcd.com/927/

-- 
Henri

Attachment: ncat_nsock_broadcast.diff
Description:

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

Current thread: