Nmap Development mailing list archives

Re: [nmap-svn] r28292 - in nmap: . nsock/src


From: Fyodor <fyodor () insecure org>
Date: Thu, 22 Mar 2012 14:51:26 -0700

On Fri, Mar 16, 2012 at 01:02:57PM -0700, commit-mailer () insecure org wrote:
Log:
Update nsock_tod before creating a timer.

nsock_tod is Nsock's idea of the current time. It is updated when an
nsock_pool is initialized, on each iteration of nsock_loop, and in a few
other places. What could go wrong, with respect to timers, is a sequence
like this:
      nsp_new
      [... some long delay ...]
      nsock_create_timer(timeout)
      nsock_loop
The time elapsed after the creatino of the timer until it fires would
not be timeout, but rather timeout - delay. If the delay was long
enough, the timer would fire as loop as nsock_loop was entered.

This showed itself in IPv6 OS detection. We schedule 6 timers
immediately, 100 ms apart. If the pcap_open or anything else took too
long, then the timers would fire all at once. This messed up the
calculation of the TCP_ISR feature.

Perhaps we should do this when any new event is created? It is already
done manually at the beginning of each of the connect functions.

Adding this to event creation sounds good to me.

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


Current thread: