}
+static int wpa_auth_get_sta_count(struct wpa_authenticator *wpa_auth)
+{
+ if (!wpa_auth->cb->get_sta_count)
+ return -1;
+
+ return wpa_auth->cb->get_sta_count(wpa_auth->cb_ctx);
+}
+
+
static void wpa_send_eapol(struct wpa_authenticator *wpa_auth,
struct wpa_state_machine *sm, int key_info,
const u8 *key_rsc, const u8 *nonce,
skip_tx:
#endif /* CONFIG_TESTING_OPTIONS */
- if (ctr == 1 && wpa_auth->conf.tx_status)
- timeout_ms = pairwise ? eapol_key_timeout_first :
- eapol_key_timeout_first_group;
- else
+ if (ctr == 1 && wpa_auth->conf.tx_status) {
+ if (pairwise)
+ timeout_ms = eapol_key_timeout_first;
+ else if (wpa_auth_get_sta_count(wpa_auth) > 100)
+ timeout_ms = eapol_key_timeout_first_group * 2;
+ else
+ timeout_ms = eapol_key_timeout_first_group;
+ } else {
timeout_ms = eapol_key_timeout_subseq;
+ }
if (wpa_auth->conf.wpa_disable_eapol_key_retries &&
(!pairwise || (key_info & WPA_KEY_INFO_MIC)))
timeout_ms = eapol_key_timeout_no_retrans;
int (*get_seqnum)(void *ctx, const u8 *addr, int idx, u8 *seq);
int (*send_eapol)(void *ctx, const u8 *addr, const u8 *data,
size_t data_len, int encrypt);
+ int (*get_sta_count)(void *ctx);
int (*for_each_sta)(void *ctx, int (*cb)(struct wpa_state_machine *sm,
void *ctx), void *cb_ctx);
int (*for_each_auth)(void *ctx, int (*cb)(struct wpa_authenticator *a,
}
+static int hostapd_wpa_auth_get_sta_count(void *ctx)
+{
+ struct hostapd_data *hapd = ctx;
+
+ return hapd->num_sta;
+}
+
+
static int hostapd_wpa_auth_for_each_sta(
void *ctx, int (*cb)(struct wpa_state_machine *sm, void *ctx),
void *cb_ctx)
.set_key = hostapd_wpa_auth_set_key,
.get_seqnum = hostapd_wpa_auth_get_seqnum,
.send_eapol = hostapd_wpa_auth_send_eapol,
+ .get_sta_count = hostapd_wpa_auth_get_sta_count,
.for_each_sta = hostapd_wpa_auth_for_each_sta,
.for_each_auth = hostapd_wpa_auth_for_each_auth,
.send_ether = hostapd_wpa_auth_send_ether,