aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/wpa_ctrl.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-12-16 20:08:25 (GMT)
committerJouni Malinen <j@w1.fi>2013-12-24 05:14:50 (GMT)
commit636e19a53dd8457d036899a9df9d84174d10a524 (patch)
treef5ef054141686adc205ff80a6b8f9cc4ea0f90bc /src/common/wpa_ctrl.c
parent7ffe7d222a53ac28ed8c1e137706dbd1ffcf3629 (diff)
downloadhostap-636e19a53dd8457d036899a9df9d84174d10a524.zip
hostap-636e19a53dd8457d036899a9df9d84174d10a524.tar.gz
hostap-636e19a53dd8457d036899a9df9d84174d10a524.tar.bz2
wpa_ctrl: Use monotonic time for request retry loop
The request retry loop only retries for 5 seconds, so any time jumps would probably not affect it much, but it should be using monotonic time nonetheless since it only cares about duration. Signed-hostap: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'src/common/wpa_ctrl.c')
-rw-r--r--src/common/wpa_ctrl.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/wpa_ctrl.c b/src/common/wpa_ctrl.c
index 83788d7..f4af94a 100644
--- a/src/common/wpa_ctrl.c
+++ b/src/common/wpa_ctrl.c
@@ -391,7 +391,7 @@ int wpa_ctrl_request(struct wpa_ctrl *ctrl, const char *cmd, size_t cmd_len,
void (*msg_cb)(char *msg, size_t len))
{
struct timeval tv;
- struct os_time started_at;
+ struct os_reltime started_at;
int res;
fd_set rfds;
const char *_cmd;
@@ -430,12 +430,12 @@ retry_send:
* longer before giving up.
*/
if (started_at.sec == 0)
- os_get_time(&started_at);
+ os_get_reltime(&started_at);
else {
- struct os_time n;
- os_get_time(&n);
+ struct os_reltime n;
+ os_get_reltime(&n);
/* Try for a few seconds. */
- if (n.sec > started_at.sec + 5)
+ if (os_reltime_expired(&n, &started_at, 5))
goto send_err;
}
os_sleep(1, 0);