]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WNM: Use os_relatime_add_ms() helper
authorBenjamin Berg <benjamin.berg@intel.com>
Mon, 29 Apr 2024 11:51:44 +0000 (13:51 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 2 Aug 2024 09:48:42 +0000 (12:48 +0300)
Just simplify the code a little bit by using the helper instead of doing
the math inline.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
wpa_supplicant/wnm_sta.c

index 51ac2d6b35ebdcb3a06905ce9d2e4e5d9eb61c0c..9b7047218123ff59a357b5d4d7289a206258cdcf 100644 (file)
@@ -1599,11 +1599,7 @@ static void ieee802_11_rx_bss_trans_mgmt_req(struct wpa_supplicant *wpa_s,
                wpa_printf(MSG_DEBUG, "WNM: Candidate list valid for %u ms",
                           valid_ms);
                os_get_reltime(&wpa_s->wnm_cand_valid_until);
-               wpa_s->wnm_cand_valid_until.sec += valid_ms / 1000;
-               wpa_s->wnm_cand_valid_until.usec += (valid_ms % 1000) * 1000;
-               wpa_s->wnm_cand_valid_until.sec +=
-                       wpa_s->wnm_cand_valid_until.usec / 1000000;
-               wpa_s->wnm_cand_valid_until.usec %= 1000000;
+               os_reltime_add_ms(&wpa_s->wnm_cand_valid_until, valid_ms);
 
                /*
                * Try fetching the latest scan results from the kernel.