From 8994b4b1918fba0ba846bd438c2f85547fe8daf5 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 6 Apr 2014 12:13:55 +0000 Subject: [PATCH] hostapd: update to version 2014-04-04 Signed-off-by: Felix Fietkau SVN-Revision: 40394 --- package/network/services/hostapd/Makefile | 4 +- .../patches/100-madwifi_key_fixes.patch | 4 +- .../hostapd/patches/110-bool_fix.patch | 2 +- .../hostapd/patches/130-wds_sta_del_fix.patch | 13 - .../hostapd/patches/200-multicall.patch | 66 +++-- .../services/hostapd/patches/300-noscan.patch | 18 +- .../patches/310-rescan_immediately.patch | 2 +- .../hostapd/patches/320-optional_rfkill.patch | 250 ++---------------- .../patches/330-nl80211_fix_set_freq.patch | 4 +- .../patches/340-reload_freq_change.patch | 18 +- .../patches/350-nl80211_del_beacon_bss.patch | 6 +- .../patches/360-ctrl_iface_reload.patch | 20 +- .../hostapd/patches/370-ap_sta_support.patch | 50 ++-- .../patches/380-disable_ctrl_iface_mib.patch | 57 ++-- .../patches/390-wpa_ie_cap_workaround.patch | 4 +- .../400-terminate_on_setup_failure.patch | 85 ------ .../patches/410-bring_down_interface.patch | 4 +- .../patches/420-fix_wps_pin_crash.patch | 2 +- .../430-wps_single_auth_enc_type.patch | 4 +- .../patches/440-dynamic_20_40_mhz.patch | 42 +-- .../patches/450-limit_debug_messages.patch | 49 ++-- .../patches/460-indicate-features.patch | 20 +- .../patches/470-hostapd_cli_ifdef.patch | 8 +- .../hostapd/patches/471-wpa_cli_ifdef.patch | 2 +- .../patches/480-max_num_sta_probe.patch | 2 +- .../hostapd/patches/490-scan_wait.patch | 20 +- ...dd-new-config-params-to-be-used-with.patch | 44 +-- ...-use-new-parameters-during-ibss-join.patch | 8 +- .../502-wpa_s-support-htmode-param.patch | 14 +- .../510-wpa_supplicant_p2p_parse_ifcomb.patch | 2 +- .../hostapd/patches/600-ubus_support.patch | 66 ++--- 31 files changed, 288 insertions(+), 602 deletions(-) delete mode 100644 package/network/services/hostapd/patches/130-wds_sta_del_fix.patch delete mode 100644 package/network/services/hostapd/patches/400-terminate_on_setup_failure.patch diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 7070afd6ef..1a6b429817 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -8,9 +8,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_VERSION:=20131120 +PKG_VERSION:=2014-04-04 PKG_RELEASE:=1 -PKG_REV:=594516b4c28a94ca686b17f1e463dfd6712b75a7 +PKG_REV:=ca4fd18290cc0966cba6d71a079d8c9177e53d1d PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=git://w1.fi/srv/git/hostap.git diff --git a/package/network/services/hostapd/patches/100-madwifi_key_fixes.patch b/package/network/services/hostapd/patches/100-madwifi_key_fixes.patch index dcd6d10bd6..a46943b442 100644 --- a/package/network/services/hostapd/patches/100-madwifi_key_fixes.patch +++ b/package/network/services/hostapd/patches/100-madwifi_key_fixes.patch @@ -1,6 +1,6 @@ --- a/src/drivers/driver_madwifi.c +++ b/src/drivers/driver_madwifi.c -@@ -450,7 +450,9 @@ wpa_driver_madwifi_set_key(const char *i +@@ -449,7 +449,9 @@ wpa_driver_madwifi_set_key(const char *i memset(&wk, 0, sizeof(wk)); wk.ik_type = cipher; @@ -11,7 +11,7 @@ if (addr == NULL || is_broadcast_ether_addr(addr)) { memset(wk.ik_macaddr, 0xff, IEEE80211_ADDR_LEN); wk.ik_keyix = key_idx; -@@ -462,6 +464,20 @@ wpa_driver_madwifi_set_key(const char *i +@@ -461,6 +463,20 @@ wpa_driver_madwifi_set_key(const char *i wk.ik_keylen = key_len; memcpy(wk.ik_keydata, key, key_len); diff --git a/package/network/services/hostapd/patches/110-bool_fix.patch b/package/network/services/hostapd/patches/110-bool_fix.patch index 9f82b0b057..1ad84bf405 100644 --- a/package/network/services/hostapd/patches/110-bool_fix.patch +++ b/package/network/services/hostapd/patches/110-bool_fix.patch @@ -1,6 +1,6 @@ --- a/src/ap/ieee802_1x.c +++ b/src/ap/ieee802_1x.c -@@ -1933,9 +1933,9 @@ void ieee802_1x_notify_pre_auth(struct e +@@ -2119,9 +2119,9 @@ void ieee802_1x_notify_pre_auth(struct e } diff --git a/package/network/services/hostapd/patches/130-wds_sta_del_fix.patch b/package/network/services/hostapd/patches/130-wds_sta_del_fix.patch deleted file mode 100644 index 06b69069e7..0000000000 --- a/package/network/services/hostapd/patches/130-wds_sta_del_fix.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -9083,8 +9083,8 @@ static int i802_set_wds_sta(void *priv, - name); - - i802_set_sta_vlan(priv, addr, bss->ifname, 0); -- return wpa_driver_nl80211_if_remove(priv, WPA_IF_AP_VLAN, -- name); -+ nl80211_remove_iface(drv, if_nametoindex(name)); -+ return 0; - } - } - diff --git a/package/network/services/hostapd/patches/200-multicall.patch b/package/network/services/hostapd/patches/200-multicall.patch index 2289f517f8..f358120009 100644 --- a/package/network/services/hostapd/patches/200-multicall.patch +++ b/package/network/services/hostapd/patches/200-multicall.patch @@ -1,14 +1,14 @@ --- a/hostapd/Makefile +++ b/hostapd/Makefile -@@ -14,6 +14,7 @@ CFLAGS += -I../src/utils +@@ -14,6 +14,7 @@ CFLAGS += -I$(abspath ../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 -@@ -200,10 +201,14 @@ ifdef CONFIG_IEEE80211AC + ifdef CONFIG_TESTING_OPTIONS + CFLAGS += -DCONFIG_TESTING_OPTIONS +@@ -223,10 +224,14 @@ ifdef CONFIG_IEEE80211AC CFLAGS += -DCONFIG_IEEE80211AC endif @@ -26,7 +26,7 @@ LIBS += $(DRV_AP_LIBS) ifdef CONFIG_L2_PACKET -@@ -890,6 +895,12 @@ install: all +@@ -913,6 +918,12 @@ install: all BCHECK=../src/drivers/build.hostapd @@ -39,7 +39,7 @@ hostapd: $(BCHECK) $(OBJS) $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) @$(E) " LD " $@ -@@ -928,6 +939,12 @@ HOBJS += ../src/crypto/aes-internal.o +@@ -951,6 +962,12 @@ HOBJS += ../src/crypto/aes-internal.o HOBJS += ../src/crypto/aes-internal-enc.o endif @@ -54,15 +54,15 @@ @$(E) " LD " $@ --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -14,6 +14,7 @@ CFLAGS += -I../src - CFLAGS += -I../src/utils +@@ -14,6 +14,7 @@ CFLAGS += -I$(abspath ../src) + CFLAGS += -I$(abspath ../src/utils) -include .config +-include $(if $(MULTICALL),../hostapd/.config) - BINALL=wpa_supplicant wpa_cli - -@@ -727,6 +728,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS + ifdef CONFIG_TESTING_OPTIONS + CFLAGS += -DCONFIG_TESTING_OPTIONS +@@ -746,6 +747,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS LIBS += -ldl -rdynamic endif @@ -73,7 +73,7 @@ endif ifdef CONFIG_AP -@@ -735,9 +740,11 @@ NEED_EAP_COMMON=y +@@ -754,9 +759,11 @@ NEED_EAP_COMMON=y NEED_RSN_AUTHENTICATOR=y CFLAGS += -DCONFIG_AP OBJS += ap.o @@ -85,7 +85,7 @@ OBJS += ../src/ap/hostapd.o OBJS += ../src/ap/wpa_auth_glue.o OBJS += ../src/ap/utils.o -@@ -799,10 +806,18 @@ endif +@@ -818,10 +825,18 @@ endif ifdef CONFIG_HS20 OBJS += ../src/ap/hs20.o endif @@ -104,7 +104,7 @@ NEED_AES_WRAP=y OBJS += ../src/ap/wpa_auth.o OBJS += ../src/ap/wpa_auth_ie.o -@@ -1551,6 +1566,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) +@@ -1584,6 +1599,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config @@ -117,7 +117,7 @@ wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) @$(E) " LD " $@ -@@ -1625,6 +1646,12 @@ eap_eke.so: ../src/eap_peer/eap_eke.c .. +@@ -1664,6 +1685,12 @@ endif %@.service: %.service.arg.in sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@ @@ -132,7 +132,7 @@ wpa_cli.exe: wpa_cli --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -4079,8 +4079,8 @@ union wpa_event_data { +@@ -3874,8 +3874,8 @@ union wpa_event_data { * Driver wrapper code should call this function whenever an event is received * from the driver. */ @@ -145,7 +145,7 @@ /* --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c -@@ -844,8 +844,8 @@ static void hostapd_event_dfs_nop_finish +@@ -906,8 +906,8 @@ static void hostapd_event_dfs_nop_finish #endif /* NEED_AP_MLME */ @@ -158,7 +158,7 @@ #ifndef CONFIG_NO_STDOUT_DEBUG --- a/wpa_supplicant/wpa_priv.c +++ b/wpa_supplicant/wpa_priv.c -@@ -817,8 +817,8 @@ static void wpa_priv_send_ft_response(st +@@ -815,8 +815,8 @@ static void wpa_priv_send_ft_response(st } @@ -169,7 +169,7 @@ { struct wpa_priv_interface *iface = ctx; -@@ -960,6 +960,7 @@ int main(int argc, char *argv[]) +@@ -956,6 +956,7 @@ int main(int argc, char *argv[]) if (os_program_init()) return -1; @@ -179,7 +179,7 @@ for (;;) { --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c -@@ -2710,8 +2710,8 @@ static void wpa_supplicant_update_channe +@@ -2887,8 +2887,8 @@ static void wpa_supplicant_notify_avoid_ } @@ -192,7 +192,7 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -3138,6 +3138,9 @@ static void wpa_supplicant_deinit_iface( +@@ -3711,6 +3711,9 @@ static void wpa_supplicant_deinit_iface( os_free(wpa_s); } @@ -202,7 +202,7 @@ /** * wpa_supplicant_add_iface - Add a new network interface -@@ -3329,6 +3332,7 @@ struct wpa_global * wpa_supplicant_init( +@@ -3902,6 +3905,7 @@ struct wpa_global * wpa_supplicant_init( wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb); #endif /* CONFIG_NO_WPA_MSG */ @@ -212,7 +212,7 @@ wpa_debug_open_syslog(); --- a/hostapd/main.c +++ b/hostapd/main.c -@@ -511,6 +511,9 @@ static int hostapd_get_ctrl_iface_group( +@@ -502,6 +502,9 @@ static int hostapd_get_ctrl_iface_group( return 0; } @@ -220,27 +220,25 @@ + union wpa_event_data *data); + - int main(int argc, char *argv[]) - { -@@ -541,6 +544,7 @@ int main(int argc, char *argv[]) + #ifdef CONFIG_WPS + static int gen_uuid(const char *txt_addr) +@@ -553,6 +556,7 @@ int main(int argc, char *argv[]) interfaces.global_iface_name = NULL; interfaces.global_ctrl_sock = -1; + wpa_supplicant_event = hostapd_wpa_event; for (;;) { - c = getopt(argc, argv, "b:Bde:f:hKP:Ttvg:G:"); + c = getopt(argc, argv, "b:Bde:f:hKP:Ttu:vg:G:"); 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" +@@ -10,6 +10,9 @@ + #include "utils/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 */ + #endif /* CONFIG_DRIVER_WEXT */ diff --git a/package/network/services/hostapd/patches/300-noscan.patch b/package/network/services/hostapd/patches/300-noscan.patch index 17e766161c..0bcec5ef9f 100644 --- a/package/network/services/hostapd/patches/300-noscan.patch +++ b/package/network/services/hostapd/patches/300-noscan.patch @@ -1,17 +1,17 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -2412,6 +2412,8 @@ static int hostapd_config_fill(struct ho - } +@@ -2634,6 +2634,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) { ++ } 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 -@@ -527,6 +527,7 @@ struct hostapd_config { +@@ -576,6 +576,7 @@ struct hostapd_config { int ht_op_mode_fixed; u16 ht_capab; @@ -21,7 +21,7 @@ int require_ht; --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c -@@ -577,7 +577,7 @@ static int ieee80211n_check_40mhz(struct +@@ -574,7 +574,7 @@ static int ieee80211n_check_40mhz(struct { struct wpa_driver_scan_params params; diff --git a/package/network/services/hostapd/patches/310-rescan_immediately.patch b/package/network/services/hostapd/patches/310-rescan_immediately.patch index 043f07c627..322c6a4cf4 100644 --- a/package/network/services/hostapd/patches/310-rescan_immediately.patch +++ b/package/network/services/hostapd/patches/310-rescan_immediately.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2488,7 +2488,7 @@ static struct wpa_supplicant * wpa_suppl +@@ -2741,7 +2741,7 @@ static struct wpa_supplicant * wpa_suppl if (wpa_s == NULL) return NULL; wpa_s->scan_req = INITIAL_SCAN_REQ; diff --git a/package/network/services/hostapd/patches/320-optional_rfkill.patch b/package/network/services/hostapd/patches/320-optional_rfkill.patch index 7ec51b1027..b0ea38f205 100644 --- a/package/network/services/hostapd/patches/320-optional_rfkill.patch +++ b/package/network/services/hostapd/patches/320-optional_rfkill.patch @@ -1,218 +1,3 @@ ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -254,7 +254,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; - u8 *extended_capa, *extended_capa_mask; - unsigned int extended_capa_len; -@@ -3630,7 +3632,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"); -@@ -3652,6 +3654,7 @@ static void wpa_driver_nl80211_rfkill_un - } - /* rtnetlink ifup handler will report interface as enabled */ - } -+#endif /* CONFIG_RFKILL */ - - - static void wpa_driver_nl80211_handle_eapol_tx_status(int sock, -@@ -3740,7 +3743,9 @@ static void * wpa_driver_nl80211_drv_ini - const u8 *set_addr) - { - struct wpa_driver_nl80211_data *drv; -+#ifdef CONFIG_RFKILL - struct rfkill_config *rcfg; -+#endif - struct i802_bss *bss; - - if (global_priv == NULL) -@@ -3778,6 +3783,7 @@ static void * wpa_driver_nl80211_drv_ini - if (nl80211_init_bss(bss)) - goto failed; - -+#ifdef CONFIG_RFKILL - rcfg = os_zalloc(sizeof(*rcfg)); - if (rcfg == NULL) - goto failed; -@@ -3790,6 +3796,7 @@ static void * wpa_driver_nl80211_drv_ini - wpa_printf(MSG_DEBUG, "nl80211: RFKILL status not available"); - os_free(rcfg); - } -+#endif /* CONFIG_RFKILL */ - - if (linux_iface_up(drv->global->ioctl_sock, ifname) > 0) - drv->start_iface_up = 1; -@@ -4116,10 +4123,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 void nl80211_del_p2pdev(struct i802_bss *bss) -@@ -4246,13 +4255,16 @@ wpa_driver_nl80211_finish_drv_init(struc - } - - 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; -@@ -4268,8 +4280,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; -@@ -4347,7 +4361,9 @@ static void wpa_driver_nl80211_deinit(st - - 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 -@@ -740,7 +740,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"); -@@ -762,7 +762,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) - { -@@ -808,7 +808,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; - -@@ -843,6 +845,7 @@ void * wpa_driver_wext_init(void *ctx, c - goto err2; - } - -+#ifdef CONFIG_RFKILL - rcfg = os_zalloc(sizeof(*rcfg)); - if (rcfg == NULL) - goto err3; -@@ -855,6 +858,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; - -@@ -872,7 +876,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); -@@ -882,10 +888,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) -@@ -893,13 +901,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; -@@ -947,8 +958,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; -@@ -978,7 +991,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 @@ -247,15 +32,30 @@ endif ifdef CONFIG_VLAN_NETLINK ---- 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; +--- a/src/drivers/rfkill.h ++++ b/src/drivers/rfkill.h +@@ -18,8 +18,24 @@ struct rfkill_config { + void (*unblocked_cb)(void *ctx); + }; + +#ifdef CONFIG_RFKILL - struct rfkill_data *rfkill; + struct rfkill_data * rfkill_init(struct rfkill_config *cfg); + void rfkill_deinit(struct rfkill_data *rfkill); + int rfkill_is_blocked(struct rfkill_data *rfkill); ++#else ++static inline struct rfkill_data * rfkill_init(struct rfkill_config *cfg) ++{ ++ return (void *) 1; ++} ++ ++static inline void rfkill_deinit(struct rfkill_data *rfkill) ++{ ++} ++ ++static inline int rfkill_is_blocked(struct rfkill_data *rfkill) ++{ ++ return 0; ++} +#endif - u8 *assoc_req_ies; - size_t assoc_req_ies_len; - u8 *assoc_resp_ies; + + #endif /* RFKILL_H */ diff --git a/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch b/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch index a505a6089d..9dbfb5ae04 100644 --- a/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch +++ b/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch @@ -1,6 +1,6 @@ --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -6860,7 +6860,7 @@ static int wpa_driver_nl80211_set_freq(s +@@ -7323,7 +7323,7 @@ static int wpa_driver_nl80211_set_freq(s nl80211_cmd(drv, msg, 0, NL80211_CMD_SET_WIPHY); @@ -9,7 +9,7 @@ if (nl80211_put_freq_params(msg, freq) < 0) goto nla_put_failure; -@@ -11322,7 +11322,7 @@ static int nl80211_switch_channel(void * +@@ -11840,7 +11840,7 @@ static int nl80211_switch_channel(void * return -ENOMEM; nl80211_cmd(drv, msg, 0, NL80211_CMD_CHANNEL_SWITCH); diff --git a/package/network/services/hostapd/patches/340-reload_freq_change.patch b/package/network/services/hostapd/patches/340-reload_freq_change.patch index 9316794817..d76f9de02f 100644 --- a/package/network/services/hostapd/patches/340-reload_freq_change.patch +++ b/package/network/services/hostapd/patches/340-reload_freq_change.patch @@ -1,6 +1,6 @@ --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -72,6 +72,16 @@ static void hostapd_reload_bss(struct ho +@@ -68,6 +68,16 @@ static void hostapd_reload_bss(struct ho #endif /* CONFIG_NO_RADIUS */ ssid = &hapd->conf->ssid; @@ -17,7 +17,7 @@ if (!ssid->wpa_psk_set && ssid->wpa_psk && !ssid->wpa_psk->next && ssid->wpa_passphrase_set && ssid->wpa_passphrase) { /* -@@ -172,6 +182,9 @@ int hostapd_reload_config(struct hostapd +@@ -168,20 +178,12 @@ int hostapd_reload_config(struct hostapd oldconf = hapd->iconf; iface->conf = newconf; @@ -27,3 +27,17 @@ for (j = 0; j < iface->num_bss; j++) { hapd = iface->bss[j]; hapd->iconf = newconf; +- hapd->iconf->channel = oldconf->channel; +- hapd->iconf->secondary_channel = oldconf->secondary_channel; +- hapd->iconf->ieee80211n = oldconf->ieee80211n; +- hapd->iconf->ieee80211ac = oldconf->ieee80211ac; +- hapd->iconf->ht_capab = oldconf->ht_capab; +- hapd->iconf->vht_capab = oldconf->vht_capab; +- hapd->iconf->vht_oper_chwidth = oldconf->vht_oper_chwidth; +- hapd->iconf->vht_oper_centr_freq_seg0_idx = +- oldconf->vht_oper_centr_freq_seg0_idx; +- hapd->iconf->vht_oper_centr_freq_seg1_idx = +- oldconf->vht_oper_centr_freq_seg1_idx; + hapd->conf = newconf->bss[j]; + hostapd_reload_bss(hapd); + } diff --git a/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch b/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch index 885922cdf1..011f24530a 100644 --- a/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch +++ b/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch @@ -1,6 +1,6 @@ --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -4290,18 +4290,20 @@ wpa_driver_nl80211_finish_drv_init(struc +@@ -4701,18 +4701,20 @@ wpa_driver_nl80211_finish_drv_init(struc } @@ -24,7 +24,7 @@ return send_and_recv_msgs(drv, msg, NULL, NULL); nla_put_failure: -@@ -4309,6 +4311,15 @@ static int wpa_driver_nl80211_del_beacon +@@ -4720,6 +4722,15 @@ static int wpa_driver_nl80211_del_beacon return -ENOBUFS; } @@ -40,7 +40,7 @@ /** * wpa_driver_nl80211_deinit - Deinitialize nl80211 driver interface -@@ -9911,7 +9922,6 @@ static int wpa_driver_nl80211_stop_ap(vo +@@ -10412,7 +10423,6 @@ static int wpa_driver_nl80211_stop_ap(vo if (!is_ap_interface(drv->nlmode)) return -1; wpa_driver_nl80211_del_beacon(drv); diff --git a/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch b/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch index 170d4f2f0c..e69c3d38b6 100644 --- a/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch +++ b/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch @@ -1,6 +1,6 @@ --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -34,6 +34,7 @@ +@@ -37,6 +37,7 @@ #include "wps/wps.h" #include "config_file.h" #include "ctrl_iface.h" @@ -8,7 +8,7 @@ struct wpa_ctrl_dst { -@@ -44,6 +45,7 @@ struct wpa_ctrl_dst { +@@ -47,6 +48,7 @@ struct wpa_ctrl_dst { int errors; }; @@ -16,7 +16,7 @@ static void hostapd_ctrl_iface_send(struct hostapd_data *hapd, int level, const char *buf, size_t len); -@@ -153,6 +155,68 @@ static int hostapd_ctrl_iface_new_sta(st +@@ -156,6 +158,68 @@ static int hostapd_ctrl_iface_new_sta(st return 0; } @@ -85,14 +85,14 @@ #ifdef CONFIG_IEEE80211W #ifdef NEED_AP_MLME -@@ -1199,6 +1263,10 @@ static void hostapd_ctrl_iface_receive(i - reply_len += res; - } - #endif /* CONFIG_NO_RADIUS */ +@@ -1546,6 +1610,10 @@ static void hostapd_ctrl_iface_receive(i + } else if (os_strncmp(buf, "VENDOR ", 7) == 0) { + reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply, + reply_size); + } else if (os_strcmp(buf, "DOWN") == 0) { + hostapd_ctrl_iface_set_down(hapd); + } else if (os_strncmp(buf, "UPDATE ", 7) == 0) { + hostapd_ctrl_iface_update(hapd, buf + 7); - } else if (os_strcmp(buf, "STA-FIRST") == 0) { - reply_len = hostapd_ctrl_iface_sta_first(hapd, reply, - reply_size); + + } else { + os_memcpy(reply, "UNKNOWN COMMAND\n", 16); diff --git a/package/network/services/hostapd/patches/370-ap_sta_support.patch b/package/network/services/hostapd/patches/370-ap_sta_support.patch index a3d05727eb..b4e1df2a26 100644 --- a/package/network/services/hostapd/patches/370-ap_sta_support.patch +++ b/package/network/services/hostapd/patches/370-ap_sta_support.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h -@@ -96,6 +96,11 @@ struct wpa_interface { +@@ -108,6 +108,11 @@ struct wpa_interface { const char *ifname; /** @@ -12,7 +12,7 @@ * bridge_ifname - Optional bridge interface name * * If the driver interface (ifname) is included in a Linux bridge -@@ -325,6 +330,8 @@ struct wpa_supplicant { +@@ -395,6 +400,8 @@ struct wpa_supplicant { #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */ char bridge_ifname[16]; @@ -20,12 +20,12 @@ + char *confname; char *confanother; - struct wpa_config *conf; + --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile @@ -13,6 +13,10 @@ PKG_CONFIG ?= pkg-config - CFLAGS += -I../src - CFLAGS += -I../src/utils + CFLAGS += -I$(abspath ../src) + CFLAGS += -I$(abspath ../src/utils) +ifdef MULTICALL +CFLAGS += -DMULTICALL @@ -34,7 +34,7 @@ -include .config -include $(if $(MULTICALL),../hostapd/.config) -@@ -76,6 +80,8 @@ OBJS_c = wpa_cli.o ../src/common/wpa_ctr +@@ -82,6 +86,8 @@ OBJS_c = wpa_cli.o ../src/common/wpa_ctr OBJS_c += ../src/utils/wpa_debug.o OBJS_c += ../src/utils/common.o @@ -45,9 +45,9 @@ CONFIG_OS=win32 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -109,6 +109,46 @@ extern int wpa_debug_show_keys; - extern int wpa_debug_timestamp; - extern struct wpa_driver_ops *wpa_drivers[]; +@@ -104,6 +104,46 @@ const char *wpa_supplicant_full_license5 + "\n"; + #endif /* CONFIG_NO_STDOUT_DEBUG */ +static int hostapd_stop(struct wpa_supplicant *wpa_s) +{ @@ -92,7 +92,7 @@ /* Configure default/group WEP keys for static WEP */ int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) { -@@ -685,8 +725,12 @@ void wpa_supplicant_set_state(struct wpa +@@ -702,8 +742,12 @@ void wpa_supplicant_set_state(struct wpa #endif /* CONFIG_P2P */ sme_sched_obss_scan(wpa_s, 1); @@ -105,7 +105,7 @@ wpa_s->new_connection = 1; wpa_drv_set_operstate(wpa_s, 0); #ifndef IEEE8021X_EAPOL -@@ -2906,6 +2950,20 @@ static int wpa_supplicant_init_iface(str +@@ -3505,6 +3549,20 @@ static int wpa_supplicant_init_iface(str sizeof(wpa_s->bridge_ifname)); } @@ -126,7 +126,7 @@ /* RSNA Supplicant Key Management - INITIALIZE */ eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE); eapol_sm_notify_portValid(wpa_s->eapol, FALSE); -@@ -3125,6 +3183,11 @@ static void wpa_supplicant_deinit_iface( +@@ -3698,6 +3756,11 @@ static void wpa_supplicant_deinit_iface( if (terminate) wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING); @@ -148,9 +148,9 @@ #include "drivers/driver.h" #include "wpa_supplicant_i.h" #include "config.h" -@@ -245,6 +246,9 @@ static void calculate_update_time(const +@@ -247,6 +248,9 @@ static void calculate_update_time(const static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src, - struct os_time *fetch_time) + struct os_reltime *fetch_time) { + struct ieee80211_ht_capabilities *capab; + struct ieee802_11_elems elems; @@ -158,7 +158,7 @@ dst->flags = src->flags; os_memcpy(dst->bssid, src->bssid, ETH_ALEN); dst->freq = src->freq; -@@ -255,6 +259,12 @@ static void wpa_bss_copy_res(struct wpa_ +@@ -257,6 +261,12 @@ static void wpa_bss_copy_res(struct wpa_ dst->level = src->level; dst->tsf = src->tsf; @@ -173,16 +173,16 @@ --- a/wpa_supplicant/main.c +++ b/wpa_supplicant/main.c -@@ -27,7 +27,7 @@ static void usage(void) - " wpa_supplicant [-BddhKLqqstuvW] [-P] " +@@ -33,7 +33,7 @@ static void usage(void) + "vW] [-P] " "[-g] \\\n" " [-G] \\\n" - " -i -c [-C] [-D] " + " -i -c [-C] [-D] [-H] " "[-p] \\\n" - " [-b] [-f] [-e] " - "\\\n" -@@ -72,6 +72,7 @@ static void usage(void) + " [-b] [-e]" + #ifdef CONFIG_DEBUG_FILE +@@ -84,6 +84,7 @@ static void usage(void) #endif /* CONFIG_DEBUG_LINUX_TRACING */ printf(" -t = include timestamp in debug messages\n" " -h = show this help text\n" @@ -190,16 +190,16 @@ " -L = show license (BSD)\n" " -o = override driver parameter for new interfaces\n" " -O = override ctrl_interface parameter for new interfaces\n" -@@ -160,7 +161,7 @@ int main(int argc, char *argv[]) +@@ -175,7 +176,7 @@ int main(int argc, char *argv[]) for (;;) { c = getopt(argc, argv, -- "b:Bc:C:D:de:f:g:G:hi:I:KLNo:O:p:P:qsTtuvW"); -+ "b:Bc:C:D:de:f:g:G:hH:i:I:KLNo:O:p:P:qsTtuvW"); +- "b:Bc:C:D:de:f:g:G:hi:I:KLm:No:O:p:P:qsTtuvW"); ++ "b:Bc:C:D:de:f:g:G:hH:i:I:KLm:No:O:p:P:qsTtuvW"); if (c < 0) break; switch (c) { -@@ -207,6 +208,9 @@ int main(int argc, char *argv[]) +@@ -222,6 +223,9 @@ int main(int argc, char *argv[]) usage(); exitcode = 0; goto out; @@ -211,7 +211,7 @@ break; --- a/wpa_supplicant/bss.h +++ b/wpa_supplicant/bss.h -@@ -69,6 +69,8 @@ struct wpa_bss { +@@ -70,6 +70,8 @@ struct wpa_bss { u8 ssid[32]; /** Length of SSID */ size_t ssid_len; diff --git a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch index 27f21bdb8f..40d3a9305b 100644 --- a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch +++ b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch @@ -1,6 +1,6 @@ --- a/hostapd/Makefile +++ b/hostapd/Makefile -@@ -144,6 +144,9 @@ endif +@@ -163,6 +163,9 @@ endif ifdef CONFIG_NO_CTRL_IFACE CFLAGS += -DCONFIG_NO_CTRL_IFACE else @@ -12,28 +12,15 @@ endif --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -1234,6 +1234,7 @@ static void hostapd_ctrl_iface_receive(i - } else if (os_strcmp(buf, "STATUS") == 0) { - reply_len = hostapd_ctrl_iface_status(hapd, reply, +@@ -1447,6 +1447,7 @@ static void hostapd_ctrl_iface_receive(i reply_size); + } else if (os_strcmp(buf, "STATUS-DRIVER") == 0) { + reply_len = hostapd_drv_status(hapd, reply, reply_size); +#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) { -@@ -1263,10 +1264,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, "UPDATE ", 7) == 0) { - hostapd_ctrl_iface_update(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); -@@ -1276,6 +1279,7 @@ static void hostapd_ctrl_iface_receive(i +@@ -1488,6 +1489,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); @@ -43,7 +30,7 @@ reply_len = -1; --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -778,6 +778,9 @@ ifdef CONFIG_WNM +@@ -797,6 +797,9 @@ ifdef CONFIG_WNM OBJS += ../src/ap/wnm_ap.o endif ifdef CONFIG_CTRL_IFACE @@ -55,7 +42,7 @@ --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c -@@ -5262,6 +5262,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -6100,6 +6100,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); @@ -63,7 +50,7 @@ } else if (os_strcmp(buf, "MIB") == 0) { reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size); if (reply_len >= 0) { -@@ -5273,6 +5274,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -6111,6 +6112,7 @@ char * wpa_supplicant_ctrl_iface_process else reply_len += res; } @@ -71,7 +58,7 @@ } else if (os_strncmp(buf, "STATUS", 6) == 0) { reply_len = wpa_supplicant_ctrl_iface_status( wpa_s, buf + 6, reply, reply_size); -@@ -5687,6 +5689,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -6518,6 +6520,7 @@ char * wpa_supplicant_ctrl_iface_process reply_len = wpa_supplicant_ctrl_iface_bss( wpa_s, buf + 4, reply, reply_size); #ifdef CONFIG_AP @@ -79,7 +66,7 @@ } 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) { -@@ -5695,6 +5698,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -6526,6 +6529,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); @@ -89,15 +76,15 @@ reply_len = -1; --- a/src/ap/ctrl_iface_ap.c +++ b/src/ap/ctrl_iface_ap.c -@@ -20,6 +20,7 @@ +@@ -21,6 +21,7 @@ #include "ctrl_iface_ap.h" #include "ap_drv_ops.h" +#ifdef CONFIG_CTRL_IFACE_MIB - static int hostapd_get_sta_conn_time(struct sta_info *sta, - char *buf, size_t buflen) -@@ -129,6 +130,7 @@ int hostapd_ctrl_iface_sta_next(struct h + static int hostapd_get_sta_tx_rx(struct hostapd_data *hapd, + struct sta_info *sta, +@@ -214,6 +215,7 @@ int hostapd_ctrl_iface_sta_next(struct h return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen); } @@ -105,14 +92,14 @@ #ifdef CONFIG_P2P_MANAGER static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype, -@@ -423,3 +425,4 @@ int hostapd_parse_csa_settings(const cha +@@ -524,3 +526,4 @@ int hostapd_parse_csa_settings(const cha return 0; } + --- a/src/ap/ieee802_1x.c +++ b/src/ap/ieee802_1x.c -@@ -1938,6 +1938,7 @@ static const char * bool_txt(Boolean boo +@@ -2124,6 +2124,7 @@ static const char * bool_txt(Boolean boo return bool_val ? "TRUE" : "FALSE"; } @@ -120,17 +107,17 @@ int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen) { -@@ -2090,6 +2091,7 @@ int ieee802_1x_get_mib_sta(struct hostap +@@ -2291,6 +2292,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) + struct sta_info *sta, int success, --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c -@@ -2708,6 +2708,7 @@ static const char * wpa_bool_txt(int boo +@@ -2830,6 +2830,7 @@ static const char * wpa_bool_txt(int boo return bool ? "TRUE" : "FALSE"; } @@ -138,7 +125,7 @@ #define RSN_SUITE "%02x-%02x-%02x-%d" #define RSN_SUITE_ARG(s) \ -@@ -2852,7 +2853,7 @@ int wpa_get_mib_sta(struct wpa_state_mac +@@ -2974,7 +2975,7 @@ int wpa_get_mib_sta(struct wpa_state_mac return len; } @@ -149,7 +136,7 @@ { --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -1844,6 +1844,8 @@ static u32 wpa_key_mgmt_suite(struct wpa +@@ -1910,6 +1910,8 @@ static u32 wpa_key_mgmt_suite(struct wpa } @@ -158,7 +145,7 @@ #define RSN_SUITE "%02x-%02x-%02x-%d" #define RSN_SUITE_ARG(s) \ ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff -@@ -1927,6 +1929,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch +@@ -1993,6 +1995,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch return (int) len; } diff --git a/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch b/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch index 00a32229d4..40148fc60e 100644 --- a/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch +++ b/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch @@ -1,6 +1,6 @@ --- a/src/common/wpa_common.c +++ b/src/common/wpa_common.c -@@ -959,6 +959,31 @@ const char * wpa_key_mgmt_txt(int key_mg +@@ -1002,6 +1002,31 @@ const char * wpa_key_mgmt_txt(int key_mg } @@ -32,7 +32,7 @@ int wpa_compare_rsn_ie(int ft_initial_assoc, const u8 *ie1, size_t ie1len, const u8 *ie2, size_t ie2len) -@@ -966,8 +991,19 @@ int wpa_compare_rsn_ie(int ft_initial_as +@@ -1009,8 +1034,19 @@ int wpa_compare_rsn_ie(int ft_initial_as if (ie1 == NULL || ie2 == NULL) return -1; diff --git a/package/network/services/hostapd/patches/400-terminate_on_setup_failure.patch b/package/network/services/hostapd/patches/400-terminate_on_setup_failure.patch deleted file mode 100644 index 0d9065ab2e..0000000000 --- a/package/network/services/hostapd/patches/400-terminate_on_setup_failure.patch +++ /dev/null @@ -1,85 +0,0 @@ ---- a/src/ap/hostapd.c -+++ b/src/ap/hostapd.c -@@ -1103,13 +1103,8 @@ int hostapd_setup_interface_complete(str - size_t j; - u8 *prev_addr; - -- if (err) { -- wpa_printf(MSG_ERROR, "Interface initialization failed"); -- hostapd_set_state(iface, HAPD_IFACE_DISABLED); -- if (iface->interfaces && iface->interfaces->terminate_on_error) -- eloop_terminate(); -- return -1; -- } -+ if (err) -+ goto error; - - wpa_printf(MSG_DEBUG, "Completing interface initialization"); - if (iface->conf->channel) { -@@ -1140,7 +1135,7 @@ int hostapd_setup_interface_complete(str - hapd->iconf->vht_oper_centr_freq_seg1_idx)) { - wpa_printf(MSG_ERROR, "Could not set channel for " - "kernel driver"); -- return -1; -+ goto error; - } - } - -@@ -1151,7 +1146,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; - } - } - -@@ -1159,14 +1154,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; -@@ -1176,7 +1171,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; - } -@@ -1191,7 +1186,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; - } - - /* -@@ -1216,6 +1211,13 @@ int hostapd_setup_interface_complete(str - iface->interfaces->terminate_on_error--; - - return 0; -+ -+error: -+ wpa_printf(MSG_ERROR, "Interface initialization failed"); -+ hostapd_set_state(iface, HAPD_IFACE_DISABLED); -+ if (iface->interfaces && iface->interfaces->terminate_on_error) -+ eloop_terminate(); -+ return -1; - } - - diff --git a/package/network/services/hostapd/patches/410-bring_down_interface.patch b/package/network/services/hostapd/patches/410-bring_down_interface.patch index 31033a01a4..fc61ed5e0c 100644 --- a/package/network/services/hostapd/patches/410-bring_down_interface.patch +++ b/package/network/services/hostapd/patches/410-bring_down_interface.patch @@ -1,6 +1,6 @@ --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -8480,12 +8480,7 @@ static int wpa_driver_nl80211_set_mode(s +@@ -8873,12 +8873,7 @@ static int wpa_driver_nl80211_set_mode(s /* Try to set the mode again while the interface is * down */ ret = nl80211_set_mode(drv, drv->ifindex, nlmode); @@ -14,7 +14,7 @@ break; } else wpa_printf(MSG_DEBUG, "nl80211: Failed to set " -@@ -8498,6 +8493,8 @@ static int wpa_driver_nl80211_set_mode(s +@@ -8891,6 +8886,8 @@ static int wpa_driver_nl80211_set_mode(s "interface is down"); drv->nlmode = nlmode; drv->ignore_if_down_event = 1; diff --git a/package/network/services/hostapd/patches/420-fix_wps_pin_crash.patch b/package/network/services/hostapd/patches/420-fix_wps_pin_crash.patch index 130bd53e08..31995c43fe 100644 --- a/package/network/services/hostapd/patches/420-fix_wps_pin_crash.patch +++ b/package/network/services/hostapd/patches/420-fix_wps_pin_crash.patch @@ -1,6 +1,6 @@ --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -480,6 +480,9 @@ static int hostapd_ctrl_iface_wps_ap_pin +@@ -540,6 +540,9 @@ static int hostapd_ctrl_iface_wps_ap_pin char *pos; const char *pin_txt; diff --git a/package/network/services/hostapd/patches/430-wps_single_auth_enc_type.patch b/package/network/services/hostapd/patches/430-wps_single_auth_enc_type.patch index 6e86658857..8dae52b277 100644 --- a/package/network/services/hostapd/patches/430-wps_single_auth_enc_type.patch +++ b/package/network/services/hostapd/patches/430-wps_single_auth_enc_type.patch @@ -1,6 +1,6 @@ --- a/src/ap/wps_hostapd.c +++ b/src/ap/wps_hostapd.c -@@ -1069,11 +1069,9 @@ int hostapd_init_wps(struct hostapd_data +@@ -1051,11 +1051,9 @@ int hostapd_init_wps(struct hostapd_data if (conf->rsn_pairwise & WPA_CIPHER_CCMP) wps->encr_types |= WPS_ENCR_AES; @@ -14,7 +14,7 @@ if (conf->wpa_key_mgmt & WPA_KEY_MGMT_PSK) wps->auth_types |= WPS_AUTH_WPAPSK; if (conf->wpa_key_mgmt & WPA_KEY_MGMT_IEEE8021X) -@@ -1081,7 +1079,7 @@ int hostapd_init_wps(struct hostapd_data +@@ -1063,7 +1061,7 @@ int hostapd_init_wps(struct hostapd_data if (conf->wpa_pairwise & WPA_CIPHER_CCMP) wps->encr_types |= WPS_ENCR_AES; diff --git a/package/network/services/hostapd/patches/440-dynamic_20_40_mhz.patch b/package/network/services/hostapd/patches/440-dynamic_20_40_mhz.patch index 905ec2c1b4..24ab2d52ee 100644 --- a/package/network/services/hostapd/patches/440-dynamic_20_40_mhz.patch +++ b/package/network/services/hostapd/patches/440-dynamic_20_40_mhz.patch @@ -1,19 +1,19 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -2422,6 +2422,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); - } else if (os_strcmp(buf, "obss_interval") == 0) { +@@ -2644,6 +2644,10 @@ static int hostapd_config_fill(struct ho + line); + return 1; + } ++ } 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); + } else if (os_strcmp(buf, "obss_interval") == 0) { --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -531,6 +531,7 @@ struct hostapd_config { +@@ -580,6 +580,7 @@ struct hostapd_config { int ieee80211n; int secondary_channel; int require_ht; @@ -23,7 +23,7 @@ int ieee80211ac; --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -23,6 +23,7 @@ +@@ -22,6 +22,7 @@ #include "beacon.h" #include "iapp.h" #include "ieee802_1x.h" @@ -31,7 +31,7 @@ #include "ieee802_11_auth.h" #include "vlan_init.h" #include "wpa_auth.h" -@@ -332,6 +333,7 @@ static void hostapd_cleanup(struct hosta +@@ -328,6 +329,7 @@ static void hostapd_cleanup(struct hosta static void hostapd_cleanup_iface_partial(struct hostapd_iface *iface) { wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); @@ -41,7 +41,7 @@ os_free(iface->current_rates); --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h -@@ -326,6 +326,9 @@ struct hostapd_iface { +@@ -330,6 +330,9 @@ struct hostapd_iface { /* Overlapping BSS information */ int olbc_ht; @@ -53,7 +53,7 @@ /* surveying helpers */ --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -1538,6 +1538,9 @@ static void handle_beacon(struct hostapd +@@ -1556,6 +1556,9 @@ static void handle_beacon(struct hostapd sizeof(mgmt->u.beacon)), &elems, 0); @@ -65,7 +65,7 @@ --- a/src/ap/ieee802_11.h +++ b/src/ap/ieee802_11.h -@@ -82,4 +82,17 @@ int hostapd_update_time_adv(struct hosta +@@ -83,4 +83,17 @@ int hostapd_update_time_adv(struct hosta void hostapd_client_poll_ok(struct hostapd_data *hapd, const u8 *addr); u8 * hostapd_eid_bss_max_idle_period(struct hostapd_data *hapd, u8 *eid); @@ -85,8 +85,8 @@ #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" +@@ -13,9 +13,11 @@ + #include "common/ieee802_11_defs.h" #include "hostapd.h" #include "ap_config.h" +#include "ap_drv_ops.h" @@ -97,7 +97,7 @@ u8 * hostapd_eid_ht_capabilities(struct hostapd_data *hapd, u8 *eid) -@@ -86,12 +88,15 @@ u8 * hostapd_eid_ht_operation(struct hos +@@ -92,12 +94,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); @@ -119,7 +119,7 @@ pos += sizeof(*oper); -@@ -286,3 +291,84 @@ void hostapd_get_ht_capab(struct hostapd +@@ -291,3 +296,84 @@ void hostapd_get_ht_capab(struct hostapd neg_ht_cap->ht_capabilities_info = host_to_le16(cap); } diff --git a/package/network/services/hostapd/patches/450-limit_debug_messages.patch b/package/network/services/hostapd/patches/450-limit_debug_messages.patch index aaea94137f..08f17dc012 100644 --- a/package/network/services/hostapd/patches/450-limit_debug_messages.patch +++ b/package/network/services/hostapd/patches/450-limit_debug_messages.patch @@ -20,40 +20,41 @@ { size_t i; -@@ -375,20 +375,9 @@ static void _wpa_hexdump(int level, cons +@@ -375,20 +375,8 @@ 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) +-void wpa_hexdump(int level, const char *title, const void *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) +-void wpa_hexdump_key(int level, const char *title, const void *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, +- +-static void _wpa_hexdump_ascii(int level, const char *title, const void *buf, - size_t len, int show) -+void _wpa_hexdump_ascii(int level, const char *title, const u8 *buf, ++void _wpa_hexdump_ascii(int level, const char *title, const void *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 +@@ -495,20 +483,6 @@ static void _wpa_hexdump_ascii(int level } --void wpa_hexdump_ascii(int level, const char *title, const u8 *buf, size_t len) +-void wpa_hexdump_ascii(int level, const char *title, const void *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, +-void wpa_hexdump_ascii_key(int level, const char *title, const void *buf, - size_t len) -{ - _wpa_hexdump_ascii(level, title, buf, len, wpa_debug_show_keys); @@ -63,7 +64,7 @@ #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_ +@@ -592,7 +566,7 @@ void wpa_msg_register_ifname_cb(wpa_msg_ } @@ -72,7 +73,7 @@ { va_list ap; char *buf; -@@ -625,7 +601,7 @@ void wpa_msg(void *ctx, int level, const +@@ -630,7 +604,7 @@ void wpa_msg(void *ctx, int level, const } @@ -83,14 +84,14 @@ 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 +@@ -47,6 +47,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, ++void _wpa_hexdump_ascii(int level, const char *title, const void *buf, + size_t len, int show); +extern int wpa_debug_show_keys; + @@ -101,7 +102,7 @@ /** * wpa_debug_printf_timestamp - Print timestamp for debug output * -@@ -63,9 +74,15 @@ void wpa_debug_print_timestamp(void); +@@ -67,9 +78,15 @@ void wpa_debug_print_timestamp(void); * * Note: New line '\n' is added to the end of the text when printing to stdout. */ @@ -118,11 +119,11 @@ /** * wpa_hexdump - conditional hex dump * @level: priority level (MSG_*) of the message -@@ -77,7 +94,13 @@ PRINTF_FORMAT(2, 3); +@@ -81,7 +98,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); +-void wpa_hexdump(int level, const char *title, const void *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) @@ -133,11 +134,11 @@ 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 +@@ -103,7 +126,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); +-void wpa_hexdump_key(int level, const char *title, const void *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) @@ -148,11 +149,11 @@ 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 +@@ -125,8 +154,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, +-void wpa_hexdump_ascii(int level, const char *title, const void *buf, - size_t len); +static inline void wpa_hexdump_ascii(int level, const char *title, + const u8 *buf, size_t len) @@ -165,11 +166,11 @@ /** * wpa_hexdump_ascii_key - conditional hex dump, hide keys -@@ -138,8 +173,14 @@ void wpa_hexdump_ascii(int level, const +@@ -142,8 +177,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, +-void wpa_hexdump_ascii_key(int level, const char *title, const void *buf, - size_t len); +static inline void wpa_hexdump_ascii_key(int level, const char *title, + const u8 *buf, size_t len) @@ -182,7 +183,7 @@ /* * wpa_dbg() behaves like wpa_msg(), but it can be removed from build to reduce -@@ -174,7 +215,12 @@ void wpa_hexdump_ascii_key(int level, co +@@ -178,7 +219,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. */ @@ -196,7 +197,7 @@ /** * wpa_msg_ctrl - Conditional printf for ctrl_iface monitors -@@ -188,8 +234,13 @@ void wpa_msg(void *ctx, int level, const +@@ -192,8 +238,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. */ diff --git a/package/network/services/hostapd/patches/460-indicate-features.patch b/package/network/services/hostapd/patches/460-indicate-features.patch index 7a44da122b..cee3e76777 100644 --- a/package/network/services/hostapd/patches/460-indicate-features.patch +++ b/package/network/services/hostapd/patches/460-indicate-features.patch @@ -1,23 +1,23 @@ --- a/hostapd/main.c +++ b/hostapd/main.c -@@ -14,6 +14,7 @@ - +@@ -15,6 +15,7 @@ #include "utils/common.h" #include "utils/eloop.h" + #include "utils/uuid.h" +#include "utils/build_features.h" #include "crypto/random.h" #include "crypto/tls.h" #include "common/version.h" -@@ -546,7 +547,7 @@ int main(int argc, char *argv[]) +@@ -558,7 +559,7 @@ int main(int argc, char *argv[]) wpa_supplicant_event = hostapd_wpa_event; for (;;) { -- c = getopt(argc, argv, "b:Bde:f:hKP:Ttvg:G:"); -+ c = getopt(argc, argv, "b:Bde:f:hKP:Ttg:G:v::"); +- c = getopt(argc, argv, "b:Bde:f:hKP:Ttu:vg:G:"); ++ c = getopt(argc, argv, "b:Bde:f:hKP:Ttu:g:G:v::"); if (c < 0) break; switch (c) { -@@ -583,6 +584,8 @@ int main(int argc, char *argv[]) +@@ -595,6 +596,8 @@ int main(int argc, char *argv[]) break; #endif /* CONFIG_DEBUG_LINUX_TRACING */ case 'v': @@ -36,16 +36,16 @@ #include "wpa_supplicant_i.h" #include "driver_i.h" #include "p2p_supplicant.h" -@@ -161,7 +162,7 @@ int main(int argc, char *argv[]) +@@ -176,7 +177,7 @@ int main(int argc, char *argv[]) for (;;) { c = getopt(argc, argv, -- "b:Bc:C:D:de:f:g:G:hH:i:I:KLNo:O:p:P:qsTtuvW"); -+ "b:Bc:C:D:de:f:g:G:hH:i:I:KLNo:O:p:P:qsTtuv::W"); +- "b:Bc:C:D:de:f:g:G:hH:i:I:KLm:No:O:p:P:qsTtuvW"); ++ "b:Bc:C:D:de:f:g:G:hH:i:I:KLm:No:O:p:P:qsTtuv::W"); if (c < 0) break; switch (c) { -@@ -259,8 +260,12 @@ int main(int argc, char *argv[]) +@@ -279,8 +280,12 @@ int main(int argc, char *argv[]) break; #endif /* CONFIG_DBUS */ case 'v': diff --git a/package/network/services/hostapd/patches/470-hostapd_cli_ifdef.patch b/package/network/services/hostapd/patches/470-hostapd_cli_ifdef.patch index 5ac0fddf70..d4a0f1280a 100644 --- a/package/network/services/hostapd/patches/470-hostapd_cli_ifdef.patch +++ b/package/network/services/hostapd/patches/470-hostapd_cli_ifdef.patch @@ -16,7 +16,7 @@ " get_config show current configuration\n" " help show this usage help\n" " interface [ifname] show interfaces/select interface\n" -@@ -352,7 +350,6 @@ static int hostapd_cli_cmd_sa_query(stru +@@ -362,7 +360,6 @@ static int hostapd_cli_cmd_sa_query(stru #endif /* CONFIG_IEEE80211W */ @@ -24,7 +24,7 @@ static int hostapd_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc, char *argv[]) { -@@ -578,7 +575,6 @@ static int hostapd_cli_cmd_wps_config(st +@@ -588,7 +585,6 @@ static int hostapd_cli_cmd_wps_config(st ssid_hex, argv[1]); return wpa_ctrl_command(ctrl, buf); } @@ -32,7 +32,7 @@ static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc, -@@ -903,7 +899,6 @@ static struct hostapd_cli_cmd hostapd_cl +@@ -979,7 +975,6 @@ static struct hostapd_cli_cmd hostapd_cl #ifdef CONFIG_IEEE80211W { "sa_query", hostapd_cli_cmd_sa_query }, #endif /* CONFIG_IEEE80211W */ @@ -40,7 +40,7 @@ { "wps_pin", hostapd_cli_cmd_wps_pin }, { "wps_check_pin", hostapd_cli_cmd_wps_check_pin }, { "wps_pbc", hostapd_cli_cmd_wps_pbc }, -@@ -917,7 +912,6 @@ static struct hostapd_cli_cmd hostapd_cl +@@ -993,7 +988,6 @@ static struct hostapd_cli_cmd hostapd_cl { "wps_ap_pin", hostapd_cli_cmd_wps_ap_pin }, { "wps_config", hostapd_cli_cmd_wps_config }, { "wps_get_status", hostapd_cli_cmd_wps_get_status }, diff --git a/package/network/services/hostapd/patches/471-wpa_cli_ifdef.patch b/package/network/services/hostapd/patches/471-wpa_cli_ifdef.patch index cc8444416a..36b5a441f9 100644 --- a/package/network/services/hostapd/patches/471-wpa_cli_ifdef.patch +++ b/package/network/services/hostapd/patches/471-wpa_cli_ifdef.patch @@ -10,4 +10,4 @@ + static const char *wpa_cli_version = "wpa_cli v" VERSION_STR "\n" - "Copyright (c) 2004-2013, Jouni Malinen and contributors"; + "Copyright (c) 2004-2014, Jouni Malinen and contributors"; diff --git a/package/network/services/hostapd/patches/480-max_num_sta_probe.patch b/package/network/services/hostapd/patches/480-max_num_sta_probe.patch index e5ca8b4434..608a9b5ad9 100644 --- a/package/network/services/hostapd/patches/480-max_num_sta_probe.patch +++ b/package/network/services/hostapd/patches/480-max_num_sta_probe.patch @@ -1,6 +1,6 @@ --- a/src/ap/beacon.c +++ b/src/ap/beacon.c -@@ -501,6 +501,10 @@ void handle_probe_req(struct hostapd_dat +@@ -599,6 +599,10 @@ void handle_probe_req(struct hostapd_dat return; } diff --git a/package/network/services/hostapd/patches/490-scan_wait.patch b/package/network/services/hostapd/patches/490-scan_wait.patch index 61715d6a98..3459a61de8 100644 --- a/package/network/services/hostapd/patches/490-scan_wait.patch +++ b/package/network/services/hostapd/patches/490-scan_wait.patch @@ -1,15 +1,15 @@ --- a/hostapd/main.c +++ b/hostapd/main.c -@@ -33,6 +33,8 @@ - extern int wpa_debug_level; - extern int wpa_debug_show_keys; - extern int wpa_debug_timestamp; +@@ -36,6 +36,8 @@ struct hapd_global { + }; + + static struct hapd_global global; +static int daemonize = 0; +static char *pid_file = NULL; - extern struct wpa_driver_ops *wpa_drivers[]; -@@ -147,6 +149,14 @@ static void hostapd_logger_cb(void *ctx, + #ifndef CONFIG_NO_HOSTAPD_LOGGER +@@ -141,6 +143,14 @@ static void hostapd_logger_cb(void *ctx, } #endif /* CONFIG_NO_HOSTAPD_LOGGER */ @@ -24,7 +24,7 @@ /** * hostapd_driver_init - Preparate driver interface -@@ -165,6 +175,8 @@ static int hostapd_driver_init(struct ho +@@ -159,6 +169,8 @@ static int hostapd_driver_init(struct ho return -1; } @@ -33,7 +33,7 @@ /* Initialize the driver interface */ if (!(b[0] | b[1] | b[2] | b[3] | b[4] | b[5])) b = NULL; -@@ -381,8 +393,6 @@ static void hostapd_global_deinit(const +@@ -372,8 +384,6 @@ static void hostapd_global_deinit(const #endif /* CONFIG_NATIVE_WINDOWS */ eap_server_unregister_methods(); @@ -42,7 +42,7 @@ } -@@ -408,11 +418,6 @@ static int hostapd_global_run(struct hap +@@ -399,11 +409,6 @@ static int hostapd_global_run(struct hap } #endif /* EAP_SERVER_TNC */ @@ -54,7 +54,7 @@ eloop_run(); return 0; -@@ -521,8 +526,7 @@ int main(int argc, char *argv[]) +@@ -533,8 +538,7 @@ int main(int argc, char *argv[]) struct hapd_interfaces interfaces; int ret = 1; size_t i, j; diff --git a/package/network/services/hostapd/patches/500-wpa_supplicant-add-new-config-params-to-be-used-with.patch b/package/network/services/hostapd/patches/500-wpa_supplicant-add-new-config-params-to-be-used-with.patch index 544151ef2b..62ef7c7516 100644 --- a/package/network/services/hostapd/patches/500-wpa_supplicant-add-new-config-params-to-be-used-with.patch +++ b/package/network/services/hostapd/patches/500-wpa_supplicant-add-new-config-params-to-be-used-with.patch @@ -22,9 +22,9 @@ Signed-hostap: Antonio Quartulli #include "common/defs.h" #include "utils/list.h" -@@ -404,6 +405,11 @@ struct wpa_driver_associate_params { - */ - int freq; +@@ -406,6 +407,11 @@ struct wpa_driver_associate_params { + * responsible for selecting with which BSS to associate. */ + const u8 *bssid; + int beacon_interval; + int fixed_freq; @@ -32,11 +32,11 @@ Signed-hostap: Antonio Quartulli + 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 + * bssid_hint - BSSID of a proposed AP + * --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c -@@ -14,6 +14,7 @@ +@@ -15,6 +15,7 @@ #include "rsn_supp/wpa.h" #include "eap_peer/eap.h" #include "p2p/p2p.h" @@ -44,7 +44,7 @@ Signed-hostap: Antonio Quartulli #include "config.h" -@@ -1512,6 +1513,97 @@ static char * wpa_config_write_psk_list( +@@ -1527,6 +1528,97 @@ static char * wpa_config_write_psk_list( #endif /* CONFIG_P2P */ @@ -142,7 +142,7 @@ Signed-hostap: Antonio Quartulli /* Helper macros for network block parser */ #ifdef OFFSET -@@ -1715,6 +1807,9 @@ static const struct parse_data ssid_fiel +@@ -1731,6 +1823,9 @@ static const struct parse_data ssid_fiel { INT(ap_max_inactivity) }, { INT(dtim_period) }, { INT(beacon_int) }, @@ -162,7 +162,7 @@ Signed-hostap: Antonio Quartulli #define MAX_SSID_LEN 32 -@@ -620,6 +621,10 @@ struct wpa_ssid { +@@ -630,6 +631,10 @@ struct wpa_ssid { * dereferences since it may not be updated in all cases. */ void *parent_cred; @@ -175,24 +175,11 @@ Signed-hostap: Antonio Quartulli #endif /* CONFIG_SSID_H */ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -1623,15 +1623,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; +@@ -1788,6 +1788,13 @@ static void wpas_start_assoc_cb(struct w + params.beacon_int = ssid->beacon_int; + else + params.beacon_int = wpa_s->conf->beacon_int; + params.fixed_freq = ssid->fixed_freq; -+ params.beacon_interval = ssid->beacon_int; + i = 0; + while (i < NL80211_MAX_SUPP_RATES) { + params.rates[i] = ssid->rates[i]; @@ -201,9 +188,4 @@ Signed-hostap: Antonio Quartulli + 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/network/services/hostapd/patches/501-driver_nl80211-use-new-parameters-during-ibss-join.patch b/package/network/services/hostapd/patches/501-driver_nl80211-use-new-parameters-during-ibss-join.patch index 565bbc9762..bcf15997f5 100644 --- a/package/network/services/hostapd/patches/501-driver_nl80211-use-new-parameters-during-ibss-join.patch +++ b/package/network/services/hostapd/patches/501-driver_nl80211-use-new-parameters-during-ibss-join.patch @@ -10,7 +10,7 @@ Signed-hostap: Antonio Quartulli --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -7903,7 +7903,7 @@ static int wpa_driver_nl80211_ibss(struc +@@ -8398,7 +8398,7 @@ static int wpa_driver_nl80211_ibss(struc struct wpa_driver_associate_params *params) { struct nl_msg *msg; @@ -19,9 +19,9 @@ Signed-hostap: Antonio Quartulli int count = 0; wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex); -@@ -7936,6 +7936,37 @@ retry: - wpa_printf(MSG_DEBUG, " * freq=%d", params->freq); - NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, params->freq); +@@ -8437,6 +8437,37 @@ retry: + params->beacon_int); + } + if (params->fixed_freq) { + wpa_printf(MSG_DEBUG, " * fixed_freq"); diff --git a/package/network/services/hostapd/patches/502-wpa_s-support-htmode-param.patch b/package/network/services/hostapd/patches/502-wpa_s-support-htmode-param.patch index adb20a25c5..8ffe364255 100644 --- a/package/network/services/hostapd/patches/502-wpa_s-support-htmode-param.patch +++ b/package/network/services/hostapd/patches/502-wpa_s-support-htmode-param.patch @@ -16,7 +16,7 @@ Signed-off-by: Antonio Quartulli --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -409,6 +409,8 @@ struct wpa_driver_associate_params { +@@ -411,6 +411,8 @@ struct wpa_driver_associate_params { int fixed_freq; unsigned char rates[NL80211_MAX_SUPP_RATES]; int mcast_rate; @@ -24,10 +24,10 @@ Signed-off-by: Antonio Quartulli + unsigned int htmode; /** - * bg_scan_period - Background scan period in seconds, 0 to disable + * bssid_hint - BSSID of a proposed AP --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -7967,6 +7967,22 @@ retry: +@@ -8468,6 +8468,22 @@ retry: NLA_PUT_U32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate); } @@ -52,7 +52,7 @@ Signed-off-by: Antonio Quartulli goto nla_put_failure; --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c -@@ -1544,6 +1544,71 @@ static char * wpa_config_write_mcast_rat +@@ -1559,6 +1559,71 @@ static char * wpa_config_write_mcast_rat } #endif /* NO_CONFIG_WRITE */ @@ -124,7 +124,7 @@ Signed-off-by: Antonio Quartulli static int wpa_config_parse_rates(const struct parse_data *data, struct wpa_ssid *ssid, int line, const char *value) -@@ -1810,6 +1875,7 @@ static const struct parse_data ssid_fiel +@@ -1826,6 +1891,7 @@ static const struct parse_data ssid_fiel { INT_RANGE(fixed_freq, 0, 1) }, { FUNC(rates) }, { FUNC(mcast_rate) }, @@ -134,7 +134,7 @@ Signed-off-by: Antonio Quartulli #undef OFFSET --- a/wpa_supplicant/config_ssid.h +++ b/wpa_supplicant/config_ssid.h -@@ -625,6 +625,8 @@ struct wpa_ssid { +@@ -635,6 +635,8 @@ struct wpa_ssid { int fixed_freq; unsigned char rates[NL80211_MAX_SUPP_RATES]; double mcast_rate; @@ -145,7 +145,7 @@ Signed-off-by: Antonio Quartulli #endif /* CONFIG_SSID_H */ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -1639,6 +1639,8 @@ void wpa_supplicant_associate(struct wpa +@@ -1795,6 +1795,8 @@ static void wpas_start_assoc_cb(struct w i++; } params.mcast_rate = ssid->mcast_rate; diff --git a/package/network/services/hostapd/patches/510-wpa_supplicant_p2p_parse_ifcomb.patch b/package/network/services/hostapd/patches/510-wpa_supplicant_p2p_parse_ifcomb.patch index fe72ee29c6..c2923cfca7 100644 --- a/package/network/services/hostapd/patches/510-wpa_supplicant_p2p_parse_ifcomb.patch +++ b/package/network/services/hostapd/patches/510-wpa_supplicant_p2p_parse_ifcomb.patch @@ -1,6 +1,6 @@ --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -3157,10 +3157,12 @@ static int wiphy_info_iface_comb_process +@@ -3444,10 +3444,12 @@ static int wiphy_info_iface_comb_process } if (combination_has_p2p && combination_has_mgd) { diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch index 96ac4f92da..4738da2fe1 100644 --- a/package/network/services/hostapd/patches/600-ubus_support.patch +++ b/package/network/services/hostapd/patches/600-ubus_support.patch @@ -1,6 +1,6 @@ --- a/hostapd/Makefile +++ b/hostapd/Makefile -@@ -105,6 +105,11 @@ OBJS += ../src/common/wpa_common.o +@@ -116,6 +116,11 @@ OBJS += ../src/common/wpa_common.o OBJS += ../src/eapol_auth/eapol_auth_sm.o @@ -10,19 +10,19 @@ +LIBS += -lubox -lubus +endif - ifndef CONFIG_NO_DUMP_STATE - # define HOSTAPD_DUMP_STATE to include SIGUSR1 handler for dumping state to + ifdef CONFIG_CODE_COVERAGE + CFLAGS += -O0 -fprofile-arcs -ftest-coverage --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h -@@ -11,6 +11,7 @@ - +@@ -12,6 +12,7 @@ #include "common/defs.h" #include "ap_config.h" + #include "drivers/driver.h" +#include "ubus.h" - struct wpa_driver_ops; struct wpa_ctrl_dst; -@@ -105,6 +106,7 @@ struct hostapd_data { + struct radius_server_data; +@@ -99,6 +100,7 @@ struct hostapd_data { struct hostapd_iface *iface; struct hostapd_config *iconf; struct hostapd_bss_config *conf; @@ -30,7 +30,7 @@ int interface_added; /* virtual interface added for this BSS */ unsigned int started:1; -@@ -256,6 +258,8 @@ struct hostapd_iface { +@@ -254,6 +256,8 @@ struct hostapd_iface { struct hostapd_config *conf; char phy[16]; /* Name of the PHY (radio) */ @@ -498,7 +498,7 @@ +#endif --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -265,6 +265,7 @@ static void hostapd_free_hapd_data(struc +@@ -261,6 +261,7 @@ static void hostapd_free_hapd_data(struc hapd->started = 0; wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface); @@ -506,7 +506,7 @@ iapp_deinit(hapd->iapp); hapd->iapp = NULL; accounting_deinit(hapd); -@@ -834,6 +835,8 @@ static int hostapd_setup_bss(struct host +@@ -864,6 +865,8 @@ static int hostapd_setup_bss(struct host if (hapd->driver && hapd->driver->set_operstate) hapd->driver->set_operstate(hapd->drv_priv, 1); @@ -515,23 +515,23 @@ return 0; } -@@ -1108,6 +1111,7 @@ int hostapd_setup_interface_complete(str +@@ -1154,6 +1157,7 @@ int hostapd_setup_interface_complete(str if (err) - goto error; + goto fail; + hostapd_ubus_add_iface(iface); wpa_printf(MSG_DEBUG, "Completing interface initialization"); if (iface->conf->channel) { #ifdef NEED_AP_MLME -@@ -1216,6 +1220,7 @@ int hostapd_setup_interface_complete(str +@@ -1265,6 +1269,7 @@ int hostapd_setup_interface_complete(str - error: + fail: wpa_printf(MSG_ERROR, "Interface initialization failed"); + hostapd_ubus_free_iface(iface); hostapd_set_state(iface, HAPD_IFACE_DISABLED); + wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); if (iface->interfaces && iface->interfaces->terminate_on_error) - eloop_terminate(); -@@ -1537,6 +1542,7 @@ void hostapd_interface_deinit_free(struc +@@ -1587,6 +1592,7 @@ void hostapd_interface_deinit_free(struc (unsigned int) iface->conf->num_bss); driver = iface->bss[0]->driver; drv_priv = iface->bss[0]->drv_priv; @@ -541,7 +541,7 @@ __func__, driver, drv_priv); --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -535,7 +535,8 @@ static void handle_auth_sae(struct hosta +@@ -542,7 +542,8 @@ failed: static void handle_auth(struct hostapd_data *hapd, @@ -551,7 +551,7 @@ { u16 auth_alg, auth_transaction, status_code; u16 resp = WLAN_STATUS_SUCCESS; -@@ -550,6 +551,11 @@ static void handle_auth(struct hostapd_d +@@ -557,6 +558,11 @@ static void handle_auth(struct hostapd_d size_t resp_ies_len = 0; char *identity = NULL; char *radius_cui = NULL; @@ -563,7 +563,7 @@ if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.auth)) { wpa_printf(MSG_INFO, "handle_auth - too short payload (len=%lu)", -@@ -633,6 +639,14 @@ static void handle_auth(struct hostapd_d +@@ -640,6 +646,14 @@ static void handle_auth(struct hostapd_d resp = WLAN_STATUS_UNSPECIFIED_FAILURE; goto fail; } @@ -578,7 +578,7 @@ if (res == HOSTAPD_ACL_PENDING) { wpa_printf(MSG_DEBUG, "Authentication frame from " MACSTR " waiting for an external authentication", -@@ -1245,13 +1259,18 @@ static void send_assoc_resp(struct hosta +@@ -1274,13 +1288,18 @@ static void send_assoc_resp(struct hosta static void handle_assoc(struct hostapd_data *hapd, const struct ieee80211_mgmt *mgmt, size_t len, @@ -598,7 +598,7 @@ if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_req) : sizeof(mgmt->u.assoc_req))) { -@@ -1350,6 +1369,13 @@ static void handle_assoc(struct hostapd_ +@@ -1379,6 +1398,13 @@ static void handle_assoc(struct hostapd_ goto fail; } @@ -612,37 +612,39 @@ sta->capability = capab_info; sta->listen_interval = listen_interval; -@@ -1759,7 +1785,7 @@ void ieee802_11_mgmt(struct hostapd_data +@@ -1760,7 +1786,7 @@ int ieee802_11_mgmt(struct hostapd_data if (stype == WLAN_FC_STYPE_PROBE_REQ) { - handle_probe_req(hapd, mgmt, len, fi->ssi_signal); + handle_probe_req(hapd, mgmt, len, fi); - return; + return 1; } -@@ -1774,15 +1800,15 @@ void ieee802_11_mgmt(struct hostapd_data +@@ -1775,17 +1801,17 @@ int ieee802_11_mgmt(struct hostapd_data switch (stype) { case WLAN_FC_STYPE_AUTH: wpa_printf(MSG_DEBUG, "mgmt::auth"); - handle_auth(hapd, mgmt, len); + handle_auth(hapd, mgmt, len, fi); + ret = 1; break; case WLAN_FC_STYPE_ASSOC_REQ: wpa_printf(MSG_DEBUG, "mgmt::assoc_req"); - handle_assoc(hapd, mgmt, len, 0); + handle_assoc(hapd, mgmt, len, 0, fi); + ret = 1; break; case WLAN_FC_STYPE_REASSOC_REQ: wpa_printf(MSG_DEBUG, "mgmt::reassoc_req"); - handle_assoc(hapd, mgmt, len, 1); + handle_assoc(hapd, mgmt, len, 1, fi); + ret = 1; break; case WLAN_FC_STYPE_DISASSOC: - wpa_printf(MSG_DEBUG, "mgmt::disassoc"); --- a/src/ap/beacon.c +++ b/src/ap/beacon.c -@@ -398,7 +398,7 @@ static enum ssid_match_result ssid_match +@@ -498,7 +498,7 @@ static enum ssid_match_result ssid_match void handle_probe_req(struct hostapd_data *hapd, const struct ieee80211_mgmt *mgmt, size_t len, @@ -651,7 +653,7 @@ { u8 *resp; struct ieee802_11_elems elems; -@@ -406,8 +406,14 @@ void handle_probe_req(struct hostapd_dat +@@ -506,8 +506,14 @@ void handle_probe_req(struct hostapd_dat size_t ie_len; struct sta_info *sta = NULL; size_t i, resp_len; @@ -666,7 +668,7 @@ ie = mgmt->u.probe_req.variable; if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.probe_req)) -@@ -546,6 +552,12 @@ void handle_probe_req(struct hostapd_dat +@@ -644,6 +650,12 @@ void handle_probe_req(struct hostapd_dat } #endif /* CONFIG_P2P */ @@ -681,12 +683,12 @@ --- a/src/ap/beacon.h +++ b/src/ap/beacon.h -@@ -20,7 +20,7 @@ struct ieee80211_mgmt; +@@ -14,7 +14,7 @@ struct ieee80211_mgmt; void handle_probe_req(struct hostapd_data *hapd, const struct ieee80211_mgmt *mgmt, size_t len, - int ssi_signal); + struct hostapd_frame_info *fi); - void ieee802_11_set_beacon(struct hostapd_data *hapd); - void ieee802_11_set_beacons(struct hostapd_iface *iface); - void ieee802_11_update_beacons(struct hostapd_iface *iface); + int ieee802_11_set_beacon(struct hostapd_data *hapd); + int ieee802_11_set_beacons(struct hostapd_iface *iface); + int ieee802_11_update_beacons(struct hostapd_iface *iface);