3 @@ -42,37 +42,8 @@ static int hostapd_setup_encryption(char
5 extern int wpa_debug_level;
8 -int hostapd_reload_config(struct hostapd_iface *iface)
9 +static int hostapd_reload_bss(struct hostapd_data *hapd)
11 - struct hostapd_data *hapd = iface->bss[0];
12 - struct hostapd_config *newconf, *oldconf;
15 - if (iface->config_read_cb == NULL)
17 - newconf = iface->config_read_cb(iface->config_fname);
18 - if (newconf == NULL)
22 - * Deauthenticate all stations since the new configuration may not
23 - * allow them to use the BSS anymore.
25 - for (j = 0; j < iface->num_bss; j++)
26 - hostapd_flush_old_stations(iface->bss[j]);
28 -#ifndef CONFIG_NO_RADIUS
29 - /* TODO: update dynamic data based on changed configuration
30 - * items (e.g., open/close sockets, etc.) */
31 - radius_client_flush(hapd->radius, 0);
32 -#endif /* CONFIG_NO_RADIUS */
34 - oldconf = hapd->iconf;
35 - hapd->iconf = newconf;
36 - hapd->conf = &newconf->bss[0];
37 - iface->conf = newconf;
39 if (hostapd_setup_wpa_psk(hapd->conf)) {
40 wpa_printf(MSG_ERROR, "Failed to re-configure WPA PSK "
41 "after reloading configuration");
42 @@ -110,10 +81,46 @@ int hostapd_reload_config(struct hostapd
43 wpa_printf(MSG_ERROR, "Could not set SSID for kernel driver");
46 + wpa_printf(MSG_DEBUG, "Reconfigured interface %s", hapd->conf->iface);
49 +int hostapd_reload_config(struct hostapd_iface *iface)
51 + struct hostapd_data *hapd = iface->bss[0];
52 + struct hostapd_config *newconf, *oldconf;
55 + if (iface->config_read_cb == NULL)
57 + newconf = iface->config_read_cb(iface->config_fname);
58 + if (newconf == NULL)
62 + * Deauthenticate all stations since the new configuration may not
63 + * allow them to use the BSS anymore.
65 + for (j = 0; j < iface->num_bss; j++)
66 + hostapd_flush_old_stations(iface->bss[j]);
68 +#ifndef CONFIG_NO_RADIUS
69 + /* TODO: update dynamic data based on changed configuration
70 + * items (e.g., open/close sockets, etc.) */
71 + radius_client_flush(hapd->radius, 0);
72 +#endif /* CONFIG_NO_RADIUS */
74 + oldconf = hapd->iconf;
75 + iface->conf = newconf;
77 + for (j = 0; j < iface->num_bss; j++) {
78 + hapd = iface->bss[j];
79 + hapd->iconf = newconf;
80 + hapd->conf = &newconf->bss[j];
81 + hostapd_reload_bss(hapd);
84 hostapd_config_free(oldconf);
86 - wpa_printf(MSG_DEBUG, "Reconfigured interface %s", hapd->conf->iface);