Split ap_sta_set_authorized() into two steps
This function is both updating the hostapd-internal sta->flags value and sending out the AP-STA-CONNECTED control interface message. When authorizing a STA, the call to this function is followed by a driver command to update the flags of the STA entry in the driver. That has a race condition at least for UML time-travel since the AP-STA-CONNECTED event is used as a message to wait for before running a connectivity test or some other operation that depends on the data connection being in working condition. Split the function into two steps so that the driver STA entry update can be done between those two steps for the cases where it matters for the race condition. In other words, send the AP-STA-CONNECTED message only after having authorized the STA in the driver. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
52e869032a
commit
2ab56694f6
5 changed files with 47 additions and 14 deletions
|
@ -393,6 +393,10 @@ const u8 * ap_sta_wpa_get_dpp_pkhash(struct hostapd_data *hapd,
|
|||
void ap_sta_disconnect(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
const u8 *addr, u16 reason);
|
||||
|
||||
bool ap_sta_set_authorized_flag(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
int authorized);
|
||||
void ap_sta_set_authorized_event(struct hostapd_data *hapd,
|
||||
struct sta_info *sta, int authorized);
|
||||
void ap_sta_set_authorized(struct hostapd_data *hapd,
|
||||
struct sta_info *sta, int authorized);
|
||||
static inline int ap_sta_is_authorized(struct sta_info *sta)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue