mirror of
https://github.com/nmap/nmap.git
synced 2025-12-15 12:19:02 +00:00
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.