]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Re-configure WEP keys on hostapd interface re-enable
authorHu Wang <huw@codeaurora.org>
Wed, 18 Jul 2018 08:41:40 +0000 (16:41 +0800)
committerJouni Malinen <j@w1.fi>
Tue, 21 Aug 2018 15:50:12 +0000 (18:50 +0300)
This allows WEP mode AP to be re-enabled automatically after external
ifconfig down + up on netdev used by hostapd.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/ap/drv_callbacks.c
src/ap/hostapd.c
src/ap/hostapd.h

index 39942780480d1ec7cd0dda8914c1ddda8fc7881d..6ec82e525fc101fc20739ca57967caba0c313756 100644 (file)
@@ -1711,7 +1711,10 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
                         * Try to re-enable interface if the driver stopped it
                         * when the interface got disabled.
                         */
-                       wpa_auth_reconfig_group_keys(hapd->wpa_auth);
+                       if (hapd->wpa_auth)
+                               wpa_auth_reconfig_group_keys(hapd->wpa_auth);
+                       else
+                               hostapd_reconfig_encryption(hapd);
                        hapd->reenable_beacon = 1;
                        ieee802_11_set_beacon(hapd);
                }
index f0955863e74c5f4dc908510b01728d61573c32d0..23d27207508d048db035f2c718d79fcb7711a2a1 100644 (file)
@@ -78,6 +78,16 @@ int hostapd_for_each_interface(struct hapd_interfaces *interfaces,
 }
 
 
+void hostapd_reconfig_encryption(struct hostapd_data *hapd)
+{
+       if (hapd->wpa_auth)
+               return;
+
+       hostapd_set_privacy(hapd, 0);
+       hostapd_setup_encryption(hapd->conf->iface, hapd);
+}
+
+
 static void hostapd_reload_bss(struct hostapd_data *hapd)
 {
        struct hostapd_ssid *ssid;
index 4129120f3e783fd57130bd7829ed48142bcefc09..9a520f3a94286f4a35b8d96ed44b33b8cc23c299 100644 (file)
@@ -538,6 +538,7 @@ int hostapd_for_each_interface(struct hapd_interfaces *interfaces,
                               int (*cb)(struct hostapd_iface *iface,
                                         void *ctx), void *ctx);
 int hostapd_reload_config(struct hostapd_iface *iface);
+void hostapd_reconfig_encryption(struct hostapd_data *hapd);
 struct hostapd_data *
 hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
                       struct hostapd_config *conf,