IBSS RSN: Use monotonic time for reinit detection
The reinit detection skips reinit when the time since the own authentication frame TX is less than half a second, so it shouldn't be affected by wall time and use monotonic time instead. Signed-hostap: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
196a217403
commit
3326f19355
2 changed files with 5 additions and 5 deletions
|
@ -590,7 +590,7 @@ int ibss_rsn_start(struct ibss_rsn *ibss_rsn, const u8 *addr)
|
||||||
peer->authentication_status |= IBSS_RSN_AUTH_BY_US;
|
peer->authentication_status |= IBSS_RSN_AUTH_BY_US;
|
||||||
return ibss_rsn_auth_init(ibss_rsn, peer);
|
return ibss_rsn_auth_init(ibss_rsn, peer);
|
||||||
} else {
|
} else {
|
||||||
os_get_time(&peer->own_auth_tx);
|
os_get_reltime(&peer->own_auth_tx);
|
||||||
eloop_register_timeout(1, 0, ibss_rsn_auth_timeout, peer, NULL);
|
eloop_register_timeout(1, 0, ibss_rsn_auth_timeout, peer, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -834,9 +834,9 @@ static void ibss_rsn_handle_auth_1_of_2(struct ibss_rsn *ibss_rsn,
|
||||||
if (peer &&
|
if (peer &&
|
||||||
peer->authentication_status & IBSS_RSN_AUTH_EAPOL_BY_PEER) {
|
peer->authentication_status & IBSS_RSN_AUTH_EAPOL_BY_PEER) {
|
||||||
if (peer->own_auth_tx.sec) {
|
if (peer->own_auth_tx.sec) {
|
||||||
struct os_time now, diff;
|
struct os_reltime now, diff;
|
||||||
os_get_time(&now);
|
os_get_reltime(&now);
|
||||||
os_time_sub(&now, &peer->own_auth_tx, &diff);
|
os_reltime_sub(&now, &peer->own_auth_tx, &diff);
|
||||||
if (diff.sec == 0 && diff.usec < 500000) {
|
if (diff.sec == 0 && diff.usec < 500000) {
|
||||||
wpa_printf(MSG_DEBUG, "RSN: Skip IBSS reinit since only %u usec from own Auth frame TX",
|
wpa_printf(MSG_DEBUG, "RSN: Skip IBSS reinit since only %u usec from own Auth frame TX",
|
||||||
(int) diff.usec);
|
(int) diff.usec);
|
||||||
|
|
|
@ -40,7 +40,7 @@ struct ibss_rsn_peer {
|
||||||
struct wpa_state_machine *auth;
|
struct wpa_state_machine *auth;
|
||||||
int authentication_status;
|
int authentication_status;
|
||||||
|
|
||||||
struct os_time own_auth_tx;
|
struct os_reltime own_auth_tx;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ibss_rsn {
|
struct ibss_rsn {
|
||||||
|
|
Loading…
Reference in a new issue