]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Remove unnecessary key clearing at AP start with nl80211
authorJouni Malinen <j@w1.fi>
Sat, 16 May 2020 08:28:03 +0000 (11:28 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 16 May 2020 08:28:03 +0000 (11:28 +0300)
cfg80211 takes care of key removal when link/association is lost, so
there is no need to explicitly clear old keys when starting AP.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/ap_drv_ops.c
src/ap/ap_drv_ops.h
src/ap/hostapd.c

index 1f284f0f38d035a5cd645e5d433269611372bf8b..904236baee347874164cac230b5e9b8936bed180 100644 (file)
@@ -650,6 +650,12 @@ int hostapd_drv_none(struct hostapd_data *hapd)
 }
 
 
+bool hostapd_drv_nl80211(struct hostapd_data *hapd)
+{
+       return hapd->driver && os_strcmp(hapd->driver->name, "nl80211") == 0;
+}
+
+
 int hostapd_driver_scan(struct hostapd_data *hapd,
                        struct wpa_driver_scan_params *params)
 {
index 56d1ad86266b6cb7b9cb5dde5a350d0dfbf4e999..811d26a2ce50dac400d6ab13aac58fca757cab16 100644 (file)
@@ -80,6 +80,7 @@ hostapd_get_hw_feature_data(struct hostapd_data *hapd, u16 *num_modes,
                            u16 *flags, u8 *dfs_domain);
 int hostapd_driver_commit(struct hostapd_data *hapd);
 int hostapd_drv_none(struct hostapd_data *hapd);
+bool hostapd_drv_nl80211(struct hostapd_data *hapd);
 int hostapd_driver_scan(struct hostapd_data *hapd,
                        struct wpa_driver_scan_params *params);
 struct wpa_scan_results * hostapd_driver_get_scan_results(
index 79ad38c40727b079af2249cf43145f72e6d07c5e..0f5a37f09de7ba6b79c54e5910c4904b087a80bb 100644 (file)
@@ -1182,7 +1182,8 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first)
        hostapd_set_privacy(hapd, 0);
 
 #ifdef CONFIG_WEP
-       hostapd_broadcast_wep_clear(hapd);
+       if (!hostapd_drv_nl80211(hapd))
+               hostapd_broadcast_wep_clear(hapd);
        if (hostapd_setup_encryption(conf->iface, hapd))
                return -1;
 #endif /* CONFIG_WEP */