Use os_reltime_initialized() for Michael MIC failure event
The first event could have theoretically been received with reltime sec=0, so use the helper function to check whether the reltime value is actually set so that the usec part is checked as well. This is not going to have a difference in practice, but it was possible to hit this corner case with mac80211_hwsim testing (ap_cipher_tkip_countermeasures_sta) using UML and time travel. Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
This commit is contained in:
parent
f321705e31
commit
f9965a6505
1 changed files with 1 additions and 1 deletions
|
@ -4293,7 +4293,7 @@ wpa_supplicant_event_michael_mic_failure(struct wpa_supplicant *wpa_s,
|
||||||
wpa_msg(wpa_s, MSG_WARNING, "Michael MIC failure detected");
|
wpa_msg(wpa_s, MSG_WARNING, "Michael MIC failure detected");
|
||||||
pairwise = (data && data->michael_mic_failure.unicast);
|
pairwise = (data && data->michael_mic_failure.unicast);
|
||||||
os_get_reltime(&t);
|
os_get_reltime(&t);
|
||||||
if ((wpa_s->last_michael_mic_error.sec &&
|
if ((os_reltime_initialized(&wpa_s->last_michael_mic_error) &&
|
||||||
!os_reltime_expired(&t, &wpa_s->last_michael_mic_error, 60)) ||
|
!os_reltime_expired(&t, &wpa_s->last_michael_mic_error, 60)) ||
|
||||||
wpa_s->pending_mic_error_report) {
|
wpa_s->pending_mic_error_report) {
|
||||||
if (wpa_s->pending_mic_error_report) {
|
if (wpa_s->pending_mic_error_report) {
|
||||||
|
|
Loading…
Reference in a new issue