aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHu Wang <huw@codeaurora.org>2018-07-18 08:41:40 (GMT)
committerJouni Malinen <j@w1.fi>2018-08-21 15:50:12 (GMT)
commit567df5501cdfda90bfc74215c9614258b5ddba5d (patch)
tree16f9b65988e36f570ce29a22d1115578479168d9
parent1e1245bc8bf23be1d9e4b0d07881a8d927af6e11 (diff)
downloadhostap-567df5501cdfda90bfc74215c9614258b5ddba5d.zip
hostap-567df5501cdfda90bfc74215c9614258b5ddba5d.tar.gz
hostap-567df5501cdfda90bfc74215c9614258b5ddba5d.tar.bz2
Re-configure WEP keys on hostapd interface re-enable
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>
-rw-r--r--src/ap/drv_callbacks.c5
-rw-r--r--src/ap/hostapd.c10
-rw-r--r--src/ap/hostapd.h1
3 files changed, 15 insertions, 1 deletions
diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
index 3994278..6ec82e5 100644
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
@@ -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);
}
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index f095586..23d2720 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -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;
diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
index 4129120..9a520f3 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
@@ -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,