diff options
Diffstat (limited to 'package/hostapd/patches')
28 files changed, 0 insertions, 2818 deletions
diff --git a/package/hostapd/patches/100-pending_work.patch b/package/hostapd/patches/100-pending_work.patch deleted file mode 100644 index 49e5b45f4..000000000 --- a/package/hostapd/patches/100-pending_work.patch +++ /dev/null @@ -1,123 +0,0 @@ ---- a/src/ap/ieee802_11.c -+++ b/src/ap/ieee802_11.c -@@ -1488,13 +1488,6 @@ static void handle_assoc_cb(struct hosta - int new_assoc = 1; - struct ieee80211_ht_capabilities ht_cap; - -- if (!ok) { -- hostapd_logger(hapd, mgmt->da, HOSTAPD_MODULE_IEEE80211, -- HOSTAPD_LEVEL_DEBUG, -- "did not acknowledge association response"); -- return; -- } -- - if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_resp) : - sizeof(mgmt->u.assoc_resp))) { - printf("handle_assoc_cb(reassoc=%d) - too short payload " -@@ -1502,11 +1495,6 @@ static void handle_assoc_cb(struct hosta - return; - } - -- if (reassoc) -- status = le_to_host16(mgmt->u.reassoc_resp.status_code); -- else -- status = le_to_host16(mgmt->u.assoc_resp.status_code); -- - sta = ap_get_sta(hapd, mgmt->da); - if (!sta) { - printf("handle_assoc_cb: STA " MACSTR " not found\n", -@@ -1514,6 +1502,19 @@ static void handle_assoc_cb(struct hosta - return; - } - -+ if (!ok) { -+ hostapd_logger(hapd, mgmt->da, HOSTAPD_MODULE_IEEE80211, -+ HOSTAPD_LEVEL_DEBUG, -+ "did not acknowledge association response"); -+ sta->flags &= ~WLAN_STA_ASSOC_REQ_OK; -+ return; -+ } -+ -+ if (reassoc) -+ status = le_to_host16(mgmt->u.reassoc_resp.status_code); -+ else -+ status = le_to_host16(mgmt->u.assoc_resp.status_code); -+ - if (status != WLAN_STATUS_SUCCESS) - goto fail; - -@@ -1812,6 +1813,9 @@ void ieee802_11_rx_from_unknown(struct h - - sta = ap_get_sta(hapd, src); - if (sta && (sta->flags & WLAN_STA_ASSOC)) { -+ if (!hapd->conf->wds_sta) -+ return; -+ - if (wds && !(sta->flags & WLAN_STA_WDS)) { - wpa_printf(MSG_DEBUG, "Enable 4-address WDS mode for " - "STA " MACSTR " (aid %u)", ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -2601,10 +2601,10 @@ static int wpa_driver_nl80211_capa(struc - drv->data_tx_status = info.data_tx_status; - - /* -- * If poll command is supported mac80211 is new enough to -- * have everything we need to not need monitor interfaces. -+ * If poll command and tx status are supported, mac80211 is new enough -+ * to have everything we need to not need monitor interfaces. - */ -- drv->use_monitor = !info.poll_command_supported; -+ drv->use_monitor = !info.poll_command_supported || !info.data_tx_status; - - if (drv->device_ap_sme && drv->use_monitor) { - /* -@@ -6286,8 +6286,8 @@ static int wpa_driver_nl80211_hapd_send_ - pos = (u8 *) (hdr + 1); - - if (qos) { -- /* add an empty QoS header if needed */ -- pos[0] = 0; -+ /* Set highest priority in QoS header */ -+ pos[0] = 7; - pos[1] = 0; - pos += 2; - } -@@ -7564,6 +7564,10 @@ static int i802_set_wds_sta(void *priv, - linux_set_iface_flags(drv->global->ioctl_sock, name, 1); - return i802_set_sta_vlan(priv, addr, name, 0); - } else { -+ if (bridge_ifname) -+ linux_br_del_if(drv->global->ioctl_sock, bridge_ifname, -+ name); -+ - i802_set_sta_vlan(priv, addr, bss->ifname, 0); - return wpa_driver_nl80211_if_remove(priv, WPA_IF_AP_VLAN, - name); -@@ -7931,7 +7935,12 @@ static int wpa_driver_nl80211_if_remove( - if (ifindex <= 0) - return -1; - -+ nl80211_remove_iface(drv, ifindex); -+ - #ifdef HOSTAPD -+ if (type != WPA_IF_AP_BSS) -+ return 0; -+ - if (bss->added_if_into_bridge) { - if (linux_br_del_if(drv->global->ioctl_sock, bss->brname, - bss->ifname) < 0) -@@ -7945,13 +7954,6 @@ static int wpa_driver_nl80211_if_remove( - "bridge %s: %s", - bss->brname, strerror(errno)); - } --#endif /* HOSTAPD */ -- -- nl80211_remove_iface(drv, ifindex); -- --#ifdef HOSTAPD -- if (type != WPA_IF_AP_BSS) -- return 0; - - if (bss != &drv->first_bss) { - struct i802_bss *tbss; diff --git a/package/hostapd/patches/300-nl80211_multicall_fixes.patch b/package/hostapd/patches/300-nl80211_multicall_fixes.patch deleted file mode 100644 index e0135df16..000000000 --- a/package/hostapd/patches/300-nl80211_multicall_fixes.patch +++ /dev/null @@ -1,60 +0,0 @@ ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -2931,6 +2931,7 @@ static void * wpa_driver_nl80211_init(vo - drv->monitor_sock = -1; - drv->eapol_tx_sock = -1; - drv->ap_scan_as_station = NL80211_IFTYPE_UNSPECIFIED; -+ drv->nlmode = NL80211_IFTYPE_STATION; - - if (wpa_driver_nl80211_init_nl(drv)) { - os_free(drv); -@@ -3245,17 +3246,12 @@ static void wpa_driver_nl80211_send_rfki - wpa_supplicant_event(timeout_ctx, EVENT_INTERFACE_DISABLED, NULL); - } - -- - static int --wpa_driver_nl80211_finish_drv_init(struct wpa_driver_nl80211_data *drv) -+wpa_driver_nl80211_finish_drv_init_sta(struct wpa_driver_nl80211_data *drv, -+ int *send_rfkill_event) - { - struct i802_bss *bss = &drv->first_bss; -- int send_rfkill_event = 0; - -- drv->ifindex = if_nametoindex(bss->ifname); -- drv->first_bss.ifindex = drv->ifindex; -- --#ifndef HOSTAPD - /* - * Make sure the interface starts up in station mode unless this is a - * dynamically added interface (e.g., P2P) that was already configured -@@ -3274,7 +3270,7 @@ wpa_driver_nl80211_finish_drv_init(struc - "interface '%s' due to rfkill", - bss->ifname); - drv->if_disabled = 1; -- send_rfkill_event = 1; -+ *send_rfkill_event = 1; - } else { - wpa_printf(MSG_ERROR, "nl80211: Could not set " - "interface '%s' UP", bss->ifname); -@@ -3284,7 +3280,19 @@ wpa_driver_nl80211_finish_drv_init(struc - - netlink_send_oper_ifla(drv->global->netlink, drv->ifindex, - 1, IF_OPER_DORMANT); --#endif /* HOSTAPD */ -+} -+ -+static int -+wpa_driver_nl80211_finish_drv_init(struct wpa_driver_nl80211_data *drv) -+{ -+ struct i802_bss *bss = &drv->first_bss; -+ int send_rfkill_event = 0; -+ -+ drv->ifindex = if_nametoindex(bss->ifname); -+ drv->first_bss.ifindex = drv->ifindex; -+ -+ if (drv->nlmode == NL80211_IFTYPE_STATION) -+ wpa_driver_nl80211_finish_drv_init_sta(drv, &send_rfkill_event); - - if (wpa_driver_nl80211_capa(drv)) - return -1; diff --git a/package/hostapd/patches/310-multicall_bridge_fix.patch b/package/hostapd/patches/310-multicall_bridge_fix.patch deleted file mode 100644 index 711f890e2..000000000 --- a/package/hostapd/patches/310-multicall_bridge_fix.patch +++ /dev/null @@ -1,45 +0,0 @@ ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -887,6 +887,10 @@ static void wpa_driver_nl80211_event_rtm - return; - } - -+ if (ifi->ifi_family == AF_BRIDGE && -+ drv->nlmode != NL80211_IFTYPE_AP) -+ return; -+ - wpa_printf(MSG_DEBUG, "RTM_NEWLINK: operstate=%d ifi_flags=0x%x " - "(%s%s%s%s)", - drv->operstate, ifi->ifi_flags, -@@ -994,6 +998,10 @@ static void wpa_driver_nl80211_event_rtm - attrlen = len; - attr = (struct rtattr *) buf; - -+ if (ifi->ifi_family == AF_BRIDGE && -+ drv->nlmode != NL80211_IFTYPE_AP) -+ return; -+ - rta_len = RTA_ALIGN(sizeof(struct rtattr)); - while (RTA_OK(attr, attrlen)) { - if (attr->rta_type == IFLA_IFNAME) { -@@ -2933,6 +2941,11 @@ static void * wpa_driver_nl80211_init(vo - drv->ap_scan_as_station = NL80211_IFTYPE_UNSPECIFIED; - drv->nlmode = NL80211_IFTYPE_STATION; - -+#ifdef HOSTAPD -+ drv->num_if_indices = sizeof(drv->default_if_indices) / sizeof(int); -+ drv->if_indices = drv->default_if_indices; -+#endif -+ - if (wpa_driver_nl80211_init_nl(drv)) { - os_free(drv); - return NULL; -@@ -7685,8 +7698,6 @@ static void *i802_init(struct hostapd_da - br_ifindex = 0; - } - -- drv->num_if_indices = sizeof(drv->default_if_indices) / sizeof(int); -- drv->if_indices = drv->default_if_indices; - for (i = 0; i < params->num_bridge; i++) { - if (params->bridge[i]) { - ifindex = if_nametoindex(params->bridge[i]); diff --git a/package/hostapd/patches/320-madwifi_key_fixes.patch b/package/hostapd/patches/320-madwifi_key_fixes.patch deleted file mode 100644 index d178bfa40..000000000 --- a/package/hostapd/patches/320-madwifi_key_fixes.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- a/src/drivers/driver_madwifi.c -+++ b/src/drivers/driver_madwifi.c -@@ -459,7 +459,9 @@ wpa_driver_madwifi_set_key(const char *i - - memset(&wk, 0, sizeof(wk)); - wk.ik_type = cipher; -- wk.ik_flags = IEEE80211_KEY_RECV | IEEE80211_KEY_XMIT; -+ wk.ik_flags = IEEE80211_KEY_RECV; -+ if (set_tx) -+ wk.ik_flags |= IEEE80211_KEY_XMIT; - if (addr == NULL || is_broadcast_ether_addr(addr)) { - memset(wk.ik_macaddr, 0xff, IEEE80211_ADDR_LEN); - wk.ik_keyix = key_idx; -@@ -471,6 +473,20 @@ wpa_driver_madwifi_set_key(const char *i - wk.ik_keylen = key_len; - memcpy(wk.ik_keydata, key, key_len); - -+#ifdef WORDS_BIGENDIAN -+#define WPA_KEY_RSC_LEN 8 -+ { -+ size_t i; -+ u8 tmp[WPA_KEY_RSC_LEN]; -+ os_memset(tmp, 0, sizeof(tmp)); -+ for (i = 0; i < seq_len; i++) -+ tmp[WPA_KEY_RSC_LEN - i - 1] = seq[i]; -+ os_memcpy(&wk.ik_keyrsc, tmp, WPA_KEY_RSC_LEN); -+ } -+#else /* WORDS_BIGENDIAN */ -+ os_memcpy(&wk.ik_keyrsc, seq, seq_len); -+#endif /* WORDS_BIGENDIAN */ -+ - ret = set80211priv(drv, IEEE80211_IOCTL_SETKEY, &wk, sizeof(wk)); - if (ret < 0) { - wpa_printf(MSG_DEBUG, "%s: Failed to set key (addr %s" diff --git a/package/hostapd/patches/400-scan_wait.patch b/package/hostapd/patches/400-scan_wait.patch deleted file mode 100644 index 8f16fe8ca..000000000 --- a/package/hostapd/patches/400-scan_wait.patch +++ /dev/null @@ -1,149 +0,0 @@ ---- a/src/ap/hostapd.h -+++ b/src/ap/hostapd.h -@@ -247,6 +247,7 @@ struct hostapd_iface { - int (*for_each_interface)(struct hapd_interfaces *interfaces, - int (*cb)(struct hostapd_iface *iface, - void *ctx), void *ctx); -+ int (*init_complete)(struct hostapd_iface *iface); - }; - - /* hostapd.c */ ---- a/src/ap/hostapd.c -+++ b/src/ap/hostapd.c -@@ -852,6 +852,9 @@ int hostapd_setup_interface_complete(str - wpa_printf(MSG_DEBUG, "%s: Setup of interface done.", - iface->bss[0]->conf->iface); - -+ if (iface->init_complete) -+ iface->init_complete(iface); -+ - return 0; - } - ---- a/hostapd/main.c -+++ b/hostapd/main.c -@@ -31,6 +31,8 @@ - extern int wpa_debug_level; - extern int wpa_debug_show_keys; - extern int wpa_debug_timestamp; -+static int daemonize = 0; -+static char *pid_file = NULL; - - extern struct wpa_driver_ops *wpa_drivers[]; - -@@ -145,6 +147,16 @@ static void hostapd_logger_cb(void *ctx, - } - #endif /* CONFIG_NO_HOSTAPD_LOGGER */ - -+static int hostapd_init_complete(struct hostapd_iface *iface) -+{ -+ if (daemonize && os_daemonize(pid_file)) { -+ perror("daemon"); -+ return -1; -+ } -+ daemonize = 0; -+ return 0; -+} -+ - - /** - * hostapd_init - Allocate and initialize per-interface data -@@ -166,6 +178,7 @@ static struct hostapd_iface * hostapd_in - if (hapd_iface == NULL) - goto fail; - -+ hapd_iface->init_complete = hostapd_init_complete; - hapd_iface->reload_config = hostapd_reload_config; - hapd_iface->config_read_cb = hostapd_config_read; - hapd_iface->config_fname = os_strdup(config_file); -@@ -419,7 +432,7 @@ static int hostapd_global_init(struct ha - } - - --static void hostapd_global_deinit(const char *pid_file) -+static void hostapd_global_deinit(void) - { - int i; - -@@ -449,8 +462,7 @@ static void hostapd_global_deinit(const - } - - --static int hostapd_global_run(struct hapd_interfaces *ifaces, int daemonize, -- const char *pid_file) -+static int hostapd_global_run(struct hapd_interfaces *iface) - { - #ifdef EAP_SERVER_TNC - int tnc = 0; -@@ -471,11 +483,6 @@ static int hostapd_global_run(struct hap - } - #endif /* EAP_SERVER_TNC */ - -- if (daemonize && os_daemonize(pid_file)) { -- perror("daemon"); -- return -1; -- } -- - eloop_run(); - - return 0; -@@ -532,8 +539,7 @@ int main(int argc, char *argv[]) - struct hapd_interfaces interfaces; - int ret = 1; - size_t i; -- int c, debug = 0, daemonize = 0; -- char *pid_file = NULL; -+ int c, debug = 0; - const char *log_file = NULL; - const char *entropy_file = NULL; - -@@ -611,7 +617,7 @@ int main(int argc, char *argv[]) - goto out; - } - -- if (hostapd_global_run(&interfaces, daemonize, pid_file)) -+ if (hostapd_global_run(&interfaces)) - goto out; - - ret = 0; -@@ -622,7 +628,7 @@ int main(int argc, char *argv[]) - hostapd_interface_deinit_free(interfaces.iface[i]); - os_free(interfaces.iface); - -- hostapd_global_deinit(pid_file); -+ hostapd_global_deinit(); - os_free(pid_file); - - if (log_file) ---- a/hostapd/config_file.c -+++ b/hostapd/config_file.c -@@ -1947,6 +1947,8 @@ static int hostapd_config_fill(struct ho - } - #endif /* CONFIG_IEEE80211W */ - #ifdef CONFIG_IEEE80211N -+ } else if (os_strcmp(buf, "noscan") == 0) { -+ conf->noscan = atoi(pos); - } else if (os_strcmp(buf, "ieee80211n") == 0) { - conf->ieee80211n = atoi(pos); - } else if (os_strcmp(buf, "ht_capab") == 0) { ---- a/src/ap/ap_config.h -+++ b/src/ap/ap_config.h -@@ -430,6 +430,7 @@ struct hostapd_config { - - int ht_op_mode_fixed; - u16 ht_capab; -+ int noscan; - int ieee80211n; - int secondary_channel; - int require_ht; ---- a/src/ap/hw_features.c -+++ b/src/ap/hw_features.c -@@ -491,7 +491,7 @@ static int ieee80211n_check_40mhz(struct - { - struct wpa_driver_scan_params params; - -- if (!iface->conf->secondary_channel) -+ if (!iface->conf->secondary_channel || iface->conf->noscan) - return 0; /* HT40 not used */ - - wpa_printf(MSG_DEBUG, "Scan for neighboring BSSes prior to enabling " diff --git a/package/hostapd/patches/410-multicall.patch b/package/hostapd/patches/410-multicall.patch deleted file mode 100644 index b65376932..000000000 --- a/package/hostapd/patches/410-multicall.patch +++ /dev/null @@ -1,246 +0,0 @@ ---- a/hostapd/Makefile -+++ b/hostapd/Makefile -@@ -14,6 +14,7 @@ CFLAGS += -I../src/utils - # CFLAGS += -DUSE_KERNEL_HEADERS -I/usr/src/linux/include - - -include .config -+-include $(if $(MULTICALL), ../wpa_supplicant/.config) - - ifndef CONFIG_OS - ifdef CONFIG_NATIVE_WINDOWS -@@ -168,10 +169,14 @@ ifdef CONFIG_IEEE80211N - CFLAGS += -DCONFIG_IEEE80211N - endif - -+ifndef MULTICALL -+CFLAGS += -DNO_SUPPLICANT -+endif -+ - include ../src/drivers/drivers.mak --OBJS += $(DRV_AP_OBJS) --CFLAGS += $(DRV_AP_CFLAGS) --LDFLAGS += $(DRV_AP_LDFLAGS) -+OBJS += $(sort $(DRV_AP_OBJS) $(if $(MULTICALL),$(DRV_WPA_OBJS))) -+CFLAGS += $(DRV_AP_CFLAGS) $(if $(MULTICALL),$(DRV_WPA_CFLAGS)) -+LDFLAGS += $(DRV_AP_LDFLAGS) $(if $(MULTICALL),$(DRV_WPA_LDFLAGS)) - LIBS += $(DRV_AP_LIBS) - - ifdef CONFIG_L2_PACKET -@@ -815,6 +820,12 @@ install: all - - BCHECK=../src/drivers/build.hostapd - -+hostapd_multi.a: $(BCHECK) $(OBJS) -+ $(Q)$(CC) -c -o hostapd_multi.o -Dmain=hostapd_main $(CFLAGS) main.c -+ @$(E) " CC " $< -+ @rm -f $@ -+ @$(AR) cr $@ hostapd_multi.o $(OBJS) -+ - hostapd: $(BCHECK) $(OBJS) - $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) - @$(E) " LD " $@ -@@ -853,6 +864,12 @@ HOBJS += ../src/crypto/aes-internal.o - HOBJS += ../src/crypto/aes-internal-enc.o - endif - -+dump_cflags: -+ @echo -n $(CFLAGS) " " -+ -+dump_ldflags: -+ @echo -n $(LDFLAGS) $(LIBS) $(EXTRALIBS) " " -+ - nt_password_hash: $(NOBJS) - $(Q)$(CC) $(LDFLAGS) -o nt_password_hash $(NOBJS) $(LIBS_n) - @$(E) " LD " $@ ---- a/wpa_supplicant/Makefile -+++ b/wpa_supplicant/Makefile -@@ -14,6 +14,7 @@ CFLAGS += -I../src - CFLAGS += -I../src/utils - - -include .config -+-include $(if $(MULTICALL),../hostapd/.config) - - BINALL=wpa_supplicant wpa_cli - -@@ -673,6 +674,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS - CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS - LIBS += -ldl -rdynamic - endif -+else -+ ifdef MULTICALL -+ OBJS += ../src/eap_common/eap_common.o -+ endif - endif - - ifdef CONFIG_AP -@@ -681,9 +686,11 @@ NEED_EAP_COMMON=y - NEED_RSN_AUTHENTICATOR=y - CFLAGS += -DCONFIG_AP - OBJS += ap.o -+ifndef MULTICALL - CFLAGS += -DCONFIG_NO_RADIUS - CFLAGS += -DCONFIG_NO_ACCOUNTING - CFLAGS += -DCONFIG_NO_VLAN -+endif - OBJS += ../src/ap/hostapd.o - OBJS += ../src/ap/wpa_auth_glue.o - OBJS += ../src/ap/utils.o -@@ -731,10 +738,18 @@ endif - ifdef CONFIG_INTERWORKING - OBJS += ../src/ap/gas_serv.o - endif -+else -+ ifdef MULTICALL -+ OBJS += ../src/eap_server/eap_server.o -+ OBJS += ../src/eap_server/eap_server_identity.o -+ OBJS += ../src/eap_server/eap_server_methods.o -+ endif - endif - - ifdef NEED_RSN_AUTHENTICATOR -+ifndef MULTICALL - CFLAGS += -DCONFIG_NO_RADIUS -+endif - NEED_AES_WRAP=y - OBJS += ../src/ap/wpa_auth.o - OBJS += ../src/ap/wpa_auth_ie.o -@@ -1419,6 +1434,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) - - $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config - -+wpa_supplicant_multi.a: .config $(BCHECK) $(OBJS) $(EXTRA_progs) -+ $(Q)$(CC) -c -o wpa_supplicant_multi.o -Dmain=wpa_supplicant_main $(CFLAGS) main.c -+ @$(E) " CC " $< -+ @rm -f $@ -+ @$(AR) cr $@ wpa_supplicant_multi.o $(OBJS) -+ - wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) - $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) - @$(E) " LD " $@ -@@ -1485,6 +1506,12 @@ eap_ikev2.so: ../src/eap_peer/eap_ikev2. - %@.service: %.service.arg.in - sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@ - -+dump_cflags: -+ @echo -n $(CFLAGS) " " -+ -+dump_ldflags: -+ @echo -n $(LDFLAGS) $(LIBS) $(EXTRALIBS) " " -+ - wpa_supplicant.exe: wpa_supplicant - mv -f $< $@ - wpa_cli.exe: wpa_cli ---- a/src/drivers/driver.h -+++ b/src/drivers/driver.h -@@ -3572,8 +3572,8 @@ union wpa_event_data { - * Driver wrapper code should call this function whenever an event is received - * from the driver. - */ --void wpa_supplicant_event(void *ctx, enum wpa_event_type event, -- union wpa_event_data *data); -+extern void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event, -+ union wpa_event_data *data); - - - /* ---- a/src/ap/drv_callbacks.c -+++ b/src/ap/drv_callbacks.c -@@ -467,8 +467,8 @@ static void hostapd_event_eapol_rx(struc - } - - --void wpa_supplicant_event(void *ctx, enum wpa_event_type event, -- union wpa_event_data *data) -+void hostapd_wpa_event(void *ctx, enum wpa_event_type event, -+ union wpa_event_data *data) - { - struct hostapd_data *hapd = ctx; - #ifndef CONFIG_NO_STDOUT_DEBUG ---- a/wpa_supplicant/wpa_priv.c -+++ b/wpa_supplicant/wpa_priv.c -@@ -819,8 +819,8 @@ static void wpa_priv_send_ft_response(st - } - - --void wpa_supplicant_event(void *ctx, enum wpa_event_type event, -- union wpa_event_data *data) -+static void supplicant_event(void *ctx, enum wpa_event_type event, -+ union wpa_event_data *data) - { - struct wpa_priv_interface *iface = ctx; - -@@ -962,6 +962,7 @@ int main(int argc, char *argv[]) - if (os_program_init()) - return -1; - -+ wpa_supplicant_event = supplicant_event; - wpa_priv_fd_workaround(); - - for (;;) { ---- a/wpa_supplicant/events.c -+++ b/wpa_supplicant/events.c -@@ -2046,8 +2046,8 @@ static void wnm_action_rx(struct wpa_sup - } - - --void wpa_supplicant_event(void *ctx, enum wpa_event_type event, -- union wpa_event_data *data) -+void supplicant_event(void *ctx, enum wpa_event_type event, -+ union wpa_event_data *data) - { - struct wpa_supplicant *wpa_s = ctx; - u16 reason_code = 0; ---- a/wpa_supplicant/wpa_supplicant.c -+++ b/wpa_supplicant/wpa_supplicant.c -@@ -2704,6 +2704,9 @@ static void wpa_supplicant_deinit_iface( - } - } - -+extern void supplicant_event(void *ctx, enum wpa_event_type event, -+ union wpa_event_data *data); -+ - - /** - * wpa_supplicant_add_iface - Add a new network interface -@@ -2895,6 +2898,7 @@ struct wpa_global * wpa_supplicant_init( - wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb); - #endif /* CONFIG_NO_WPA_MSG */ - -+ wpa_supplicant_event = supplicant_event; - wpa_debug_open_file(params->wpa_debug_file_path); - if (params->wpa_debug_syslog) - wpa_debug_open_syslog(); ---- a/hostapd/main.c -+++ b/hostapd/main.c -@@ -533,6 +533,9 @@ static const char * hostapd_msg_ifname_c - return NULL; - } - -+void hostapd_wpa_event(void *ctx, enum wpa_event_type event, -+ union wpa_event_data *data); -+ - - int main(int argc, char *argv[]) - { -@@ -546,6 +549,7 @@ int main(int argc, char *argv[]) - if (os_program_init()) - return -1; - -+ wpa_supplicant_event = hostapd_wpa_event; - for (;;) { - c = getopt(argc, argv, "Bde:f:hKP:tv"); - if (c < 0) ---- a/src/drivers/drivers.c -+++ b/src/drivers/drivers.c -@@ -7,7 +7,11 @@ - */ - - #include "includes.h" -+#include "common.h" -+#include "driver.h" - -+void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event, -+ union wpa_event_data *data); - - #ifdef CONFIG_DRIVER_WEXT - extern struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */ diff --git a/package/hostapd/patches/420-timestamp_check.patch b/package/hostapd/patches/420-timestamp_check.patch deleted file mode 100644 index b2d4a0511..000000000 --- a/package/hostapd/patches/420-timestamp_check.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/src/tls/x509v3.c -+++ b/src/tls/x509v3.c -@@ -1848,6 +1848,9 @@ int x509_certificate_chain_validate(stru - if (chain_trusted) - continue; - -+#ifdef NO_TIMESTAMP_CHECK -+ disable_time_checks = 1; -+#endif - if (!disable_time_checks && - ((unsigned long) now.sec < - (unsigned long) cert->not_before || diff --git a/package/hostapd/patches/430-rescan_immediately.patch b/package/hostapd/patches/430-rescan_immediately.patch deleted file mode 100644 index 5332c9cea..000000000 --- a/package/hostapd/patches/430-rescan_immediately.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/wpa_supplicant/wpa_supplicant.c -+++ b/wpa_supplicant/wpa_supplicant.c -@@ -2215,7 +2215,7 @@ static struct wpa_supplicant * wpa_suppl - if (wpa_s == NULL) - return NULL; - wpa_s->scan_req = 1; -- wpa_s->scan_interval = 5; -+ wpa_s->scan_interval = 1; - wpa_s->new_connection = 1; - wpa_s->parent = wpa_s; - wpa_s->sched_scanning = 0; diff --git a/package/hostapd/patches/440-optional_rfkill.patch b/package/hostapd/patches/440-optional_rfkill.patch deleted file mode 100644 index e7b172944..000000000 --- a/package/hostapd/patches/440-optional_rfkill.patch +++ /dev/null @@ -1,261 +0,0 @@ ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -212,7 +212,9 @@ struct wpa_driver_nl80211_data { - int if_removed; - int if_disabled; - int ignore_if_down_event; -+#ifdef CONFIG_RFKILL - struct rfkill_data *rfkill; -+#endif - struct wpa_driver_capa capa; - int has_capability; - -@@ -2768,7 +2770,7 @@ static int wpa_driver_nl80211_init_nl(st - return 0; - } - -- -+#ifdef CONFIG_RFKILL - static void wpa_driver_nl80211_rfkill_blocked(void *ctx) - { - wpa_printf(MSG_DEBUG, "nl80211: RFKILL blocked"); -@@ -2791,6 +2793,7 @@ static void wpa_driver_nl80211_rfkill_un - } - /* rtnetlink ifup handler will report interface as enabled */ - } -+#endif /* CONFIG_RFKILL */ - - - static void nl80211_get_phy_name(struct wpa_driver_nl80211_data *drv) -@@ -2922,7 +2925,9 @@ static void * wpa_driver_nl80211_init(vo - void *global_priv) - { - struct wpa_driver_nl80211_data *drv; -+#ifdef CONFIG_RFKILL - struct rfkill_config *rcfg; -+#endif - struct i802_bss *bss; - - if (global_priv == NULL) -@@ -2956,6 +2961,7 @@ static void * wpa_driver_nl80211_init(vo - - nl80211_get_phy_name(drv); - -+#ifdef CONFIG_RFKILL - rcfg = os_zalloc(sizeof(*rcfg)); - if (rcfg == NULL) - goto failed; -@@ -2968,6 +2974,7 @@ static void * wpa_driver_nl80211_init(vo - wpa_printf(MSG_DEBUG, "nl80211: RFKILL status not available"); - os_free(rcfg); - } -+#endif /* CONFIG_RFKILL */ - - if (wpa_driver_nl80211_finish_drv_init(drv)) - goto failed; -@@ -3254,10 +3261,12 @@ static void nl80211_mgmt_unsubscribe(str - } - - -+#ifdef CONFIG_RFKILL - static void wpa_driver_nl80211_send_rfkill(void *eloop_ctx, void *timeout_ctx) - { - wpa_supplicant_event(timeout_ctx, EVENT_INTERFACE_DISABLED, NULL); - } -+#endif /* CONFIG_RFKILL */ - - static int - wpa_driver_nl80211_finish_drv_init_sta(struct wpa_driver_nl80211_data *drv, -@@ -3278,13 +3287,16 @@ wpa_driver_nl80211_finish_drv_init_sta(s - } - - if (linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 1)) { -+#ifdef CONFIG_RFKILL - if (rfkill_is_blocked(drv->rfkill)) { - wpa_printf(MSG_DEBUG, "nl80211: Could not yet enable " - "interface '%s' due to rfkill", - bss->ifname); - drv->if_disabled = 1; - *send_rfkill_event = 1; -- } else { -+ } else -+#endif -+ { - wpa_printf(MSG_ERROR, "nl80211: Could not set " - "interface '%s' UP", bss->ifname); - return -1; -@@ -3315,8 +3327,10 @@ wpa_driver_nl80211_finish_drv_init(struc - return -1; - - if (send_rfkill_event) { -+#ifdef CONFIG_RFKILL - eloop_register_timeout(0, 0, wpa_driver_nl80211_send_rfkill, - drv, drv->ctx); -+#endif - } - - return 0; -@@ -3403,7 +3417,9 @@ static void wpa_driver_nl80211_deinit(vo - - netlink_send_oper_ifla(drv->global->netlink, drv->ifindex, 0, - IF_OPER_UP); -+#ifdef CONFIG_RFKILL - rfkill_deinit(drv->rfkill); -+#endif - - eloop_cancel_timeout(wpa_driver_nl80211_scan_timeout, drv, drv->ctx); - ---- a/src/drivers/driver_wext.c -+++ b/src/drivers/driver_wext.c -@@ -742,7 +742,7 @@ static void wpa_driver_wext_event_rtm_de - } - } - -- -+#ifdef CONFIG_RFKILL - static void wpa_driver_wext_rfkill_blocked(void *ctx) - { - wpa_printf(MSG_DEBUG, "WEXT: RFKILL blocked"); -@@ -764,7 +764,7 @@ static void wpa_driver_wext_rfkill_unblo - } - /* rtnetlink ifup handler will report interface as enabled */ - } -- -+#endif /* CONFIG_RFKILL */ - - static void wext_get_phy_name(struct wpa_driver_wext_data *drv) - { -@@ -810,7 +810,9 @@ void * wpa_driver_wext_init(void *ctx, c - { - struct wpa_driver_wext_data *drv; - struct netlink_config *cfg; -+#ifdef CONFIG_RFKILL - struct rfkill_config *rcfg; -+#endif - char path[128]; - struct stat buf; - -@@ -845,6 +847,7 @@ void * wpa_driver_wext_init(void *ctx, c - goto err2; - } - -+#ifdef CONFIG_RFKILL - rcfg = os_zalloc(sizeof(*rcfg)); - if (rcfg == NULL) - goto err3; -@@ -857,6 +860,7 @@ void * wpa_driver_wext_init(void *ctx, c - wpa_printf(MSG_DEBUG, "WEXT: RFKILL status not available"); - os_free(rcfg); - } -+#endif /* CONFIG_RFKILL */ - - drv->mlme_sock = -1; - -@@ -874,7 +878,9 @@ void * wpa_driver_wext_init(void *ctx, c - return drv; - - err3: -+#ifdef CONFIG_RFKILL - rfkill_deinit(drv->rfkill); -+#endif - netlink_deinit(drv->netlink); - err2: - close(drv->ioctl_sock); -@@ -884,10 +890,12 @@ err1: - } - - -+#ifdef CONFIG_RFKILL - static void wpa_driver_wext_send_rfkill(void *eloop_ctx, void *timeout_ctx) - { - wpa_supplicant_event(timeout_ctx, EVENT_INTERFACE_DISABLED, NULL); - } -+#endif /* CONFIG_RFKILL */ - - - static int wpa_driver_wext_finish_drv_init(struct wpa_driver_wext_data *drv) -@@ -895,13 +903,16 @@ static int wpa_driver_wext_finish_drv_in - int send_rfkill_event = 0; - - if (linux_set_iface_flags(drv->ioctl_sock, drv->ifname, 1) < 0) { -+#ifdef CONFIG_RFKILL - if (rfkill_is_blocked(drv->rfkill)) { - wpa_printf(MSG_DEBUG, "WEXT: Could not yet enable " - "interface '%s' due to rfkill", - drv->ifname); - drv->if_disabled = 1; - send_rfkill_event = 1; -- } else { -+ } else -+#endif -+ { - wpa_printf(MSG_ERROR, "WEXT: Could not set " - "interface '%s' UP", drv->ifname); - return -1; -@@ -949,8 +960,10 @@ static int wpa_driver_wext_finish_drv_in - 1, IF_OPER_DORMANT); - - if (send_rfkill_event) { -+#ifdef CONFIG_RFKILL - eloop_register_timeout(0, 0, wpa_driver_wext_send_rfkill, - drv, drv->ctx); -+#endif - } - - return 0; -@@ -980,7 +993,9 @@ void wpa_driver_wext_deinit(void *priv) - - netlink_send_oper_ifla(drv->netlink, drv->ifindex, 0, IF_OPER_UP); - netlink_deinit(drv->netlink); -+#ifdef CONFIG_RFKILL - rfkill_deinit(drv->rfkill); -+#endif - - if (drv->mlme_sock >= 0) - eloop_unregister_read_sock(drv->mlme_sock); ---- a/src/drivers/drivers.mak -+++ b/src/drivers/drivers.mak -@@ -25,7 +25,6 @@ NEED_SME=y - NEED_AP_MLME=y - NEED_NETLINK=y - NEED_LINUX_IOCTL=y --NEED_RFKILL=y - - ifdef CONFIG_LIBNL32 - DRV_LIBS += -lnl-3 -@@ -101,7 +100,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT - CONFIG_WIRELESS_EXTENSION=y - NEED_NETLINK=y - NEED_LINUX_IOCTL=y --NEED_RFKILL=y - endif - - ifdef CONFIG_DRIVER_NDIS -@@ -127,7 +125,6 @@ endif - ifdef CONFIG_WIRELESS_EXTENSION - DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION - DRV_WPA_OBJS += ../src/drivers/driver_wext.o --NEED_RFKILL=y - endif - - ifdef NEED_NETLINK -@@ -140,6 +137,7 @@ endif - - ifdef NEED_RFKILL - DRV_OBJS += ../src/drivers/rfkill.o -+DRV_WPA_CFLAGS += -DCONFIG_RFKILL - endif - - ---- a/src/drivers/driver_wext.h -+++ b/src/drivers/driver_wext.h -@@ -22,7 +22,9 @@ struct wpa_driver_wext_data { - int ifindex2; - int if_removed; - int if_disabled; -+#ifdef CONFIG_RFKILL - struct rfkill_data *rfkill; -+#endif - u8 *assoc_req_ies; - size_t assoc_req_ies_len; - u8 *assoc_resp_ies; diff --git a/package/hostapd/patches/450-reload_freq_change.patch b/package/hostapd/patches/450-reload_freq_change.patch deleted file mode 100644 index 9245860d1..000000000 --- a/package/hostapd/patches/450-reload_freq_change.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- a/src/ap/hostapd.c -+++ b/src/ap/hostapd.c -@@ -137,6 +137,20 @@ int hostapd_reload_config(struct hostapd - oldconf = hapd->iconf; - iface->conf = newconf; - -+ hostapd_select_hw_mode(iface); -+ iface->freq = hostapd_hw_get_freq(hapd, newconf->channel); -+ -+ if (hostapd_set_freq(hapd, newconf->hw_mode, iface->freq, -+ newconf->channel, -+ newconf->ieee80211n, -+ newconf->secondary_channel)) { -+ wpa_printf(MSG_ERROR, "Could not set channel for " -+ "kernel driver"); -+ } -+ -+ if (iface->current_mode) -+ hostapd_prepare_rates(iface, iface->current_mode); -+ - for (j = 0; j < iface->num_bss; j++) { - hapd = iface->bss[j]; - hapd->iconf = newconf; diff --git a/package/hostapd/patches/451-nl80211_del_beacon_bss.patch b/package/hostapd/patches/451-nl80211_del_beacon_bss.patch deleted file mode 100644 index 9f0eae3bd..000000000 --- a/package/hostapd/patches/451-nl80211_del_beacon_bss.patch +++ /dev/null @@ -1,63 +0,0 @@ ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -3337,16 +3337,18 @@ wpa_driver_nl80211_finish_drv_init(struc - } - - --static int wpa_driver_nl80211_del_beacon(struct wpa_driver_nl80211_data *drv) -+static int wpa_driver_nl80211_del_bss_beacon(struct i802_bss *bss) - { -+ struct wpa_driver_nl80211_data *drv = bss->drv; - struct nl_msg *msg; - -+ bss->beacon_set = 0; - msg = nlmsg_alloc(); - if (!msg) - return -ENOMEM; - - nl80211_cmd(drv, msg, 0, NL80211_CMD_DEL_BEACON); -- NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, drv->ifindex); -+ NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, bss->ifindex); - - return send_and_recv_msgs(drv, msg, NULL, NULL); - nla_put_failure: -@@ -3354,6 +3356,21 @@ static int wpa_driver_nl80211_del_beacon - return -ENOBUFS; - } - -+static int wpa_driver_nl80211_del_beacon(struct wpa_driver_nl80211_data *drv) -+{ -+ struct i802_bss *bss; -+ -+ for (bss = &drv->first_bss; bss; bss = bss->next) -+ wpa_driver_nl80211_del_bss_beacon(bss); -+ -+ return 0; -+} -+ -+static int wpa_driver_nl80211_stop_ap(void *priv) -+{ -+ struct i802_bss *bss = priv; -+ return wpa_driver_nl80211_del_beacon(bss->drv); -+} - - /** - * wpa_driver_nl80211_deinit - Deinitialize nl80211 driver interface -@@ -9099,4 +9116,5 @@ const struct wpa_driver_ops wpa_driver_n - .send_tdls_mgmt = nl80211_send_tdls_mgmt, - .tdls_oper = nl80211_tdls_oper, - #endif /* CONFIG_TDLS */ -+ .stop_ap = wpa_driver_nl80211_stop_ap, - }; ---- a/src/drivers/driver.h -+++ b/src/drivers/driver.h -@@ -2007,6 +2007,9 @@ struct wpa_driver_ops { - */ - int (*probe_req_report)(void *priv, int report); - -+ -+ int (*stop_ap)(void *priv); -+ - /** - * deinit_ap - Deinitialize AP mode - * @priv: Private driver interface data 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 c0617eb75..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 -@@ -33,6 +33,7 @@ - #include "wps/wps.h" - #include "config_file.h" - #include "ctrl_iface.h" -+#include "config_file.h" - - - struct wpa_ctrl_dst { -@@ -43,6 +44,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); -@@ -152,6 +154,66 @@ static int hostapd_ctrl_iface_new_sta(st - return 0; - } - -+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, "hw_mode="))) -+ 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; -+} - - #ifdef CONFIG_IEEE80211W - #ifdef NEED_AP_MLME -@@ -710,6 +772,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); diff --git a/package/hostapd/patches/453-ap_sta_support.patch b/package/hostapd/patches/453-ap_sta_support.patch deleted file mode 100644 index 795bead50..000000000 --- a/package/hostapd/patches/453-ap_sta_support.patch +++ /dev/null @@ -1,221 +0,0 @@ ---- a/wpa_supplicant/wpa_supplicant_i.h -+++ b/wpa_supplicant/wpa_supplicant_i.h -@@ -95,6 +95,8 @@ struct wpa_interface { - * receiving of EAPOL frames from an additional interface. - */ - const char *bridge_ifname; -+ -+ const char *hostapd_ctrl; - }; - - /** -@@ -271,6 +273,8 @@ struct wpa_supplicant { - #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */ - char bridge_ifname[16]; - -+ struct wpa_ctrl *hostapd; -+ - char *confname; - struct wpa_config *conf; - int countermeasures; ---- a/wpa_supplicant/Makefile -+++ b/wpa_supplicant/Makefile -@@ -13,6 +13,10 @@ PKG_CONFIG ?= pkg-config - CFLAGS += -I../src - CFLAGS += -I../src/utils - -+ifdef MULTICALL -+CFLAGS += -DMULTICALL -+endif -+ - -include .config - -include $(if $(MULTICALL),../hostapd/.config) - -@@ -71,6 +75,10 @@ OBJS_c = wpa_cli.o ../src/common/wpa_ctr - OBJS_c += ../src/utils/wpa_debug.o - OBJS_c += ../src/utils/common.o - -+ifdef MULTICALL -+OBJS += ../src/common/wpa_ctrl.o -+endif -+ - ifndef CONFIG_OS - ifdef CONFIG_NATIVE_WINDOWS - CONFIG_OS=win32 ---- a/wpa_supplicant/wpa_supplicant.c -+++ b/wpa_supplicant/wpa_supplicant.c -@@ -103,6 +103,55 @@ extern int wpa_debug_show_keys; - extern int wpa_debug_timestamp; - extern struct wpa_driver_ops *wpa_drivers[]; - -+#ifdef MULTICALL -+static int hostapd_stop(struct wpa_supplicant *wpa_s) -+{ -+ const char *cmd = "DOWN"; -+ char buf[256]; -+ int len = sizeof(buf); -+ -+ if (wpa_ctrl_request(wpa_s->hostapd, cmd, os_strlen(cmd), buf, &len, NULL) < 0) { -+ wpa_printf(MSG_ERROR, "\nFailed to stop hostapd AP interfaces\n"); -+ return -1; -+ } -+ return 0; -+} -+ -+static int hostapd_reload(struct wpa_supplicant *wpa_s, struct wpa_bss *bss) -+{ -+ char *cmd = NULL; -+ char buf[256]; -+ int len = sizeof(buf); -+ int channel, hw_mode; -+ int ret; -+ -+ if (!bss) -+ return; -+ -+ if (bss->freq < 4000) { -+ hw_mode = HOSTAPD_MODE_IEEE80211G; -+ channel = (bss->freq - 2407) / 5; -+ } else { -+ hw_mode = HOSTAPD_MODE_IEEE80211A; -+ channel = (bss->freq - 5000) / 5; -+ } -+ -+ if (asprintf(&cmd, "RELOAD channel=%d sec_chan=0 hw_mode=%d ieee80211n=%d", -+ channel, hw_mode, !!bss->ht_capab) < 0) { -+ return -1; -+ } -+ -+ ret = wpa_ctrl_request(wpa_s->hostapd, cmd, os_strlen(cmd), buf, &len, NULL); -+ free(cmd); -+ -+ if (ret < 0) { -+ wpa_printf(MSG_ERROR, "\nFailed to reload hostapd AP interfaces\n"); -+ return -1; -+ } -+ return 0; -+} -+#endif -+ - /* Configure default/group WEP keys for static WEP */ - int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) - { -@@ -607,8 +656,16 @@ void wpa_supplicant_set_state(struct wpa - #ifdef CONFIG_P2P - wpas_p2p_completed(wpa_s); - #endif /* CONFIG_P2P */ -+#ifdef MULTICALL -+ if (wpa_s->hostapd) -+ hostapd_reload(wpa_s, wpa_s->current_bss); -+#endif - } else if (state == WPA_DISCONNECTED || state == WPA_ASSOCIATING || - state == WPA_ASSOCIATED) { -+#ifdef MULTICALL -+ if (wpa_s->hostapd) -+ hostapd_stop(wpa_s); -+#endif - wpa_s->new_connection = 1; - wpa_drv_set_operstate(wpa_s, 0); - #ifndef IEEE8021X_EAPOL -@@ -2522,6 +2579,21 @@ static int wpa_supplicant_init_iface(str - os_strlcpy(wpa_s->bridge_ifname, iface->bridge_ifname, - sizeof(wpa_s->bridge_ifname)); - } -+#ifdef MULTICALL -+ if (iface->hostapd_ctrl) { -+ char *cmd = "DOWN"; -+ char buf[256]; -+ int len = sizeof(buf); -+ -+ wpa_s->hostapd = wpa_ctrl_open(iface->hostapd_ctrl); -+ if (!wpa_s->hostapd) { -+ wpa_printf(MSG_ERROR, "\nFailed to connect to hostapd\n"); -+ return -1; -+ } -+ if (hostapd_stop(wpa_s) < 0) -+ return -1; -+ } -+#endif - - /* RSNA Supplicant Key Management - INITIALIZE */ - eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE); ---- a/wpa_supplicant/bss.c -+++ b/wpa_supplicant/bss.c -@@ -11,6 +11,7 @@ - #include "utils/common.h" - #include "utils/eloop.h" - #include "common/ieee802_11_defs.h" -+#include "common/ieee802_11_common.h" - #include "drivers/driver.h" - #include "wpa_supplicant_i.h" - #include "config.h" -@@ -75,6 +76,8 @@ struct wpa_bss * wpa_bss_get(struct wpa_ - - static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src) - { -+ struct ieee80211_ht_capabilities *capab; -+ struct ieee802_11_elems elems; - os_time_t usec; - - dst->flags = src->flags; -@@ -87,6 +90,12 @@ static void wpa_bss_copy_res(struct wpa_ - dst->level = src->level; - dst->tsf = src->tsf; - -+ memset(&elems, 0, sizeof(elems)); -+ ieee802_11_parse_elems((u8 *) (src + 1), src->ie_len, &elems, 0); -+ capab = (struct ieee80211_ht_capabilities *) elems.ht_capabilities; -+ if (capab) -+ dst->ht_capab = le_to_host16(capab->ht_capabilities_info); -+ - os_get_time(&dst->last_update); - dst->last_update.sec -= src->age / 1000; - usec = (src->age % 1000) * 1000; ---- a/wpa_supplicant/bss.h -+++ b/wpa_supplicant/bss.h -@@ -51,6 +51,7 @@ struct wpa_bss { - unsigned int flags; - u8 bssid[ETH_ALEN]; - u8 ssid[32]; -+ u16 ht_capab; - size_t ssid_len; - int freq; - u16 beacon_int; ---- a/wpa_supplicant/main.c -+++ b/wpa_supplicant/main.c -@@ -25,7 +25,7 @@ static void usage(void) - "usage:\n" - " wpa_supplicant [-BddhKLqqstuvW] [-P<pid file>] " - "[-g<global ctrl>] \\\n" -- " -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] " -+ " -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] [-H<hostapd path>]" - "[-p<driver_param>] \\\n" - " [-b<br_ifname>] [-f<debug file>] [-e<entropy file>] " - "\\\n" -@@ -67,6 +67,7 @@ static void usage(void) - #endif /* CONFIG_DEBUG_LINUX_TRACING */ - printf(" -t = include timestamp in debug messages\n" - " -h = show this help text\n" -+ " -H = connect to a hostapd instance to manage state changes\n" - " -L = show license (BSD)\n" - " -o = override driver parameter for new interfaces\n" - " -O = override ctrl_interface parameter for new interfaces\n" -@@ -144,7 +145,7 @@ int main(int argc, char *argv[]) - - for (;;) { - c = getopt(argc, argv, -- "b:Bc:C:D:de:f:g:hi:KLNo:O:p:P:qsTtuvW"); -+ "b:Bc:C:D:de:f:g:hH:i:KLNo:O:p:P:qsTtuvW"); - if (c < 0) - break; - switch (c) { -@@ -188,6 +189,9 @@ int main(int argc, char *argv[]) - usage(); - exitcode = 0; - goto out; -+ case 'H': -+ iface->hostapd_ctrl = optarg; -+ break; - case 'i': - iface->ifname = optarg; - break; diff --git a/package/hostapd/patches/460-disable_ctrl_iface_mib.patch b/package/hostapd/patches/460-disable_ctrl_iface_mib.patch deleted file mode 100644 index b6b9182f5..000000000 --- a/package/hostapd/patches/460-disable_ctrl_iface_mib.patch +++ /dev/null @@ -1,168 +0,0 @@ ---- a/hostapd/Makefile -+++ b/hostapd/Makefile -@@ -128,6 +128,9 @@ endif - ifdef CONFIG_NO_CTRL_IFACE - CFLAGS += -DCONFIG_NO_CTRL_IFACE - else -+ifdef CONFIG_CTRL_IFACE_MIB -+CFLAGS += -DCONFIG_CTRL_IFACE_MIB -+endif - OBJS += ctrl_iface.o - OBJS += ../src/ap/ctrl_iface_ap.o - endif ---- a/hostapd/ctrl_iface.c -+++ b/hostapd/ctrl_iface.c -@@ -743,6 +743,7 @@ static void hostapd_ctrl_iface_receive(i - } else if (os_strncmp(buf, "RELOG", 5) == 0) { - if (wpa_debug_reopen_file() < 0) - reply_len = -1; -+#ifdef CONFIG_CTRL_IFACE_MIB - } else if (os_strcmp(buf, "MIB") == 0) { - reply_len = ieee802_11_get_mib(hapd, reply, reply_size); - if (reply_len >= 0) { -@@ -772,10 +773,12 @@ static void hostapd_ctrl_iface_receive(i - reply_len += res; - } - #endif /* CONFIG_NO_RADIUS */ -+#endif - } 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); -+#ifdef CONFIG_CTRL_IFACE_MIB - } else if (os_strcmp(buf, "STA-FIRST") == 0) { - reply_len = hostapd_ctrl_iface_sta_first(hapd, reply, - reply_size); -@@ -785,6 +788,7 @@ static void hostapd_ctrl_iface_receive(i - } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { - reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply, - reply_size); -+#endif - } else if (os_strcmp(buf, "ATTACH") == 0) { - if (hostapd_ctrl_iface_attach(hapd, &from, fromlen)) - reply_len = -1; ---- a/wpa_supplicant/Makefile -+++ b/wpa_supplicant/Makefile -@@ -719,6 +719,9 @@ ifdef CONFIG_IEEE80211N - OBJS += ../src/ap/ieee802_11_ht.o - endif - ifdef CONFIG_CTRL_IFACE -+ifdef CONFIG_CTRL_IFACE_MIB -+CFLAGS += -DCONFIG_CTRL_IFACE_MIB -+endif - OBJS += ../src/ap/ctrl_iface_ap.o - endif - ---- a/wpa_supplicant/ctrl_iface.c -+++ b/wpa_supplicant/ctrl_iface.c -@@ -3770,6 +3770,7 @@ char * wpa_supplicant_ctrl_iface_process - reply_len = -1; - } else if (os_strncmp(buf, "NOTE ", 5) == 0) { - wpa_printf(MSG_INFO, "NOTE: %s", buf + 5); -+#ifdef CONFIG_CTRL_IFACE_MIB - } else if (os_strcmp(buf, "MIB") == 0) { - reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size); - if (reply_len >= 0) { -@@ -3781,6 +3782,7 @@ char * wpa_supplicant_ctrl_iface_process - else - reply_len += res; - } -+#endif - } else if (os_strncmp(buf, "STATUS", 6) == 0) { - reply_len = wpa_supplicant_ctrl_iface_status( - wpa_s, buf + 6, reply, reply_size); -@@ -4135,6 +4137,7 @@ char * wpa_supplicant_ctrl_iface_process - reply_len = wpa_supplicant_ctrl_iface_bss( - wpa_s, buf + 4, reply, reply_size); - #ifdef CONFIG_AP -+#ifdef CONFIG_CTRL_IFACE_MIB - } else if (os_strcmp(buf, "STA-FIRST") == 0) { - reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size); - } else if (os_strncmp(buf, "STA ", 4) == 0) { -@@ -4143,6 +4146,7 @@ char * wpa_supplicant_ctrl_iface_process - } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { - reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply, - reply_size); -+#endif - } else if (os_strncmp(buf, "DEAUTHENTICATE ", 15) == 0) { - if (ap_ctrl_iface_sta_deauthenticate(wpa_s, buf + 15)) - reply_len = -1; ---- a/src/ap/ctrl_iface_ap.c -+++ b/src/ap/ctrl_iface_ap.c -@@ -20,6 +20,7 @@ - #include "ctrl_iface_ap.h" - #include "ap_drv_ops.h" - -+#ifdef CONFIG_CTRL_IFACE_MIB - - static int hostapd_ctrl_iface_sta_mib(struct hostapd_data *hapd, - struct sta_info *sta, -@@ -103,6 +104,7 @@ int hostapd_ctrl_iface_sta_next(struct h - return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen); - } - -+#endif - - #ifdef CONFIG_P2P_MANAGER - static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype, -@@ -269,3 +271,4 @@ int hostapd_ctrl_iface_disassociate(stru - - return 0; - } -+ ---- a/src/ap/ieee802_1x.c -+++ b/src/ap/ieee802_1x.c -@@ -1922,6 +1922,7 @@ static const char * bool_txt(Boolean boo - return bool ? "TRUE" : "FALSE"; - } - -+#ifdef CONFIG_CTRL_IFACE_MIB - - int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen) - { -@@ -2074,6 +2075,7 @@ int ieee802_1x_get_mib_sta(struct hostap - return len; - } - -+#endif - - static void ieee802_1x_finished(struct hostapd_data *hapd, - struct sta_info *sta, int success) ---- a/src/ap/wpa_auth.c -+++ b/src/ap/wpa_auth.c -@@ -2638,6 +2638,7 @@ static int wpa_cipher_bits(int cipher) - } - } - -+#ifdef CONFIG_CTRL_IFACE_MIB - - #define RSN_SUITE "%02x-%02x-%02x-%d" - #define RSN_SUITE_ARG(s) \ -@@ -2801,7 +2802,7 @@ int wpa_get_mib_sta(struct wpa_state_mac - - return len; - } -- -+#endif - - void wpa_auth_countermeasures_start(struct wpa_authenticator *wpa_auth) - { ---- a/src/rsn_supp/wpa.c -+++ b/src/rsn_supp/wpa.c -@@ -1918,6 +1918,8 @@ static u32 wpa_cipher_suite(struct wpa_s - } - - -+#ifdef CONFIG_CTRL_IFACE_MIB -+ - #define RSN_SUITE "%02x-%02x-%02x-%d" - #define RSN_SUITE_ARG(s) \ - ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff -@@ -1997,6 +1999,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch - - return (int) len; - } -+#endif - #endif /* CONFIG_CTRL_IFACE */ - - diff --git a/package/hostapd/patches/470-wpa_ie_cap_workaround.patch b/package/hostapd/patches/470-wpa_ie_cap_workaround.patch deleted file mode 100644 index 1e6a44f3d..000000000 --- a/package/hostapd/patches/470-wpa_ie_cap_workaround.patch +++ /dev/null @@ -1,56 +0,0 @@ ---- a/src/common/wpa_common.c -+++ b/src/common/wpa_common.c -@@ -953,6 +953,31 @@ const char * wpa_key_mgmt_txt(int key_mg - } - - -+static void wpa_fixup_wpa_ie_rsn(u8 *assoc_ie, const u8 *wpa_msg_ie, -+ size_t rsn_ie_len) -+{ -+ int pos, count; -+ -+ pos = sizeof(struct rsn_ie_hdr) + RSN_SELECTOR_LEN; -+ if (rsn_ie_len < pos + 2) -+ return; -+ -+ count = WPA_GET_LE16(wpa_msg_ie + pos); -+ pos += 2 + count * RSN_SELECTOR_LEN; -+ if (rsn_ie_len < pos + 2) -+ return; -+ -+ count = WPA_GET_LE16(wpa_msg_ie + pos); -+ pos += 2 + count * RSN_SELECTOR_LEN; -+ if (rsn_ie_len < pos + 2) -+ return; -+ -+ if (!assoc_ie[pos] && !assoc_ie[pos + 1] && -+ (wpa_msg_ie[pos] || wpa_msg_ie[pos + 1])) -+ memcpy(&assoc_ie[pos], &wpa_msg_ie[pos], 2); -+} -+ -+ - int wpa_compare_rsn_ie(int ft_initial_assoc, - const u8 *ie1, size_t ie1len, - const u8 *ie2, size_t ie2len) -@@ -960,8 +985,19 @@ int wpa_compare_rsn_ie(int ft_initial_as - if (ie1 == NULL || ie2 == NULL) - return -1; - -- if (ie1len == ie2len && os_memcmp(ie1, ie2, ie1len) == 0) -- return 0; /* identical IEs */ -+ if (ie1len == ie2len) { -+ u8 *ie_tmp; -+ -+ if (os_memcmp(ie1, ie2, ie1len) == 0) -+ return 0; /* identical IEs */ -+ -+ ie_tmp = alloca(ie1len); -+ memcpy(ie_tmp, ie1, ie1len); -+ wpa_fixup_wpa_ie_rsn(ie_tmp, ie2, ie1len); -+ -+ if (os_memcmp(ie_tmp, ie2, ie1len) == 0) -+ return 0; /* only mismatch in RSN capabilties */ -+ } - - #ifdef CONFIG_IEEE80211R - if (ft_initial_assoc) { diff --git a/package/hostapd/patches/480-terminate_on_setup_failure.patch b/package/hostapd/patches/480-terminate_on_setup_failure.patch deleted file mode 100644 index 31ce3eb92..000000000 --- a/package/hostapd/patches/480-terminate_on_setup_failure.patch +++ /dev/null @@ -1,81 +0,0 @@ ---- a/src/ap/hostapd.c -+++ b/src/ap/hostapd.c -@@ -778,11 +778,8 @@ int hostapd_setup_interface_complete(str - size_t j; - u8 *prev_addr; - -- if (err) { -- wpa_printf(MSG_ERROR, "Interface initialization failed"); -- eloop_terminate(); -- return -1; -- } -+ if (err) -+ goto error; - - wpa_printf(MSG_DEBUG, "Completing interface initialization"); - if (hapd->iconf->channel) { -@@ -798,7 +795,7 @@ int hostapd_setup_interface_complete(str - hapd->iconf->secondary_channel)) { - wpa_printf(MSG_ERROR, "Could not set channel for " - "kernel driver"); -- return -1; -+ goto error; - } - } - -@@ -809,7 +806,7 @@ int hostapd_setup_interface_complete(str - hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, - HOSTAPD_LEVEL_WARNING, - "Failed to prepare rates table."); -- return -1; -+ goto error; - } - } - -@@ -817,14 +814,14 @@ int hostapd_setup_interface_complete(str - hostapd_set_rts(hapd, hapd->iconf->rts_threshold)) { - wpa_printf(MSG_ERROR, "Could not set RTS threshold for " - "kernel driver"); -- return -1; -+ goto error; - } - - if (hapd->iconf->fragm_threshold > -1 && - hostapd_set_frag(hapd, hapd->iconf->fragm_threshold)) { - wpa_printf(MSG_ERROR, "Could not set fragmentation threshold " - "for kernel driver"); -- return -1; -+ goto error; - } - - prev_addr = hapd->own_addr; -@@ -834,7 +831,7 @@ int hostapd_setup_interface_complete(str - if (j) - os_memcpy(hapd->own_addr, prev_addr, ETH_ALEN); - if (hostapd_setup_bss(hapd, j == 0)) -- return -1; -+ goto error; - if (hostapd_mac_comp_empty(hapd->conf->bssid) == 0) - prev_addr = hapd->own_addr; - } -@@ -846,7 +843,7 @@ int hostapd_setup_interface_complete(str - if (hostapd_driver_commit(hapd) < 0) { - wpa_printf(MSG_ERROR, "%s: Failed to commit driver " - "configuration", __func__); -- return -1; -+ goto error; - } - - /* -@@ -870,6 +867,11 @@ int hostapd_setup_interface_complete(str - iface->init_complete(iface); - - return 0; -+ -+error: -+ wpa_printf(MSG_ERROR, "Interface initialization failed"); -+ eloop_terminate(); -+ return -1; - } - - diff --git a/package/hostapd/patches/500-random_pool_add_kernel.patch b/package/hostapd/patches/500-random_pool_add_kernel.patch deleted file mode 100644 index 5ef8f47ad..000000000 --- a/package/hostapd/patches/500-random_pool_add_kernel.patch +++ /dev/null @@ -1,168 +0,0 @@ ---- a/src/crypto/random.c -+++ b/src/crypto/random.c -@@ -32,6 +32,8 @@ - #include "sha1.h" - #include "random.h" - -+#define RANDOM_STAMPFILE "/var/run/.random_available" -+ - #define POOL_WORDS 32 - #define POOL_WORDS_MASK (POOL_WORDS - 1) - #define POOL_TAP1 26 -@@ -42,6 +44,8 @@ - #define EXTRACT_LEN 16 - #define MIN_READY_MARK 2 - -+#ifndef CONFIG_NO_RANDOM_POOL -+ - static u32 pool[POOL_WORDS]; - static unsigned int input_rotate = 0; - static unsigned int pool_pos = 0; -@@ -122,7 +126,7 @@ static void random_extract(u8 *out) - } - - --void random_add_randomness(const void *buf, size_t len) -+static void random_pool_add_randomness(const void *buf, size_t len) - { - struct os_time t; - static unsigned int count = 0; -@@ -191,16 +195,22 @@ int random_get_bytes(void *buf, size_t l - int random_pool_ready(void) - { - #ifdef __linux__ -+ struct stat st; - int fd; - ssize_t res; - -+ if (stat(RANDOM_STAMPFILE, &st) == 0) -+ return 1; -+ - /* - * Make sure that there is reasonable entropy available before allowing - * some key derivation operations to proceed. - */ - -- if (dummy_key_avail == sizeof(dummy_key)) -+ if (dummy_key_avail == sizeof(dummy_key)) { -+ random_mark_pool_ready(); - return 1; /* Already initialized - good to continue */ -+ } - - /* - * Try to fetch some more data from the kernel high quality -@@ -235,6 +245,7 @@ int random_pool_ready(void) - if (dummy_key_avail == sizeof(dummy_key)) { - if (own_pool_ready < MIN_READY_MARK) - own_pool_ready = MIN_READY_MARK; -+ random_mark_pool_ready(); - random_write_entropy(); - return 1; - } -@@ -247,6 +258,7 @@ int random_pool_ready(void) - total_collected + 10 * own_pool_ready > MIN_COLLECT_ENTROPY) { - wpa_printf(MSG_INFO, "random: Allow operation to proceed " - "based on internal entropy"); -+ random_mark_pool_ready(); - return 1; - } - -@@ -262,10 +274,16 @@ int random_pool_ready(void) - - void random_mark_pool_ready(void) - { -+ int fd; -+ - own_pool_ready++; - wpa_printf(MSG_DEBUG, "random: Mark internal entropy pool to be " - "ready (count=%u/%u)", own_pool_ready, MIN_READY_MARK); - random_write_entropy(); -+ -+ fd = open(RANDOM_STAMPFILE, O_CREAT | O_WRONLY | O_EXCL | O_NOFOLLOW, 0600); -+ if (fd >= 0) -+ close(fd); - } - - -@@ -422,3 +440,22 @@ void random_deinit(void) - os_free(random_entropy_file); - random_entropy_file = NULL; - } -+ -+#endif /* CONFIG_NO_RANDOM_POOL */ -+ -+ -+void random_add_randomness(const void *buf, size_t len) -+{ -+#ifdef __linux__ -+ int fd; -+ -+ fd = open("/dev/random", O_RDWR); -+ if (fd >= 0) { -+ write(fd, buf, len); -+ close(fd); -+ } -+#endif -+#ifndef CONFIG_NO_RANDOM_POOL -+ random_pool_add_randomness(buf, len); -+#endif -+} ---- a/wpa_supplicant/Makefile -+++ b/wpa_supplicant/Makefile -@@ -1161,9 +1161,8 @@ endif - - ifdef CONFIG_NO_RANDOM_POOL - CFLAGS += -DCONFIG_NO_RANDOM_POOL --else --OBJS += ../src/crypto/random.o - endif -+OBJS += ../src/crypto/random.o - - ifdef CONFIG_CTRL_IFACE - ifeq ($(CONFIG_CTRL_IFACE), y) ---- a/wpa_supplicant/Android.mk -+++ b/wpa_supplicant/Android.mk -@@ -1139,9 +1139,8 @@ endif - - ifdef CONFIG_NO_RANDOM_POOL - L_CFLAGS += -DCONFIG_NO_RANDOM_POOL --else --OBJS += src/crypto/random.c - endif -+OBJS += src/crypto/random.c - - ifdef CONFIG_CTRL_IFACE - ifeq ($(CONFIG_CTRL_IFACE), y) ---- a/hostapd/Android.mk -+++ b/hostapd/Android.mk -@@ -724,11 +724,11 @@ endif - ifdef CONFIG_NO_RANDOM_POOL - L_CFLAGS += -DCONFIG_NO_RANDOM_POOL - else --OBJS += src/crypto/random.c --HOBJS += src/crypto/random.c - HOBJS += $(SHA1OBJS) - HOBJS += src/crypto/md5.c - endif -+OBJS += src/crypto/random.c -+HOBJS += src/crypto/random.c - - ifdef CONFIG_RADIUS_SERVER - L_CFLAGS += -DRADIUS_SERVER ---- a/hostapd/Makefile -+++ b/hostapd/Makefile -@@ -719,12 +719,12 @@ endif - ifdef CONFIG_NO_RANDOM_POOL - CFLAGS += -DCONFIG_NO_RANDOM_POOL - else --OBJS += ../src/crypto/random.o --HOBJS += ../src/crypto/random.o - HOBJS += ../src/utils/eloop.o - HOBJS += $(SHA1OBJS) - HOBJS += ../src/crypto/md5.o - endif -+OBJS += ../src/crypto/random.o -+HOBJS += ../src/crypto/random.o - - ifdef CONFIG_RADIUS_SERVER - CFLAGS += -DRADIUS_SERVER diff --git a/package/hostapd/patches/510-bring_down_interface.patch b/package/hostapd/patches/510-bring_down_interface.patch deleted file mode 100644 index da2131314..000000000 --- a/package/hostapd/patches/510-bring_down_interface.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -7026,8 +7026,6 @@ static int wpa_driver_nl80211_set_mode(s - ret = nl80211_set_mode(drv, drv->ifindex, nlmode); - if (ret == -EACCES) - break; -- res = linux_set_iface_flags(drv->global->ioctl_sock, -- bss->ifname, 1); - if (res && !ret) - ret = -1; - else if (ret != -EBUSY) -@@ -7043,6 +7041,7 @@ static int wpa_driver_nl80211_set_mode(s - "interface is down"); - drv->nlmode = nlmode; - drv->ignore_if_down_event = 1; -+ linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 1); - } - - done: diff --git a/package/hostapd/patches/520-fix_wps_pin_crash.patch b/package/hostapd/patches/520-fix_wps_pin_crash.patch deleted file mode 100644 index df1e3d031..000000000 --- a/package/hostapd/patches/520-fix_wps_pin_crash.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/hostapd/ctrl_iface.c -+++ b/hostapd/ctrl_iface.c -@@ -343,6 +343,9 @@ static int hostapd_ctrl_iface_wps_ap_pin - char *pos; - const char *pin_txt; - -+ if (!hapd->wps) -+ return -1; -+ - pos = os_strchr(txt, ' '); - if (pos) - *pos++ = '\0'; diff --git a/package/hostapd/patches/530-wps_single_auth_enc_type.patch b/package/hostapd/patches/530-wps_single_auth_enc_type.patch deleted file mode 100644 index c6477a354..000000000 --- a/package/hostapd/patches/530-wps_single_auth_enc_type.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- a/src/ap/wps_hostapd.c -+++ b/src/ap/wps_hostapd.c -@@ -856,11 +856,9 @@ int hostapd_init_wps(struct hostapd_data - - if (conf->rsn_pairwise & WPA_CIPHER_CCMP) - wps->encr_types |= WPS_ENCR_AES; -- if (conf->rsn_pairwise & WPA_CIPHER_TKIP) -+ else if (conf->rsn_pairwise & WPA_CIPHER_TKIP) - wps->encr_types |= WPS_ENCR_TKIP; -- } -- -- if (conf->wpa & WPA_PROTO_WPA) { -+ } else if (conf->wpa & WPA_PROTO_WPA) { - if (conf->wpa_key_mgmt & WPA_KEY_MGMT_PSK) - wps->auth_types |= WPS_AUTH_WPAPSK; - if (conf->wpa_key_mgmt & WPA_KEY_MGMT_IEEE8021X) -@@ -868,7 +866,7 @@ int hostapd_init_wps(struct hostapd_data - - if (conf->wpa_pairwise & WPA_CIPHER_CCMP) - wps->encr_types |= WPS_ENCR_AES; -- if (conf->wpa_pairwise & WPA_CIPHER_TKIP) -+ else if (conf->wpa_pairwise & WPA_CIPHER_TKIP) - wps->encr_types |= WPS_ENCR_TKIP; - } - diff --git a/package/hostapd/patches/540-dynamic_20_40_mhz.patch b/package/hostapd/patches/540-dynamic_20_40_mhz.patch deleted file mode 100644 index 420fcc6bf..000000000 --- a/package/hostapd/patches/540-dynamic_20_40_mhz.patch +++ /dev/null @@ -1,202 +0,0 @@ ---- a/hostapd/config_file.c -+++ b/hostapd/config_file.c -@@ -1957,6 +1957,10 @@ static int hostapd_config_fill(struct ho - "ht_capab", line); - errors++; - } -+ } else if (os_strcmp(buf, "dynamic_ht40") == 0) { -+ conf->dynamic_ht40 = atoi(pos); -+ if (conf->dynamic_ht40 == 1) -+ conf->dynamic_ht40 = 1500; - } else if (os_strcmp(buf, "require_ht") == 0) { - conf->require_ht = atoi(pos); - #endif /* CONFIG_IEEE80211N */ ---- a/src/ap/ap_config.h -+++ b/src/ap/ap_config.h -@@ -434,6 +434,7 @@ struct hostapd_config { - int ieee80211n; - int secondary_channel; - int require_ht; -+ int dynamic_ht40; - }; - - ---- a/src/ap/hostapd.c -+++ b/src/ap/hostapd.c -@@ -21,6 +21,7 @@ - #include "beacon.h" - #include "iapp.h" - #include "ieee802_1x.h" -+#include "ieee802_11.h" - #include "ieee802_11_auth.h" - #include "vlan_init.h" - #include "wpa_auth.h" -@@ -317,6 +318,7 @@ static void hostapd_cleanup_iface_pre(st - - static void hostapd_cleanup_iface_partial(struct hostapd_iface *iface) - { -+ hostapd_deinit_ht(iface); - hostapd_free_hw_features(iface->hw_features, iface->num_hw_features); - iface->hw_features = NULL; - os_free(iface->current_rates); ---- a/src/ap/hostapd.h -+++ b/src/ap/hostapd.h -@@ -238,6 +238,9 @@ struct hostapd_iface { - /* Overlapping BSS information */ - int olbc_ht; - -+ int force_20mhz; -+ struct os_time last_20mhz_trigger; -+ - u16 ht_op_mode; - void (*scan_cb)(struct hostapd_iface *iface); - ---- a/src/ap/ieee802_11.c -+++ b/src/ap/ieee802_11.c -@@ -1205,6 +1205,9 @@ static void handle_beacon(struct hostapd - sizeof(mgmt->u.beacon)), &elems, - 0); - -+ if (!elems.ht_capabilities) -+ hostapd_trigger_20mhz(hapd->iface); -+ - ap_list_process_beacon(hapd->iface, mgmt, &elems, fi); - } - ---- a/src/ap/ieee802_11.h -+++ b/src/ap/ieee802_11.h -@@ -73,4 +73,17 @@ u8 * hostapd_eid_time_zone(struct hostap - int hostapd_update_time_adv(struct hostapd_data *hapd); - void hostapd_client_poll_ok(struct hostapd_data *hapd, const u8 *addr); - -+#ifdef CONFIG_IEEE80211N -+void hostapd_trigger_20mhz(struct hostapd_iface *iface); -+void hostapd_deinit_ht(struct hostapd_iface *iface); -+ -+#else -+static inline void hostapd_deinit_ht(struct hostapd_iface *iface) -+{ -+} -+static inline void hostapd_trigger_20mhz(struct hostapd_iface *iface) -+{ -+} -+#endif /* CONFIG_IEEE80211N */ -+ - #endif /* IEEE802_11_H */ ---- a/src/ap/ieee802_11_ht.c -+++ b/src/ap/ieee802_11_ht.c -@@ -20,9 +20,11 @@ - #include "drivers/driver.h" - #include "hostapd.h" - #include "ap_config.h" -+#include "ap_drv_ops.h" - #include "sta_info.h" - #include "beacon.h" - #include "ieee802_11.h" -+#include "utils/eloop.h" - - - u8 * hostapd_eid_ht_capabilities(struct hostapd_data *hapd, u8 *eid) -@@ -70,12 +72,15 @@ u8 * hostapd_eid_ht_operation(struct hos - - oper->control_chan = hapd->iconf->channel; - oper->operation_mode = host_to_le16(hapd->iface->ht_op_mode); -- if (hapd->iconf->secondary_channel == 1) -- oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE | -- HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH; -- if (hapd->iconf->secondary_channel == -1) -- oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW | -- HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH; -+ -+ if (!hapd->iface->force_20mhz) { -+ if (hapd->iconf->secondary_channel == 1) -+ oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE | -+ HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH; -+ if (hapd->iconf->secondary_channel == -1) -+ oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW | -+ HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH; -+ } - - pos += sizeof(*oper); - -@@ -271,3 +276,80 @@ void hostapd_get_ht_capab(struct hostapd - - neg_ht_cap->ht_capabilities_info = host_to_le16(cap); - } -+ -+static void hostapd_set_force_20mhz(struct hostapd_iface *iface); -+ -+static void hostapd_restore_40mhz(void *eloop_data, void *user_ctx) -+{ -+ struct hostapd_iface *iface = eloop_data; -+ struct os_time time; -+ int timeout; -+ -+ if (!iface->last_20mhz_trigger.sec) -+ return; -+ -+ os_get_time(&time); -+ timeout = iface->last_20mhz_trigger.sec + iface->conf->dynamic_ht40 - -+ time.sec; -+ -+ if (timeout > 0) { -+ eloop_register_timeout(timeout, 0, hostapd_restore_40mhz, -+ iface, NULL); -+ return; -+ } -+ -+ iface->last_20mhz_trigger.sec = 0; -+ iface->last_20mhz_trigger.usec = 0; -+ -+ iface->force_20mhz = 0; -+ hostapd_set_force_20mhz(iface); -+} -+ -+static void hostapd_set_force_20mhz(struct hostapd_iface *iface) -+{ -+ int secondary_channel; -+ int i; -+ -+ ieee802_11_set_beacons(iface); -+ -+ for (i = 0; i < iface->num_bss; i++) { -+ struct hostapd_data *hapd = iface->bss[i]; -+ -+ if (iface->force_20mhz) -+ secondary_channel = 0; -+ else -+ secondary_channel = hapd->iconf->secondary_channel; -+ -+ if (hostapd_set_freq(hapd, hapd->iconf->hw_mode, iface->freq, -+ hapd->iconf->channel, -+ hapd->iconf->ieee80211n, -+ secondary_channel)) { -+ wpa_printf(MSG_ERROR, "Could not set channel for " -+ "kernel driver"); -+ } -+ } -+} -+ -+void hostapd_deinit_ht(struct hostapd_iface *iface) -+{ -+ eloop_cancel_timeout(hostapd_restore_40mhz, iface, NULL); -+} -+ -+void hostapd_trigger_20mhz(struct hostapd_iface *iface) -+{ -+ if (!iface->conf->dynamic_ht40) -+ return; -+ -+ if (!iface->force_20mhz) { -+ iface->force_20mhz = 1; -+ hostapd_set_force_20mhz(iface); -+ } -+ -+ if (!iface->last_20mhz_trigger.sec) { -+ eloop_cancel_timeout(hostapd_restore_40mhz, iface, NULL); -+ eloop_register_timeout(iface->conf->dynamic_ht40, 0, -+ hostapd_restore_40mhz, iface, NULL); -+ } -+ -+ os_get_time(&iface->last_20mhz_trigger); -+} diff --git a/package/hostapd/patches/550-limit_debug_messages.patch b/package/hostapd/patches/550-limit_debug_messages.patch deleted file mode 100644 index 659e98011..000000000 --- a/package/hostapd/patches/550-limit_debug_messages.patch +++ /dev/null @@ -1,213 +0,0 @@ ---- a/src/utils/wpa_debug.c -+++ b/src/utils/wpa_debug.c -@@ -201,7 +201,7 @@ void wpa_debug_close_linux_tracing(void) - * - * Note: New line '\n' is added to the end of the text when printing to stdout. - */ --void wpa_printf(int level, const char *fmt, ...) -+void _wpa_printf(int level, const char *fmt, ...) - { - va_list ap; - -@@ -248,8 +248,8 @@ void wpa_printf(int level, const char *f - } - - --static void _wpa_hexdump(int level, const char *title, const u8 *buf, -- size_t len, int show) -+void _wpa_hexdump(int level, const char *title, const u8 *buf, -+ size_t len, int show) - { - size_t i; - -@@ -375,20 +375,9 @@ static void _wpa_hexdump(int level, cons - #endif /* CONFIG_ANDROID_LOG */ - } - --void wpa_hexdump(int level, const char *title, const u8 *buf, size_t len) --{ -- _wpa_hexdump(level, title, buf, len, 1); --} -- -- --void wpa_hexdump_key(int level, const char *title, const u8 *buf, size_t len) --{ -- _wpa_hexdump(level, title, buf, len, wpa_debug_show_keys); --} - -- --static void _wpa_hexdump_ascii(int level, const char *title, const u8 *buf, -- size_t len, int show) -+void _wpa_hexdump_ascii(int level, const char *title, const u8 *buf, -+ size_t len, int show) - { - size_t i, llen; - const u8 *pos = buf; -@@ -495,19 +484,6 @@ static void _wpa_hexdump_ascii(int level - } - - --void wpa_hexdump_ascii(int level, const char *title, const u8 *buf, size_t len) --{ -- _wpa_hexdump_ascii(level, title, buf, len, 1); --} -- -- --void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf, -- size_t len) --{ -- _wpa_hexdump_ascii(level, title, buf, len, wpa_debug_show_keys); --} -- -- - #ifdef CONFIG_DEBUG_FILE - static char *last_path = NULL; - #endif /* CONFIG_DEBUG_FILE */ -@@ -591,7 +567,7 @@ void wpa_msg_register_ifname_cb(wpa_msg_ - } - - --void wpa_msg(void *ctx, int level, const char *fmt, ...) -+void _wpa_msg(void *ctx, int level, const char *fmt, ...) - { - va_list ap; - char *buf; -@@ -625,7 +601,7 @@ void wpa_msg(void *ctx, int level, const - } - - --void wpa_msg_ctrl(void *ctx, int level, const char *fmt, ...) -+void _wpa_msg_ctrl(void *ctx, int level, const char *fmt, ...) - { - va_list ap; - char *buf; ---- a/src/utils/wpa_debug.h -+++ b/src/utils/wpa_debug.h -@@ -43,6 +43,17 @@ int wpa_debug_open_file(const char *path - int wpa_debug_reopen_file(void); - void wpa_debug_close_file(void); - -+/* internal */ -+void _wpa_hexdump(int level, const char *title, const u8 *buf, -+ size_t len, int show); -+void _wpa_hexdump_ascii(int level, const char *title, const u8 *buf, -+ size_t len, int show); -+extern int wpa_debug_show_keys; -+ -+#ifndef CONFIG_MSG_MIN_PRIORITY -+#define CONFIG_MSG_MIN_PRIORITY 0 -+#endif -+ - /** - * wpa_debug_printf_timestamp - Print timestamp for debug output - * -@@ -63,9 +74,15 @@ void wpa_debug_print_timestamp(void); - * - * Note: New line '\n' is added to the end of the text when printing to stdout. - */ --void wpa_printf(int level, const char *fmt, ...) -+void _wpa_printf(int level, const char *fmt, ...) - PRINTF_FORMAT(2, 3); - -+#define wpa_printf(level, ...) \ -+ do { \ -+ if (level >= CONFIG_MSG_MIN_PRIORITY) \ -+ _wpa_printf(level, __VA_ARGS__); \ -+ } while(0) -+ - /** - * wpa_hexdump - conditional hex dump - * @level: priority level (MSG_*) of the message -@@ -77,7 +94,13 @@ PRINTF_FORMAT(2, 3); - * output may be directed to stdout, stderr, and/or syslog based on - * configuration. The contents of buf is printed out has hex dump. - */ --void wpa_hexdump(int level, const char *title, const u8 *buf, size_t len); -+static inline void wpa_hexdump(int level, const char *title, const u8 *buf, size_t len) -+{ -+ if (level < CONFIG_MSG_MIN_PRIORITY) -+ return; -+ -+ _wpa_hexdump(level, title, buf, len, 1); -+} - - static inline void wpa_hexdump_buf(int level, const char *title, - const struct wpabuf *buf) -@@ -99,7 +122,13 @@ static inline void wpa_hexdump_buf(int l - * like wpa_hexdump(), but by default, does not include secret keys (passwords, - * etc.) in debug output. - */ --void wpa_hexdump_key(int level, const char *title, const u8 *buf, size_t len); -+static inline void wpa_hexdump_key(int level, const char *title, const u8 *buf, size_t len) -+{ -+ if (level < CONFIG_MSG_MIN_PRIORITY) -+ return; -+ -+ _wpa_hexdump(level, title, buf, len, wpa_debug_show_keys); -+} - - static inline void wpa_hexdump_buf_key(int level, const char *title, - const struct wpabuf *buf) -@@ -121,8 +150,14 @@ static inline void wpa_hexdump_buf_key(i - * the hex numbers and ASCII characters (for printable range) are shown. 16 - * bytes per line will be shown. - */ --void wpa_hexdump_ascii(int level, const char *title, const u8 *buf, -- size_t len); -+static inline void wpa_hexdump_ascii(int level, const char *title, -+ const u8 *buf, size_t len) -+{ -+ if (level < CONFIG_MSG_MIN_PRIORITY) -+ return; -+ -+ _wpa_hexdump_ascii(level, title, buf, len, 1); -+} - - /** - * wpa_hexdump_ascii_key - conditional hex dump, hide keys -@@ -138,8 +173,14 @@ void wpa_hexdump_ascii(int level, const - * bytes per line will be shown. This works like wpa_hexdump_ascii(), but by - * default, does not include secret keys (passwords, etc.) in debug output. - */ --void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf, -- size_t len); -+static inline void wpa_hexdump_ascii_key(int level, const char *title, -+ const u8 *buf, size_t len) -+{ -+ if (level < CONFIG_MSG_MIN_PRIORITY) -+ return; -+ -+ _wpa_hexdump_ascii(level, title, buf, len, wpa_debug_show_keys); -+} - - /* - * wpa_dbg() behaves like wpa_msg(), but it can be removed from build to reduce -@@ -172,7 +213,12 @@ void wpa_hexdump_ascii_key(int level, co - * - * Note: New line '\n' is added to the end of the text when printing to stdout. - */ --void wpa_msg(void *ctx, int level, const char *fmt, ...) PRINTF_FORMAT(3, 4); -+void _wpa_msg(void *ctx, int level, const char *fmt, ...) PRINTF_FORMAT(3, 4); -+#define wpa_msg(ctx, level, ...) \ -+ do { \ -+ if (level >= CONFIG_MSG_MIN_PRIORITY) \ -+ _wpa_msg(ctx, level, __VA_ARGS__); \ -+ } while(0) - - /** - * wpa_msg_ctrl - Conditional printf for ctrl_iface monitors -@@ -186,8 +232,13 @@ void wpa_msg(void *ctx, int level, const - * attached ctrl_iface monitors. In other words, it can be used for frequent - * events that do not need to be sent to syslog. - */ --void wpa_msg_ctrl(void *ctx, int level, const char *fmt, ...) -+void _wpa_msg_ctrl(void *ctx, int level, const char *fmt, ...) - PRINTF_FORMAT(3, 4); -+#define wpa_msg_ctrl(ctx, level, ...) \ -+ do { \ -+ if (level >= CONFIG_MSG_MIN_PRIORITY) \ -+ _wpa_msg_ctrl(ctx, level, __VA_ARGS__); \ -+ } while(0) - - typedef void (*wpa_msg_cb_func)(void *ctx, int level, const char *txt, - size_t len); diff --git a/package/hostapd/patches/560-indicate-features.patch b/package/hostapd/patches/560-indicate-features.patch deleted file mode 100644 index 257928c74..000000000 --- a/package/hostapd/patches/560-indicate-features.patch +++ /dev/null @@ -1,82 +0,0 @@ ---- a/hostapd/main.c -+++ b/hostapd/main.c -@@ -13,6 +13,7 @@ - - #include "utils/common.h" - #include "utils/eloop.h" -+#include "utils/build_features.h" - #include "crypto/random.h" - #include "crypto/tls.h" - #include "common/version.h" -@@ -551,7 +552,7 @@ int main(int argc, char *argv[]) - - wpa_supplicant_event = hostapd_wpa_event; - for (;;) { -- c = getopt(argc, argv, "Bde:f:hKP:tv"); -+ c = getopt(argc, argv, "Bde:f:hKP:tv::"); - if (c < 0) - break; - switch (c) { -@@ -583,6 +584,8 @@ int main(int argc, char *argv[]) - wpa_debug_timestamp++; - break; - case 'v': -+ if (optarg) -+ exit(!has_feature(optarg)); - show_version(); - exit(1); - break; ---- a/wpa_supplicant/main.c -+++ b/wpa_supplicant/main.c -@@ -12,6 +12,7 @@ - #endif /* __linux__ */ - - #include "common.h" -+#include "build_features.h" - #include "wpa_supplicant_i.h" - #include "driver_i.h" - -@@ -145,7 +146,7 @@ int main(int argc, char *argv[]) - - for (;;) { - c = getopt(argc, argv, -- "b:Bc:C:D:de:f:g:hH:i:KLNo:O:p:P:qsTtuvW"); -+ "b:Bc:C:D:de:f:g:hH:i:KLNo:O:p:P:qsTtuv::W"); - if (c < 0) - break; - switch (c) { -@@ -237,8 +238,12 @@ int main(int argc, char *argv[]) - break; - #endif /* CONFIG_DBUS */ - case 'v': -- printf("%s\n", wpa_supplicant_version); -- exitcode = 0; -+ if (optarg) { -+ exitcode = !has_feature(optarg); -+ } else { -+ printf("%s\n", wpa_supplicant_version); -+ exitcode = 0; -+ } - goto out; - case 'W': - params.wait_for_monitor++; ---- /dev/null -+++ b/src/utils/build_features.h -@@ -0,0 +1,17 @@ -+#ifndef BUILD_FEATURES_H -+#define BUILD_FEATURES_H -+ -+static inline int has_feature(const char *feat) -+{ -+#ifdef IEEE8021X_EAPOL -+ if (!strcmp(feat, "eap")) -+ return 1; -+#endif -+#ifdef IEEE80211N -+ if (!strcmp(feat, "11n")) -+ return 1; -+#endif -+ return 0; -+} -+ -+#endif /* BUILD_FEATURES_H */ diff --git a/package/hostapd/patches/570-genl_connect_debug.patch b/package/hostapd/patches/570-genl_connect_debug.patch deleted file mode 100644 index 5475cbe9e..000000000 --- a/package/hostapd/patches/570-genl_connect_debug.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -121,7 +121,7 @@ static struct nl_handle * nl_create_hand - } - - if (genl_connect(handle)) { -- wpa_printf(MSG_ERROR, "nl80211: Failed to connect to generic " -+ wpa_printf(MSG_DEBUG, "nl80211: Failed to connect to generic " - "netlink (%s)", dbg); - nl80211_handle_destroy(handle); - return NULL; diff --git a/package/hostapd/patches/580-fix_bss_addr.patch b/package/hostapd/patches/580-fix_bss_addr.patch deleted file mode 100644 index fffa25ec4..000000000 --- a/package/hostapd/patches/580-fix_bss_addr.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -7607,7 +7607,7 @@ static int i802_set_wds_sta(void *priv, - if (!if_nametoindex(name)) { - if (nl80211_create_iface(drv, name, - NL80211_IFTYPE_AP_VLAN, -- NULL, 1) < 0) -+ bss->addr, 1) < 0) - return -1; - if (bridge_ifname && - linux_br_add_if(drv->global->ioctl_sock, diff --git a/package/hostapd/patches/601-wpa_supplicant-add-new-config-params-to-be-used-with.patch b/package/hostapd/patches/601-wpa_supplicant-add-new-config-params-to-be-used-with.patch deleted file mode 100644 index 447f480d1..000000000 --- a/package/hostapd/patches/601-wpa_supplicant-add-new-config-params-to-be-used-with.patch +++ /dev/null @@ -1,211 +0,0 @@ -From 4bb69d15477e0f2b00e166845341dc933de47c58 Mon Sep 17 00:00:00 2001 -From: Antonio Quartulli <ordex@autistici.org> -Date: Sun, 3 Jun 2012 18:22:56 +0200 -Subject: [PATCHv2 601/602] wpa_supplicant: add new config params to be used - with the ibss join command - -Signed-hostap: Antonio Quartulli <ordex@autistici.org> ---- - src/drivers/driver.h | 6 +++ - wpa_supplicant/config.c | 96 +++++++++++++++++++++++++++++++++++++++ - wpa_supplicant/config_ssid.h | 6 +++ - wpa_supplicant/wpa_supplicant.c | 23 +++++++--- - 4 files changed, 124 insertions(+), 7 deletions(-) - ---- a/src/drivers/driver.h -+++ b/src/drivers/driver.h -@@ -19,6 +19,7 @@ - - #define WPA_SUPPLICANT_DRIVER_VERSION 4 - -+#include "drivers/nl80211_copy.h" - #include "common/defs.h" - - #define HOSTAPD_CHAN_DISABLED 0x00000001 -@@ -332,6 +333,11 @@ struct wpa_driver_associate_params { - */ - int freq; - -+ int beacon_interval; -+ int fixed_freq; -+ unsigned char rates[NL80211_MAX_SUPP_RATES]; -+ int mcast_rate; -+ - /** - * bg_scan_period - Background scan period in seconds, 0 to disable - * background scan, or -1 to indicate no change to default driver ---- a/wpa_supplicant/config.c -+++ b/wpa_supplicant/config.c -@@ -14,6 +14,7 @@ - #include "rsn_supp/wpa.h" - #include "eap_peer/eap.h" - #include "p2p/p2p.h" -+#include "drivers/nl80211_copy.h" - #include "config.h" - - -@@ -1431,6 +1432,97 @@ static char * wpa_config_write_p2p_clien - - #endif /* CONFIG_P2P */ - -+static int wpa_config_parse_mcast_rate(const struct parse_data *data, -+ struct wpa_ssid *ssid, int line, -+ const char *value) -+{ -+ ssid->mcast_rate = (int)(strtod(value, NULL) * 10); -+ -+ return 0; -+} -+ -+#ifndef NO_CONFIG_WRITE -+static char * wpa_config_write_mcast_rate(const struct parse_data *data, -+ struct wpa_ssid *ssid) -+{ -+ char *value; -+ int res; -+ -+ if (!ssid->mcast_rate == 0) -+ return NULL; -+ -+ value = os_malloc(6); /* longest: 300.0 */ -+ if (value == NULL) -+ return NULL; -+ res = os_snprintf(value, 5, "%.1f", (double)ssid->mcast_rate / 10); -+ if (res < 0) { -+ os_free(value); -+ return NULL; -+ } -+ return value; -+} -+#endif /* NO_CONFIG_WRITE */ -+ -+static int wpa_config_parse_rates(const struct parse_data *data, -+ struct wpa_ssid *ssid, int line, -+ const char *value) -+{ -+ int i; -+ char *pos, *r, *sptr, *end; -+ double rate; -+ -+ pos = (char *)value; -+ r = strtok_r(pos, ",", &sptr); -+ i = 0; -+ while (pos && i < NL80211_MAX_SUPP_RATES) { -+ rate = 0.0; -+ if (r) -+ rate = strtod(r, &end); -+ ssid->rates[i] = rate * 2; -+ if (*end != '\0' || rate * 2 != ssid->rates[i]) -+ return 1; -+ -+ i++; -+ r = strtok_r(NULL, ",", &sptr); -+ } -+ -+ return 0; -+} -+ -+#ifndef NO_CONFIG_WRITE -+static char * wpa_config_write_rates(const struct parse_data *data, -+ struct wpa_ssid *ssid) -+{ -+ char *value, *pos; -+ int res, i; -+ -+ if (ssid->rates[0] <= 0) -+ return NULL; -+ -+ value = os_malloc(6 * NL80211_MAX_SUPP_RATES + 1); -+ if (value == NULL) -+ return NULL; -+ pos = value; -+ for (i = 0; i < NL80211_MAX_SUPP_RATES - 1; i++) { -+ res = os_snprintf(pos, 6, "%.1f,", (double)ssid->rates[i] / 2); -+ if (res < 0) { -+ os_free(value); -+ return NULL; -+ } -+ pos += res; -+ } -+ res = os_snprintf(pos, 6, "%.1f", -+ (double)ssid->rates[NL80211_MAX_SUPP_RATES - 1] / 2); -+ if (res < 0) { -+ os_free(value); -+ return NULL; -+ } -+ -+ value[6 * NL80211_MAX_SUPP_RATES] = '\0'; -+ return value; -+} -+#endif /* NO_CONFIG_WRITE */ -+ - /* Helper macros for network block parser */ - - #ifdef OFFSET -@@ -1605,6 +1697,10 @@ static const struct parse_data ssid_fiel - { STR(ht_mcs) }, - #endif /* CONFIG_HT_OVERRIDES */ - { INT(ap_max_inactivity) }, -+ { INT_RANGE(fixed_freq, 0, 1) }, -+ { INT_RANGE(beacon_interval, 0, 1000) }, -+ { FUNC(rates) }, -+ { FUNC(mcast_rate) }, - }; - - #undef OFFSET ---- a/wpa_supplicant/config_ssid.h -+++ b/wpa_supplicant/config_ssid.h -@@ -11,6 +11,7 @@ - - #include "common/defs.h" - #include "eap_peer/eap_config.h" -+#include "drivers/nl80211_copy.h" - - #define MAX_SSID_LEN 32 - -@@ -499,6 +500,11 @@ struct wpa_ssid { - * By default: 300 seconds. - */ - int ap_max_inactivity; -+ -+ int fixed_freq; -+ int beacon_interval; -+ unsigned char rates[NL80211_MAX_SUPP_RATES]; -+ double mcast_rate; - }; - - #endif /* CONFIG_SSID_H */ ---- a/wpa_supplicant/wpa_supplicant.c -+++ b/wpa_supplicant/wpa_supplicant.c -@@ -1395,15 +1395,24 @@ void wpa_supplicant_associate(struct wpa - params.ssid_len = ssid->ssid_len; - } - -- if (ssid->mode == WPAS_MODE_IBSS && ssid->bssid_set && -- wpa_s->conf->ap_scan == 2) { -- params.bssid = ssid->bssid; -- params.fixed_bssid = 1; -+ if (ssid->mode == WPAS_MODE_IBSS) { -+ if (ssid->bssid_set && wpa_s->conf->ap_scan == 2) { -+ params.bssid = ssid->bssid; -+ params.fixed_bssid = 1; -+ } -+ if (ssid->frequency > 0 && params.freq == 0) -+ /* Initial channel for IBSS */ -+ params.freq = ssid->frequency; -+ params.fixed_freq = ssid->fixed_freq; -+ params.beacon_interval = ssid->beacon_interval; -+ i = 0; -+ while (i < NL80211_MAX_SUPP_RATES) { -+ params.rates[i] = ssid->rates[i]; -+ i++; -+ } -+ params.mcast_rate = ssid->mcast_rate; - } - -- if (ssid->mode == WPAS_MODE_IBSS && ssid->frequency > 0 && -- params.freq == 0) -- params.freq = ssid->frequency; /* Initial channel for IBSS */ - params.wpa_ie = wpa_ie; - params.wpa_ie_len = wpa_ie_len; - params.pairwise_suite = cipher_pairwise; diff --git a/package/hostapd/patches/602-driver_nl80211-use-new-parameters-during-ibss-join.patch b/package/hostapd/patches/602-driver_nl80211-use-new-parameters-during-ibss-join.patch deleted file mode 100644 index 28eba21d9..000000000 --- a/package/hostapd/patches/602-driver_nl80211-use-new-parameters-during-ibss-join.patch +++ /dev/null @@ -1,59 +0,0 @@ -From ffc4445958a3ed4064f2e1bf73fa478a61c5cf7b Mon Sep 17 00:00:00 2001 -From: Antonio Quartulli <ordex@autistici.org> -Date: Sun, 3 Jun 2012 18:42:25 +0200 -Subject: [PATCHv2 602/602] driver_nl80211: use new parameters during ibss join - -Signed-hostap: Antonio Quartulli <ordex@autistici.org> ---- - src/drivers/driver_nl80211.c | 33 ++++++++++++++++++++++++++++++++- - 1 file changed, 32 insertions(+), 1 deletion(-) - ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -6481,7 +6481,7 @@ static int wpa_driver_nl80211_ibss(struc - struct wpa_driver_associate_params *params) - { - struct nl_msg *msg; -- int ret = -1; -+ int ret = -1, i; - int count = 0; - - wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex); -@@ -6514,6 +6514,37 @@ retry: - wpa_printf(MSG_DEBUG, " * freq=%d", params->freq); - NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, params->freq); - -+ if (params->fixed_freq) { -+ wpa_printf(MSG_DEBUG, " * fixed_freq"); -+ NLA_PUT_FLAG(msg, NL80211_ATTR_FREQ_FIXED); -+ } -+ -+ if (params->beacon_interval > 0) { -+ wpa_printf(MSG_DEBUG, " * beacon_interval=%d", -+ params->beacon_interval); -+ NLA_PUT_U32(msg, NL80211_ATTR_BEACON_INTERVAL, -+ params->beacon_interval); -+ } -+ -+ if (params->rates[0] > 0) { -+ wpa_printf(MSG_DEBUG, " * basic_rates:"); -+ i = 0; -+ while (i < NL80211_MAX_SUPP_RATES && -+ params->rates[i] > 0) { -+ wpa_printf(MSG_DEBUG, " %.1f", -+ (double)params->rates[i] / 2); -+ i++; -+ } -+ NLA_PUT(msg, NL80211_ATTR_BSS_BASIC_RATES, i, -+ params->rates); -+ } -+ -+ if (params->mcast_rate > 0) { -+ wpa_printf(MSG_DEBUG, " * mcast_rates=%.1f", -+ (double)params->mcast_rate / 10); -+ NLA_PUT_U32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate); -+ } -+ - ret = nl80211_set_conn_keys(params, msg); - if (ret) - goto nla_put_failure; diff --git a/package/hostapd/patches/604-wpa_s-support-htmode-param.patch b/package/hostapd/patches/604-wpa_s-support-htmode-param.patch deleted file mode 100644 index e540d4533..000000000 --- a/package/hostapd/patches/604-wpa_s-support-htmode-param.patch +++ /dev/null @@ -1,156 +0,0 @@ -From b9329c5dfeed7d5c55d2117d8dfe326fc40c8fb1 Mon Sep 17 00:00:00 2001 -From: Antonio Quartulli <ordex@autistici.org> -Date: Tue, 3 Jul 2012 00:36:24 +0200 -Subject: [PATCH] wpa_s: support htmode param - -possible values are HT20, HT40-, HT40+ and NOHT - -Signed-off-by: Antonio Quartulli <ordex@autistici.org> ---- - src/drivers/driver.h | 2 ++ - src/drivers/driver_nl80211.c | 16 ++++++++++ - wpa_supplicant/config.c | 66 +++++++++++++++++++++++++++++++++++++++ - wpa_supplicant/config_ssid.h | 2 ++ - wpa_supplicant/wpa_supplicant.c | 2 ++ - 5 files changed, 88 insertions(+) - ---- a/src/drivers/driver.h -+++ b/src/drivers/driver.h -@@ -337,6 +337,8 @@ struct wpa_driver_associate_params { - int fixed_freq; - unsigned char rates[NL80211_MAX_SUPP_RATES]; - int mcast_rate; -+ int ht_set; -+ unsigned int htmode; - - /** - * bg_scan_period - Background scan period in seconds, 0 to disable ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -6545,6 +6545,22 @@ retry: - NLA_PUT_U32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate); - } - -+ if (params->ht_set) { -+ switch(params->htmode) { -+ case NL80211_CHAN_HT20: -+ wpa_printf(MSG_DEBUG, " * ht=HT20"); -+ break; -+ case NL80211_CHAN_HT40PLUS: -+ wpa_printf(MSG_DEBUG, " * ht=HT40+"); -+ break; -+ case NL80211_CHAN_HT40MINUS: -+ wpa_printf(MSG_DEBUG, " * ht=HT40-"); -+ break; -+ } -+ NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, -+ params->htmode); -+ } -+ - ret = nl80211_set_conn_keys(params, msg); - if (ret) - goto nla_put_failure; ---- a/wpa_supplicant/config.c -+++ b/wpa_supplicant/config.c -@@ -1463,6 +1463,71 @@ static char * wpa_config_write_mcast_rat - } - #endif /* NO_CONFIG_WRITE */ - -+static int wpa_config_parse_htmode(const struct parse_data *data, -+ struct wpa_ssid *ssid, int line, -+ const char *value) -+{ -+ int i; -+ static const struct { -+ const char *name; -+ unsigned int val; -+ } htmap[] = { -+ { .name = "HT20", .val = NL80211_CHAN_HT20, }, -+ { .name = "HT40+", .val = NL80211_CHAN_HT40PLUS, }, -+ { .name = "HT40-", .val = NL80211_CHAN_HT40MINUS, }, -+ { .name = "NOHT", .val = NL80211_CHAN_NO_HT, }, -+ }; -+ ssid->ht_set = 0;; -+ for (i = 0; i < 4; i++) { -+ if (strcasecmp(htmap[i].name, value) == 0) { -+ ssid->htmode = htmap[i].val; -+ ssid->ht_set = 1; -+ break; -+ } -+ } -+ -+ return 0; -+} -+ -+#ifndef NO_CONFIG_WRITE -+static char * wpa_config_write_htmode(const struct parse_data *data, -+ struct wpa_ssid *ssid) -+{ -+ char *value; -+ int res; -+ -+ value = os_malloc(6); /* longest: HT40+ */ -+ if (value == NULL) -+ return NULL; -+ -+ switch(ssid->htmode) { -+ case NL80211_CHAN_HT20: -+ res = os_snprintf(value, 4, "HT20"); -+ break; -+ case NL80211_CHAN_HT40PLUS: -+ res = os_snprintf(value, 5, "HT40+"); -+ break; -+ case NL80211_CHAN_HT40MINUS: -+ res = os_snprintf(value, 5, "HT40-"); -+ break; -+ case NL80211_CHAN_NO_HT: -+ res = os_snprintf(value, 4, "NOHT"); -+ break; -+ default: -+ os_free(value); -+ return NULL; -+ } -+ -+ if (res < 0) { -+ os_free(value); -+ return NULL; -+ } -+ -+ return value; -+} -+#endif /* NO_CONFIG_WRITE */ -+ -+ - static int wpa_config_parse_rates(const struct parse_data *data, - struct wpa_ssid *ssid, int line, - const char *value) -@@ -1701,6 +1766,7 @@ static const struct parse_data ssid_fiel - { INT_RANGE(beacon_interval, 0, 1000) }, - { FUNC(rates) }, - { FUNC(mcast_rate) }, -+ { FUNC(htmode) }, - }; - - #undef OFFSET ---- a/wpa_supplicant/config_ssid.h -+++ b/wpa_supplicant/config_ssid.h -@@ -505,6 +505,8 @@ struct wpa_ssid { - int beacon_interval; - unsigned char rates[NL80211_MAX_SUPP_RATES]; - double mcast_rate; -+ int ht_set; -+ unsigned int htmode; - }; - - #endif /* CONFIG_SSID_H */ ---- a/wpa_supplicant/wpa_supplicant.c -+++ b/wpa_supplicant/wpa_supplicant.c -@@ -1411,6 +1411,8 @@ void wpa_supplicant_associate(struct wpa - i++; - } - params.mcast_rate = ssid->mcast_rate; -+ params.ht_set = ssid->ht_set; -+ params.htmode = ssid->htmode; - } - - params.wpa_ie = wpa_ie; |