1 --- a/hostapd/ctrl_iface.c
2 +++ b/hostapd/ctrl_iface.c
4 #include "fst/fst_ctrl_iface.h"
5 #include "config_file.h"
6 #include "ctrl_iface.h"
7 +#include "config_file.h"
10 #define HOSTAPD_CLI_DUP_VALUE_MAX_LEN 256
11 @@ -73,6 +74,7 @@ static void hostapd_ctrl_iface_send(stru
12 enum wpa_msg_type type,
13 const char *buf, size_t len);
15 +static char *reload_opts = NULL;
17 static int hostapd_ctrl_iface_attach(struct hostapd_data *hapd,
18 struct sockaddr_storage *from,
19 @@ -124,6 +126,61 @@ static int hostapd_ctrl_iface_new_sta(st
23 +static char *get_option(char *opt, char *str)
25 + int len = strlen(str);
27 + if (!strncmp(opt, str, len))
33 +static struct hostapd_config *hostapd_ctrl_iface_config_read(const char *fname)
35 + struct hostapd_config *conf;
38 + conf = hostapd_config_read(fname);
42 + for (opt = strtok(reload_opts, " ");
44 + opt = strtok(NULL, " ")) {
46 + if ((val = get_option(opt, "channel=")))
47 + conf->channel = atoi(val);
48 + else if ((val = get_option(opt, "ht_capab=")))
49 + conf->ht_capab = atoi(val);
50 + else if ((val = get_option(opt, "ht_capab_mask=")))
51 + conf->ht_capab &= atoi(val);
52 + else if ((val = get_option(opt, "sec_chan=")))
53 + conf->secondary_channel = atoi(val);
54 + else if ((val = get_option(opt, "hw_mode=")))
55 + conf->hw_mode = atoi(val);
56 + else if ((val = get_option(opt, "ieee80211n=")))
57 + conf->ieee80211n = atoi(val);
65 +static int hostapd_ctrl_iface_update(struct hostapd_data *hapd, char *txt)
67 + struct hostapd_config * (*config_read_cb)(const char *config_fname);
68 + struct hostapd_iface *iface = hapd->iface;
70 + config_read_cb = iface->interfaces->config_read_cb;
71 + iface->interfaces->config_read_cb = hostapd_ctrl_iface_config_read;
74 + hostapd_reload_config(iface);
76 + iface->interfaces->config_read_cb = config_read_cb;
79 #ifdef CONFIG_IEEE80211W
81 @@ -2620,6 +2677,8 @@ static int hostapd_ctrl_iface_receive_pr
82 } else if (os_strncmp(buf, "VENDOR ", 7) == 0) {
83 reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply,
85 + } else if (os_strncmp(buf, "UPDATE ", 7) == 0) {
86 + hostapd_ctrl_iface_update(hapd, buf + 7);
87 } else if (os_strcmp(buf, "ERP_FLUSH") == 0) {
88 ieee802_1x_erp_flush(hapd);
90 --- a/src/ap/ctrl_iface_ap.c
91 +++ b/src/ap/ctrl_iface_ap.c
92 @@ -624,7 +624,13 @@ int hostapd_parse_csa_settings(const cha
94 int hostapd_ctrl_iface_stop_ap(struct hostapd_data *hapd)
96 - return hostapd_drv_stop_ap(hapd);
97 + struct hostapd_iface *iface = hapd->iface;
100 + for (i = 0; i < iface->num_bss; i++)
101 + hostapd_drv_stop_ap(iface->bss[i]);