From: Jouni Malinen Date: Sun, 18 Dec 2022 10:21:54 +0000 (+0200) Subject: Check both sec and usec values to see if MAC address was changed X-Git-Tag: hostap_2_11~1366 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=681856c355a87a991203d9b7f79f12700117239c;p=thirdparty%2Fhostap.git Check both sec and usec values to see if MAC address was changed wpa_s->last_mac_addr_change.sec might be zero in the special case of UML testing with time travel since it would be possible to complete the test case steps within one second of the system start. Signed-off-by: Jouni Malinen --- diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index 370668a30..5bf1f542d 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -2246,7 +2246,8 @@ int wpas_update_random_addr(struct wpa_supplicant *wpa_s, int style, if (os_memcmp(wpa_s->own_addr, ssid->mac_value, ETH_ALEN) == 0) return 0; - } else if (wpa_s->last_mac_addr_change.sec != 0 && + } else if ((wpa_s->last_mac_addr_change.sec != 0 || + wpa_s->last_mac_addr_change.usec != 0) && !os_reltime_expired( &now, &wpa_s->last_mac_addr_change,