wpa_supplicant, eloop_register_timeout() and ntpdate

Holger Schurig holgerschurig
Wed Nov 13 05:13:46 PST 2013


Hi all,

I noticed that wpa_supplicant doesn't really like it when the system
time changes while it is running.

On one of my devices the CMOS clock is abysmal, so I connect via WLAN,
and then run "ntpdate" to get the new time. At that point some code in
wpa_supplicant stop working, e.g. callbacks registered via
eloop_register_timeout(). That brings bgscan into trouble, for
example.

I'm on a medium-old wpa_supplicant, git describe --tags says
"hostap_2_0-669-gd92fcb6". Was there some change in the meantime?


As a side node, C++ applications using Qt4 don't suffer from that
problem. Also, systemd's *.timer units also work correctly !

In systemd's the function manager_setup_time_change() in
src/core/manager.c checks via realtime clock changes with the help of
timerfd_create(CLOCK_REALTIME, TFD_NONBLOCK|TFD_CLOEXEC) and
timerfd_settime(m->time_change_watch.fd,
TFD_TIMER_ABSTIME|TFD_TIMER_CANCEL_ON_SET, &its, NULL). But systemd
uses epoll, which isn't used by wpa_supplicant.

Any idea on how wpa_supplicant could be hardened against time changes?



More information about the Hostap mailing list