summaryrefslogtreecommitdiff
path: root/package/hostapd
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-10-23 23:39:49 +0000
committerFelix Fietkau <nbd@openwrt.org>2010-10-23 23:39:49 +0000
commit0fbff7de83cfa67aa5c7b63e9d3964983655453c (patch)
tree43fd65a8cfb654cd61c2fce5331e141447398e75 /package/hostapd
parentb6d0865e7fbdc419ee71318c73d26c0a7fa93f5e (diff)
downloadmtk-20170518-0fbff7de83cfa67aa5c7b63e9d3964983655453c.zip
mtk-20170518-0fbff7de83cfa67aa5c7b63e9d3964983655453c.tar.gz
mtk-20170518-0fbff7de83cfa67aa5c7b63e9d3964983655453c.tar.bz2
hostapd: fix SIGHUP for multi-bss
SVN-Revision: 23601
Diffstat (limited to 'package/hostapd')
-rw-r--r--package/hostapd/patches/440-mbss_reload_fix.patch89
1 files changed, 89 insertions, 0 deletions
diff --git a/package/hostapd/patches/440-mbss_reload_fix.patch b/package/hostapd/patches/440-mbss_reload_fix.patch
new file mode 100644
index 0000000..ed513b1
--- /dev/null
+++ b/package/hostapd/patches/440-mbss_reload_fix.patch
@@ -0,0 +1,89 @@
+--- a/src/ap/hostapd.c
++++ b/src/ap/hostapd.c
+@@ -42,37 +42,8 @@ static int hostapd_setup_encryption(char
+
+ extern int wpa_debug_level;
+
+-
+-int hostapd_reload_config(struct hostapd_iface *iface)
++static int hostapd_reload_bss(struct hostapd_data *hapd)
+ {
+- struct hostapd_data *hapd = iface->bss[0];
+- struct hostapd_config *newconf, *oldconf;
+- size_t j;
+-
+- if (iface->config_read_cb == NULL)
+- return -1;
+- newconf = iface->config_read_cb(iface->config_fname);
+- if (newconf == NULL)
+- return -1;
+-
+- /*
+- * Deauthenticate all stations since the new configuration may not
+- * allow them to use the BSS anymore.
+- */
+- for (j = 0; j < iface->num_bss; j++)
+- hostapd_flush_old_stations(iface->bss[j]);
+-
+-#ifndef CONFIG_NO_RADIUS
+- /* TODO: update dynamic data based on changed configuration
+- * items (e.g., open/close sockets, etc.) */
+- radius_client_flush(hapd->radius, 0);
+-#endif /* CONFIG_NO_RADIUS */
+-
+- oldconf = hapd->iconf;
+- hapd->iconf = newconf;
+- hapd->conf = &newconf->bss[0];
+- iface->conf = newconf;
+-
+ if (hostapd_setup_wpa_psk(hapd->conf)) {
+ wpa_printf(MSG_ERROR, "Failed to re-configure WPA PSK "
+ "after reloading configuration");
+@@ -110,10 +81,46 @@ int hostapd_reload_config(struct hostapd
+ wpa_printf(MSG_ERROR, "Could not set SSID for kernel driver");
+ /* try to continue */
+ }
++ wpa_printf(MSG_DEBUG, "Reconfigured interface %s", hapd->conf->iface);
++}
++
++int hostapd_reload_config(struct hostapd_iface *iface)
++{
++ struct hostapd_data *hapd = iface->bss[0];
++ struct hostapd_config *newconf, *oldconf;
++ size_t j;
++
++ if (iface->config_read_cb == NULL)
++ return -1;
++ newconf = iface->config_read_cb(iface->config_fname);
++ if (newconf == NULL)
++ return -1;
++
++ /*
++ * Deauthenticate all stations since the new configuration may not
++ * allow them to use the BSS anymore.
++ */
++ for (j = 0; j < iface->num_bss; j++)
++ hostapd_flush_old_stations(iface->bss[j]);
++
++#ifndef CONFIG_NO_RADIUS
++ /* TODO: update dynamic data based on changed configuration
++ * items (e.g., open/close sockets, etc.) */
++ radius_client_flush(hapd->radius, 0);
++#endif /* CONFIG_NO_RADIUS */
++
++ oldconf = hapd->iconf;
++ iface->conf = newconf;
++
++ for (j = 0; j < iface->num_bss; j++) {
++ hapd = iface->bss[j];
++ hapd->iconf = newconf;
++ hapd->conf = &newconf->bss[j];
++ hostapd_reload_bss(hapd);
++ }
+
+ hostapd_config_free(oldconf);
+
+- wpa_printf(MSG_DEBUG, "Reconfigured interface %s", hapd->conf->iface);
+
+ return 0;
+ }