summaryrefslogtreecommitdiffstats
path: root/package/hostapd/patches/452-ctrl_iface_reload.patch
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-11-09 01:36:36 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-11-09 01:36:36 +0000
commitacbc4c5f9530b1e9ef782baaf33c72bd7d775c1b (patch)
tree4eef31c26fcc6e6f251cb7bc2b3da3cd20927dd6 /package/hostapd/patches/452-ctrl_iface_reload.patch
parent929a8c4e3fdbc1763a917e2b698396fc694f3470 (diff)
hostapd: update to 20101109, reorganize patches
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23932 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/hostapd/patches/452-ctrl_iface_reload.patch')
-rw-r--r--package/hostapd/patches/452-ctrl_iface_reload.patch96
1 files changed, 0 insertions, 96 deletions
diff --git a/package/hostapd/patches/452-ctrl_iface_reload.patch b/package/hostapd/patches/452-ctrl_iface_reload.patch
deleted file mode 100644
index e07ab6d44..000000000
--- a/package/hostapd/patches/452-ctrl_iface_reload.patch
+++ /dev/null
@@ -1,96 +0,0 @@
---- a/hostapd/ctrl_iface.c
-+++ b/hostapd/ctrl_iface.c
-@@ -35,6 +35,7 @@
- #include "ap/wps_hostapd.h"
- #include "ap/ctrl_iface_ap.h"
- #include "ctrl_iface.h"
-+#include "config_file.h"
-
-
- struct wpa_ctrl_dst {
-@@ -45,6 +46,7 @@ struct wpa_ctrl_dst {
- int errors;
- };
-
-+static char *reload_opts = NULL;
-
- static void hostapd_ctrl_iface_send(struct hostapd_data *hapd, int level,
- const char *buf, size_t len);
-@@ -315,6 +317,66 @@ static int hostapd_ctrl_iface_wps_oob(st
- #endif /* CONFIG_WPS_OOB */
- #endif /* CONFIG_WPS */
-
-+static int hostapd_ctrl_iface_set_down(struct hostapd_data *hapd)
-+{
-+ if (hapd->driver->stop_ap)
-+ hapd->driver->stop_ap(hapd->drv_priv);
-+ return 0;
-+}
-+
-+static char *get_option(char *opt, char *str)
-+{
-+ int len = strlen(str);
-+
-+ if (!strncmp(opt, str, len))
-+ return opt + len;
-+ else
-+ return NULL;
-+}
-+
-+static struct hostapd_config *hostapd_ctrl_iface_config_read(const char *fname)
-+{
-+ struct hostapd_config *conf;
-+ char *opt, *val;
-+
-+ conf = hostapd_config_read(fname);
-+ if (!conf)
-+ return NULL;
-+
-+ for (opt = strtok(reload_opts, " ");
-+ opt;
-+ opt = strtok(NULL, " ")) {
-+
-+ if ((val = get_option(opt, "channel=")))
-+ conf->channel = atoi(val);
-+ else if ((val = get_option(opt, "ht_capab=")))
-+ conf->ht_capab = atoi(val);
-+ else if ((val = get_option(opt, "ht_capab_mask=")))
-+ conf->ht_capab &= atoi(val);
-+ else if ((val = get_option(opt, "sec_chan=")))
-+ conf->secondary_channel = atoi(val);
-+ else if ((val = get_option(opt, "hwmode=")))
-+ conf->hw_mode = atoi(val);
-+ else if ((val = get_option(opt, "ieee80211n=")))
-+ conf->ieee80211n = atoi(val);
-+ else
-+ break;
-+ }
-+
-+ return conf;
-+}
-+
-+static int hostapd_ctrl_iface_reload(struct hostapd_data *hapd, char *txt)
-+{
-+ struct hostapd_iface *iface = hapd->iface;
-+
-+ iface->config_read_cb = hostapd_ctrl_iface_config_read;
-+ reload_opts = txt;
-+
-+ hostapd_reload_config(iface);
-+
-+ iface->config_read_cb = hostapd_config_read;
-+}
-
- static void hostapd_ctrl_iface_receive(int sock, void *eloop_ctx,
- void *sock_ctx)
-@@ -379,6 +441,10 @@ static void hostapd_ctrl_iface_receive(i
- reply_len += res;
- }
- #endif /* CONFIG_NO_RADIUS */
-+ } else if (os_strcmp(buf, "DOWN") == 0) {
-+ hostapd_ctrl_iface_set_down(hapd);
-+ } else if (os_strncmp(buf, "RELOAD ", 7) == 0) {
-+ hostapd_ctrl_iface_reload(hapd, buf + 7);
- } else if (os_strcmp(buf, "STA-FIRST") == 0) {
- reply_len = hostapd_ctrl_iface_sta_first(hapd, reply,
- reply_size);