diff --git a/CHANGELOG b/CHANGELOG index 6f282caee..07b65872e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ # Nmap Changelog ($Id$); -*-text-*- +o Fixed a bug that could cause Nsock timers to fire too early. This + could happen for the timed probes in IPv6 OS detection, causing an + incorrect measurement of the TCP_ISR feature. [David Fifield] + o [NSE] Added a stun library and the scripts stun-version and stun-info, which extract version information and the external NAT:ed address. [Patrik Karlsson] diff --git a/nsock/src/nsock_timers.c b/nsock/src/nsock_timers.c index 1d350ace1..254ce1dfc 100644 --- a/nsock/src/nsock_timers.c +++ b/nsock/src/nsock_timers.c @@ -57,6 +57,8 @@ #include "nsock_internal.h" +extern struct timeval nsock_tod; + /* Send back an NSE_TYPE_TIMER after the number of milliseconds specified. Of * course it can also return due to error, cancellation, etc. */ nsock_event_id nsock_timer_create(nsock_pool ms_pool, nsock_ev_handler handler, @@ -64,6 +66,8 @@ nsock_event_id nsock_timer_create(nsock_pool ms_pool, nsock_ev_handler handler, mspool *nsp = (mspool *)ms_pool; msevent *nse; + gettimeofday(&nsock_tod, NULL); + nse = msevent_new(nsp, NSE_TYPE_TIMER, NULL, timeout_msecs, handler, userdata); assert(nse);