<div dir="ltr">Hi!<div>It seems like dnsmasq may occasionally hang (=become unresponsive, unkillable with "killall dnsmasq" (-9 works), doesn't seem to answer on DHCP requests etc) if the system time is changed backwards.</div><div><br></div><div>I ran strace on dnsmasq once when this happened:</div><div><div>root@OD-11:~# strace -p 1645 -f -tt -s 1024</div><div>Process 1645 attached</div><div>12:12:08.502148 select(18, [6 7 8 9 10 11 15 16 17], [], NULL, {0, 46327}) = 0 (Timeout)</div><div>12:12:08.552953 gettimeofday({1435572728, 553933}, NULL) = 0</div><div>12:12:08.555642 select(18, [6 7 8 9 10 11 15 16 17], [], NULL, {0, 250000}) = 0 (Timeout)</div><div>12:12:08.808748 gettimeofday({1435572728, 809379}, NULL) = 0</div><div>12:12:08.810668 select(18, [6 7 8 9 10 11 15 16 17], [], NULL, {0, 250000}) = 0 (Timeout)</div><div>12:12:09.063807 gettimeofday({1435572729, 65256}, NULL) = 0</div><div>12:12:09.066343 select(18, [6 7 8 9 10 11 15 16 17], [], NULL, {0, 250000}) = 0 (Timeout)</div><div>12:12:09.319034 gettimeofday({1435572729, 320590}, NULL) = 0</div><div>12:12:09.321021 select(18, [6 7 8 9 10 11 15 16 17], [], NULL, {0, 250000}) = 0 (Timeout)</div></div><div><br></div><div>I grep:ed for select:s in the source code and my guess is that it's the icmp_ping() select loop in dnsmasq.c that gets confused. Perhaps monotonic time should be used in this for loop:</div><div><div>for (now = start = dnsmasq_time(); difftime(now, start) < (float)PING_WAIT;)</div></div><div><br></div><div>I manually set the time forward a few hours and dnsmasq released immediately:</div><div><div>root@SYSTEM:~# date -s "2015-06-29 14:14:56"</div><div>Mon Jun 29 14:14:56 CEST 2015</div><div>root@SYSTEM:~# Mon Jun 29 14:14:56 2015 <a href="http://daemon.info">daemon.info</a> dnsmasq-dhcp[1645]: DHCPDISCOVER(wlan0-work) 8a:33:14:0f:3b:d8 </div><div>Mon Jun 29 14:14:56 2015 <a href="http://daemon.info">daemon.info</a> dnsmasq-dhcp[1645]: DHCPOFFER(wlan0-work) 192.168.7.146 8a:33:14:0f:3b:d8</div></div><div><br></div><div>I'm using dnsmasq 2.72.</div><div><br></div><div>Thanks, Jacob</div></div>