diff options
author | Felix Fietkau <nbd@openwrt.org> | 2014-03-14 10:53:39 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2014-03-14 10:53:39 +0000 |
commit | 9b1e65073a8b1a571c390a1041bfe7fcd07d97ba (patch) | |
tree | 3fb5ee70c7729cd9b53221d8d8b2ac5106fa8f18 | |
parent | 37c1e30ba04ada85de79fc75b6a8d7f0b6cb8600 (diff) | |
download | upstream-9b1e65073a8b1a571c390a1041bfe7fcd07d97ba.tar.gz upstream-9b1e65073a8b1a571c390a1041bfe7fcd07d97ba.tar.bz2 upstream-9b1e65073a8b1a571c390a1041bfe7fcd07d97ba.zip |
hostapd: backport package from trunk r39765
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/branches/attitude_adjustment@39927 3c298f89-4303-0410-b956-a3cf2f4a3e73
47 files changed, 969 insertions, 624 deletions
diff --git a/package/hostapd/Config.in b/package/hostapd/Config.in index 810c5a09a9..b39be38fd0 100644 --- a/package/hostapd/Config.in +++ b/package/hostapd/Config.in @@ -1,7 +1,7 @@ # wpa_supplicant config config WPA_SUPPLICANT_NO_TIMESTAMP_CHECK bool "Disable timestamp check" - depends PACKAGE_wpa-supplicant || PACKAGE_wpa-supplicant-mini || PACKAGE_wpad || PACKAGE_wpad-mini + depends on PACKAGE_wpa-supplicant || PACKAGE_wpa-supplicant-mini || PACKAGE_wpad || PACKAGE_wpad-mini default n help This disables the timestamp check for certificates in wpa_supplicant @@ -10,7 +10,7 @@ config WPA_SUPPLICANT_NO_TIMESTAMP_CHECK choice prompt "Choose TLS provider" default WPA_SUPPLICANT_INTERNAL - depends PACKAGE_wpa-supplicant || PACKAGE_wpad + depends on PACKAGE_wpa-supplicant || PACKAGE_wpad config WPA_SUPPLICANT_INTERNAL bool "internal" @@ -23,7 +23,7 @@ endchoice config WPA_RFKILL_SUPPORT bool "Add rfkill support" - depends PACKAGE_wpa-supplicant || PACKAGE_wpa-supplicant-mini || PACKAGE_wpad || PACKAGE_wpad-mini + depends on PACKAGE_wpa-supplicant || PACKAGE_wpa-supplicant-mini || PACKAGE_wpad || PACKAGE_wpad-mini default n config WPA_MSG_MIN_PRIORITY diff --git a/package/hostapd/Makefile b/package/hostapd/Makefile index 485a8fad0c..b4dc242f0f 100644 --- a/package/hostapd/Makefile +++ b/package/hostapd/Makefile @@ -8,16 +8,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_VERSION:=20130405 +PKG_VERSION:=20131120 PKG_RELEASE:=1 -PKG_REV:=f2f66ad7e805218468aa041985dccaf8719c296e +PKG_REV:=594516b4c28a94ca686b17f1e463dfd6712b75a7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=git://w1.fi/srv/git/hostap.git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_VERSION:=$(PKG_REV) PKG_SOURCE_PROTO:=git -PKG_MIRROR_MD5SUM:=5dff9bc3b8fbd9ef8a66273d5adee5a3 +# PKG_MIRROR_MD5SUM:=4e7c1f97edd7514535056fce54ae053a PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org> @@ -175,6 +175,17 @@ define Package/wpa-supplicant/config source "$(SOURCE)/Config.in" endef +define Package/wpa-supplicant-p2p + $(Package/wpa-supplicant) + TITLE:=WPA Supplicant (with Wi-Fi P2P support) + DEPENDS:=$(DRV_DEPENDS) + VARIANT:=supplicant-p2p +endef + +define Package/wpa-supplicant-p2p/Description + WPA Supplicant (with Wi-Fi P2P support) +endef + define Package/wpa-supplicant-mini $(Package/wpa-supplicant) TITLE:=WPA Supplicant (minimal version) @@ -189,7 +200,7 @@ endef define Package/wpa-cli SECTION:=net CATEGORY:=Network - DEPENDS:=@PACKAGE_wpa-supplicant||PACKAGE_wpad-mini||PACKAGE_wpad + DEPENDS:=@PACKAGE_wpa-supplicant||PACKAGE_wpa-supplicant-p2p||PACKAGE_wpad-mini||PACKAGE_wpad TITLE:=WPA Supplicant command line interface endef @@ -197,7 +208,6 @@ define Package/wpa-cli/Description WPA Supplicant control utility endef - ifneq ($(wildcard $(PKG_BUILD_DIR)/.config_*),$(subst .configured_,.config_,$(STAMP_CONFIGURED))) define Build/Configure/rebuild $(FIND) $(PKG_BUILD_DIR) -name \*.o -or -name \*.a | $(XARGS) rm -f @@ -210,7 +220,9 @@ endif define Build/Configure $(Build/Configure/rebuild) - $(CP) ./files/hostapd-$(LOCAL_VARIANT).config $(PKG_BUILD_DIR)/hostapd/.config + $(if $(wildcard ./files/hostapd-$(LOCAL_VARIANT).config), \ + $(CP) ./files/hostapd-$(LOCAL_VARIANT).config $(PKG_BUILD_DIR)/hostapd/.config \ + ) $(CP) ./files/wpa_supplicant-$(LOCAL_VARIANT).config $(PKG_BUILD_DIR)/wpa_supplicant/.config endef @@ -239,6 +251,7 @@ define Build/RunMake $(TARGET_CONFIGURE_OPTS) \ $(DRIVER_MAKEOPTS) \ LIBS="$(TARGET_LDFLAGS)" \ + LIBS_c="" \ BCHECK= \ $(2) endef @@ -303,14 +316,9 @@ Package/hostapd-mini/install = $(Package/hostapd/install) ifneq ($(LOCAL_TYPE),supplicant) define Package/hostapd-utils/install - $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/hotplug.d/button + $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/rc.button $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd_cli $(1)/usr/sbin/ - $(INSTALL_DATA) ./files/wps-hotplug.sh $(1)/etc/hotplug.d/button/50-wps - $(if $(CONFIG_PROCD_INIT), - $(INSTALL_DIR) $(1)/etc/rc.button/ - $(INSTALL_BIN) ./files/wps-hotplug.sh $(1)/etc/rc.button/wps, - $(INSTALL_DATA) ./files/wps-hotplug.sh $(1)/etc/hotplug.d/button/50-wps - ) + $(INSTALL_BIN) ./files/wps-hotplug.sh $(1)/etc/rc.button/wps endef endif @@ -328,6 +336,7 @@ define Package/wpa-supplicant/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/wpa_supplicant/wpa_supplicant $(1)/usr/sbin/ endef Package/wpa-supplicant-mini/install = $(Package/wpa-supplicant/install) +Package/wpa-supplicant-p2p/install = $(Package/wpa-supplicant/install) ifneq ($(LOCAL_TYPE),hostapd) define Package/wpa-cli/install @@ -342,5 +351,6 @@ $(eval $(call BuildPackage,wpad)) $(eval $(call BuildPackage,wpad-mini)) $(eval $(call BuildPackage,wpa-supplicant)) $(eval $(call BuildPackage,wpa-supplicant-mini)) +$(eval $(call BuildPackage,wpa-supplicant-p2p)) $(eval $(call BuildPackage,wpa-cli)) $(eval $(call BuildPackage,hostapd-utils)) diff --git a/package/hostapd/files/hostapd-full.config b/package/hostapd/files/hostapd-full.config index d558736db7..bc999c04a1 100644 --- a/package/hostapd/files/hostapd-full.config +++ b/package/hostapd/files/hostapd-full.config @@ -107,7 +107,8 @@ CONFIG_EAP_TTLS=y #CONFIG_EAP_FAST=y # Wi-Fi Protected Setup (WPS) -#CONFIG_WPS=y +CONFIG_WPS=y +CONFIG_WPS2=y # Enable UPnP support for external WPS Registrars #CONFIG_WPS_UPNP=y @@ -157,8 +158,12 @@ CONFIG_INTERNAL_LIBTOMMATH=y CONFIG_INTERNAL_AES=y NEED_AES_DEC=y +CONFIG_NO_RANDOM_POOL=y CONFIG_NO_DUMP_STATE=y CONFIG_WPS=y CONFIG_FULL_DYNAMIC_VLAN=y +CONFIG_ACS=y + +CONFIG_UBUS=y diff --git a/package/hostapd/files/hostapd-mini.config b/package/hostapd/files/hostapd-mini.config index 3e94a645b5..01a04cb237 100644 --- a/package/hostapd/files/hostapd-mini.config +++ b/package/hostapd/files/hostapd-mini.config @@ -154,4 +154,9 @@ CONFIG_NO_RADIUS=y CONFIG_TLS=internal +CONFIG_NO_RANDOM_POOL=y CONFIG_NO_DUMP_STATE=y + +CONFIG_ACS=y + +CONFIG_UBUS=y diff --git a/package/hostapd/files/hostapd.sh b/package/hostapd/files/hostapd.sh index 00c6a094cf..b55b63db7c 100644 --- a/package/hostapd/files/hostapd.sh +++ b/package/hostapd/files/hostapd.sh @@ -3,7 +3,7 @@ hostapd_set_bss_options() { local vif="$2" local enc wep_rekey wpa_group_rekey wpa_pair_rekey wpa_master_rekey wps_possible - config_get enc "$vif" encryption + config_get enc "$vif" encryption "none" config_get wep_rekey "$vif" wep_rekey # 300 config_get wpa_group_rekey "$vif" wpa_group_rekey # 300 config_get wpa_pair_rekey "$vif" wpa_pair_rekey # 300 @@ -73,6 +73,14 @@ hostapd_set_bss_options() { # use crypto/auth settings for building the hostapd config case "$enc" in + none) + wps_possible=1 + wpa=0 + crypto= + # Here we make the assumption that if we're in open mode + # with WPS enabled, we got to be in unconfigured state. + wps_not_configured=1 + ;; *psk*) config_get psk "$vif" key if [ ${#psk} -eq 64 ]; then @@ -85,7 +93,7 @@ hostapd_set_bss_options() { [ -n "$wpa_pair_rekey" ] && append "$var" "wpa_ptk_rekey=$wpa_pair_rekey" "$N" [ -n "$wpa_master_rekey" ] && append "$var" "wpa_gmk_rekey=$wpa_master_rekey" "$N" ;; - *wpa*) + *wpa*|*8021x*) # required fields? formats? # hostapd is particular, maybe a default configuration for failures config_get auth_server "$vif" auth_server @@ -98,9 +106,13 @@ hostapd_set_bss_options() { config_get auth_secret "$vif" auth_secret [ -z "$auth_secret" ] && config_get auth_secret "$vif" key append "$var" "auth_server_shared_secret=$auth_secret" "$N" + # You don't really want to enable this unless you are doing + # some corner case testing or are using OpenWrt as a work around + # for some systematic issues. config_get_bool auth_cache "$vif" auth_cache 0 - [ "$auth_cache" -gt 0 ] || append "$var" "disable_pmksa_caching=1" "$N" - [ "$auth_cache" -gt 0 ] || append "$var" "okc=0" "$N" + config_get rsn_preauth "$vif" rsn_preauth + [ "$auth_cache" -gt 0 ] || [[ "$rsn_preauth" = 1 ]] || append "$var" "disable_pmksa_caching=1" "$N" + [ "$auth_cache" -gt 0 ] || [[ "$rsn_preauth" = 1 ]] || append "$var" "okc=0" "$N" config_get acct_server "$vif" acct_server [ -n "$acct_server" ] && append "$var" "acct_server_addr=$acct_server" "$N" config_get acct_port "$vif" acct_port @@ -108,6 +120,15 @@ hostapd_set_bss_options() { [ -n "$acct_port" ] && append "$var" "acct_server_port=$acct_port" "$N" config_get acct_secret "$vif" acct_secret [ -n "$acct_secret" ] && append "$var" "acct_server_shared_secret=$acct_secret" "$N" + config_get eap_reauth_period "$vif" eap_reauth_period + [ -n "$eap_reauth_period" ] && append "$var" "eap_reauth_period=$eap_reauth_period" "$N" + config_get dae_client "$vif" dae_client + config_get dae_secret "$vif" dae_secret + [ -n "$dae_client" -a -n "$dae_secret" ] && { + config_get dae_port "$vif" dae_port + append "$var" "radius_das_port=${dae_port:-3799}" "$N" + append "$var" "radius_das_client=$dae_client $dae_secret" "$N" + } config_get nasid "$vif" nasid append "$var" "nas_identifier=$nasid" "$N" append "$var" "eapol_key_index_workaround=1" "$N" @@ -173,10 +194,15 @@ hostapd_set_bss_options() { config_get device_type "$vif" wps_device_type "6-0050F204-1" config_get device_name "$vif" wps_device_name "OpenWrt AP" config_get manufacturer "$vif" wps_manufacturer "openwrt.org" + config_get wps_pin "$vif" wps_pin "12345670" + + config_get_bool ext_registrar "$vif" ext_registrar 0 + [ "$ext_registrar" -gt 0 -a -n "$bridge" ] && append "$var" "upnp_iface=$bridge" "$N" append "$var" "eap_server=1" "$N" - append "$var" "wps_state=2" "$N" - append "$var" "ap_setup_locked=1" "$N" + append "$var" "ap_pin=$wps_pin" "$N" + append "$var" "wps_state=${wps_not_configured:-2}" "$N" + append "$var" "ap_setup_locked=0" "$N" append "$var" "device_type=$device_type" "$N" append "$var" "device_name=$device_name" "$N" append "$var" "manufacturer=$manufacturer" "$N" @@ -190,12 +216,25 @@ hostapd_set_bss_options() { if [ "$wpa" -ge "2" ] then - # RSN -> allow preauthentication - config_get_bool rsn_preauth "$vif" rsn_preauth "$auth_cache" + # RSN -> allow preauthentication. You have two + # options, rsn_preauth for production or rsn_preauth_testing + # for validation / testing. if [ -n "$bridge" -a "$rsn_preauth" = 1 ] then append "$var" "rsn_preauth=1" "$N" append "$var" "rsn_preauth_interfaces=$bridge" "$N" + append "$var" "okc=1" "$N" + else + # RSN preauthentication testings hould disable + # Opportunistic Key Caching (okc) as otherwise the PMKSA + # entry for a test could come from the Opportunistic Key Caching + config_get rsn_preauth_testing "$vif" rsn_preauth_testing + if [ -n "$bridge" -a "$rsn_preauth_testing" = 1 ] + then + append "$var" "rsn_preauth=1" "$N" + append "$var" "rsn_preauth_interfaces=$bridge" "$N" + append "$var" "okc=0" "$N" + fi fi # RSN -> allow management frame protection @@ -215,10 +254,33 @@ hostapd_set_bss_options() { esac fi - config_get macfilter "$vif" macfilter - macfile="/var/run/hostapd-$ifname.maclist" - [ -e "$macfile" ] && rm -f "$macfile" + config_get macfile "$vif" macfile + config_get maclist "$vif" maclist + if [ -z "$macfile" ] + then + # if no macfile has been specified, fallback to the default name + # and truncate file to avoid aggregating entries over time + macfile="/var/run/hostapd-$ifname.maclist" + echo "" > "$macfile" + else + if [ -n "$maclist" ] + then + # to avoid to overwrite the original file, make a copy + # before appending the entries specified by the maclist + # option + cp $macfile $macfile.maclist + macfile=$macfile.maclist + fi + fi + if [ -n "$maclist" ] + then + for mac in $maclist; do + echo "$mac" >> $macfile + done + fi + + config_get macfilter "$vif" macfilter case "$macfilter" in allow) append "$var" "macaddr_acl=1" "$N" @@ -229,12 +291,6 @@ hostapd_set_bss_options() { append "$var" "deny_mac_file=$macfile" "$N" ;; esac - config_get maclist "$vif" maclist - [ -n "$maclist" ] && { - for mac in $maclist; do - echo "$mac" >> $macfile - done - } } hostapd_set_log_options() { diff --git a/package/hostapd/files/wpa_supplicant-full.config b/package/hostapd/files/wpa_supplicant-full.config index f5abbad94f..bbfaa73c1b 100644 --- a/package/hostapd/files/wpa_supplicant-full.config +++ b/package/hostapd/files/wpa_supplicant-full.config @@ -403,6 +403,7 @@ CONFIG_INTERNAL_LIBTOMMATH_FAST=y #LIBS_p += -lbfd -liberty -lz #LIBS_c += -lbfd -liberty -lz +CONFIG_NO_RANDOM_POOL=y NEED_80211_COMMON=y CONFIG_IBSS_RSN=y diff --git a/package/hostapd/files/wpa_supplicant-mini.config b/package/hostapd/files/wpa_supplicant-mini.config index 772e1d9809..a33e6f0a6f 100644 --- a/package/hostapd/files/wpa_supplicant-mini.config +++ b/package/hostapd/files/wpa_supplicant-mini.config @@ -403,4 +403,5 @@ CONFIG_TLS=internal #LIBS_p += -lbfd -liberty -lz #LIBS_c += -lbfd -liberty -lz +CONFIG_NO_RANDOM_POOL=y NEED_80211_COMMON=y diff --git a/package/hostapd/files/wpa_supplicant-p2p.config b/package/hostapd/files/wpa_supplicant-p2p.config new file mode 100644 index 0000000000..82e0bf0c2a --- /dev/null +++ b/package/hostapd/files/wpa_supplicant-p2p.config @@ -0,0 +1,412 @@ +# Example wpa_supplicant build time configuration +# +# This file lists the configuration options that are used when building the +# hostapd binary. All lines starting with # are ignored. Configuration option +# lines must be commented out complete, if they are not to be included, i.e., +# just setting VARIABLE=n is not disabling that variable. +# +# This file is included in Makefile, so variables like CFLAGS and LIBS can also +# be modified from here. In most cases, these lines should use += in order not +# to override previous values of the variables. + + +# Uncomment following two lines and fix the paths if you have installed OpenSSL +# or GnuTLS in non-default location +#CFLAGS += -I/usr/local/openssl/include +#LIBS += -L/usr/local/openssl/lib + +# Some Red Hat versions seem to include kerberos header files from OpenSSL, but +# the kerberos files are not in the default include path. Following line can be +# used to fix build issues on such systems (krb5.h not found). +#CFLAGS += -I/usr/include/kerberos + +# Example configuration for various cross-compilation platforms + +#### sveasoft (e.g., for Linksys WRT54G) ###################################### +#CC=mipsel-uclibc-gcc +#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc +#CFLAGS += -Os +#CPPFLAGS += -I../src/include -I../../src/router/openssl/include +#LIBS += -L/opt/brcm/hndtools-mipsel-uclibc-0.9.19/lib -lssl +############################################################################### + +#### openwrt (e.g., for Linksys WRT54G) ####################################### +#CC=mipsel-uclibc-gcc +#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc +#CFLAGS += -Os +#CPPFLAGS=-I../src/include -I../openssl-0.9.7d/include \ +# -I../WRT54GS/release/src/include +#LIBS = -lssl +############################################################################### + + +# Driver interface for Host AP driver +CONFIG_DRIVER_HOSTAP=y + +# Driver interface for Agere driver +#CONFIG_DRIVER_HERMES=y +# Change include directories to match with the local setup +#CFLAGS += -I../../hcf -I../../include -I../../include/hcf +#CFLAGS += -I../../include/wireless + +# Driver interface for madwifi driver +# Deprecated; use CONFIG_DRIVER_WEXT=y instead. +#CONFIG_DRIVER_MADWIFI=y +# Set include directory to the madwifi source tree +#CFLAGS += -I../../madwifi + +# Driver interface for ndiswrapper +# Deprecated; use CONFIG_DRIVER_WEXT=y instead. +#CONFIG_DRIVER_NDISWRAPPER=y + +# Driver interface for Atmel driver +# CONFIG_DRIVER_ATMEL=y + +# Driver interface for old Broadcom driver +# Please note that the newer Broadcom driver ("hybrid Linux driver") supports +# Linux wireless extensions and does not need (or even work) with the old +# driver wrapper. Use CONFIG_DRIVER_WEXT=y with that driver. +#CONFIG_DRIVER_BROADCOM=y +# Example path for wlioctl.h; change to match your configuration +#CFLAGS += -I/opt/WRT54GS/release/src/include + +# Driver interface for Intel ipw2100/2200 driver +# Deprecated; use CONFIG_DRIVER_WEXT=y instead. +#CONFIG_DRIVER_IPW=y + +# Driver interface for Ralink driver +#CONFIG_DRIVER_RALINK=y + +# Driver interface for generic Linux wireless extensions +CONFIG_DRIVER_WEXT=y + +# Driver interface for Linux drivers using the nl80211 kernel interface +CONFIG_DRIVER_NL80211=y + +# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver) +#CONFIG_DRIVER_BSD=y +#CFLAGS += -I/usr/local/include +#LIBS += -L/usr/local/lib +#LIBS_p += -L/usr/local/lib +#LIBS_c += -L/usr/local/lib + +# Driver interface for Windows NDIS +#CONFIG_DRIVER_NDIS=y +#CFLAGS += -I/usr/include/w32api/ddk +#LIBS += -L/usr/local/lib +# For native build using mingw +#CONFIG_NATIVE_WINDOWS=y +# Additional directories for cross-compilation on Linux host for mingw target +#CFLAGS += -I/opt/mingw/mingw32/include/ddk +#LIBS += -L/opt/mingw/mingw32/lib +#CC=mingw32-gcc +# By default, driver_ndis uses WinPcap for low-level operations. This can be +# replaced with the following option which replaces WinPcap calls with NDISUIO. +# However, this requires that WZC is disabled (net stop wzcsvc) before starting +# wpa_supplicant. +# CONFIG_USE_NDISUIO=y + +# Driver interface for development testing +#CONFIG_DRIVER_TEST=y + +# Include client MLME (management frame processing) for test driver +# This can be used to test MLME operations in hostapd with the test interface. +# space. +#CONFIG_CLIENT_MLME=y + +# Driver interface for wired Ethernet drivers +CONFIG_DRIVER_WIRED=y + +# Driver interface for the Broadcom RoboSwitch family +#CONFIG_DRIVER_ROBOSWITCH=y + +# Driver interface for no driver (e.g., WPS ER only) +#CONFIG_DRIVER_NONE=y + +# Enable IEEE 802.1X Supplicant (automatically included if any EAP method is +# included) +CONFIG_IEEE8021X_EAPOL=y + +# EAP-MD5 +CONFIG_EAP_MD5=y + +# EAP-MSCHAPv2 +CONFIG_EAP_MSCHAPV2=y + +# EAP-TLS +CONFIG_EAP_TLS=y + +# EAL-PEAP +CONFIG_EAP_PEAP=y + +# EAP-TTLS +CONFIG_EAP_TTLS=y + +# EAP-FAST +# Note: Default OpenSSL package does not include support for all the +# functionality needed for EAP-FAST. If EAP-FAST is enabled with OpenSSL, +# the OpenSSL library must be patched (openssl-0.9.8d-tls-extensions.patch) +# to add the needed functions. +#CONFIG_EAP_FAST=y + +# EAP-GTC +CONFIG_EAP_GTC=y + +# EAP-OTP +CONFIG_EAP_OTP=y + +# EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used) +#CONFIG_EAP_SIM=y + +# EAP-PSK (experimental; this is _not_ needed for WPA-PSK) +#CONFIG_EAP_PSK=y + +# EAP-PAX +#CONFIG_EAP_PAX=y + +# LEAP +CONFIG_EAP_LEAP=y + +# EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used) +#CONFIG_EAP_AKA=y + +# EAP-AKA' (enable CONFIG_PCSC, if EAP-AKA' is used). +# This requires CONFIG_EAP_AKA to be enabled, too. +#CONFIG_EAP_AKA_PRIME=y + +# Enable USIM simulator (Milenage) for EAP-AKA +#CONFIG_USIM_SIMULATOR=y + +# EAP-SAKE +#CONFIG_EAP_SAKE=y + +# EAP-GPSK +#CONFIG_EAP_GPSK=y +# Include support for optional SHA256 cipher suite in EAP-GPSK +#CONFIG_EAP_GPSK_SHA256=y + +# EAP-TNC and related Trusted Network Connect support (experimental) +#CONFIG_EAP_TNC=y + +# Wi-Fi Protected Setup (WPS) +CONFIG_WPS=y + +# EAP-IKEv2 +#CONFIG_EAP_IKEV2=y + +# PKCS#12 (PFX) support (used to read private key and certificate file from +# a file that usually has extension .p12 or .pfx) +CONFIG_PKCS12=y + +# Smartcard support (i.e., private key on a smartcard), e.g., with openssl +# engine. +CONFIG_SMARTCARD=y + +# PC/SC interface for smartcards (USIM, GSM SIM) +# Enable this if EAP-SIM or EAP-AKA is included +#CONFIG_PCSC=y + +# Development testing +#CONFIG_EAPOL_TEST=y + +# Select control interface backend for external programs, e.g, wpa_cli: +# unix = UNIX domain sockets (default for Linux/*BSD) +# udp = UDP sockets using localhost (127.0.0.1) +# named_pipe = Windows Named Pipe (default for Windows) +# y = use default (backwards compatibility) +# If this option is commented out, control interface is not included in the +# build. +CONFIG_CTRL_IFACE=y + +# Include support for GNU Readline and History Libraries in wpa_cli. +# When building a wpa_cli binary for distribution, please note that these +# libraries are licensed under GPL and as such, BSD license may not apply for +# the resulting binary. +#CONFIG_READLINE=y + +# Remove debugging code that is printing out debug message to stdout. +# This can be used to reduce the size of the wpa_supplicant considerably +# if debugging code is not needed. The size reduction can be around 35% +# (e.g., 90 kB). +#CONFIG_NO_STDOUT_DEBUG=y + +# Remove WPA support, e.g., for wired-only IEEE 802.1X supplicant, to save +# 35-50 kB in code size. +#CONFIG_NO_WPA=y + +# Remove WPA2 support. This allows WPA to be used, but removes WPA2 code to +# save about 1 kB in code size when building only WPA-Personal (no EAP support) +# or 6 kB if building for WPA-Enterprise. +#CONFIG_NO_WPA2=y + +# Remove IEEE 802.11i/WPA-Personal ASCII passphrase support +# This option can be used to reduce code size by removing support for +# converting ASCII passphrases into PSK. If this functionality is removed, the +# PSK can only be configured as the 64-octet hexstring (e.g., from +# wpa_passphrase). This saves about 0.5 kB in code size. +#CONFIG_NO_WPA_PASSPHRASE=y + +# Disable scan result processing (ap_mode=1) to save code size by about 1 kB. +# This can be used if ap_scan=1 mode is never enabled. +#CONFIG_NO_SCAN_PROCESSING=y + +# Select configuration backend: +# file = text file (e.g., wpa_supplicant.conf; note: the configuration file +# path is given on command line, not here; this option is just used to +# select the backend that allows configuration files to be used) +# winreg = Windows registry (see win_example.reg for an example) +CONFIG_BACKEND=file + +# Remove configuration write functionality (i.e., to allow the configuration +# file to be updated based on runtime configuration changes). The runtime +# configuration can still be changed, the changes are just not going to be +# persistent over restarts. This option can be used to reduce code size by +# about 3.5 kB. +#CONFIG_NO_CONFIG_WRITE=y + +# Remove support for configuration blobs to reduce code size by about 1.5 kB. +#CONFIG_NO_CONFIG_BLOBS=y + +# Select program entry point implementation: +# main = UNIX/POSIX like main() function (default) +# main_winsvc = Windows service (read parameters from registry) +# main_none = Very basic example (development use only) +#CONFIG_MAIN=main + +# Select wrapper for operatins system and C library specific functions +# unix = UNIX/POSIX like systems (default) +# win32 = Windows systems +# none = Empty template +#CONFIG_OS=unix + +# Select event loop implementation +# eloop = select() loop (default) +# eloop_win = Windows events and WaitForMultipleObject() loop +# eloop_none = Empty template +#CONFIG_ELOOP=eloop + +# Select layer 2 packet implementation +# linux = Linux packet socket (default) +# pcap = libpcap/libdnet/WinPcap +# freebsd = FreeBSD libpcap +# winpcap = WinPcap with receive thread +# ndis = Windows NDISUIO (note: requires CONFIG_USE_NDISUIO=y) +# none = Empty template +#CONFIG_L2_PACKET=linux + +# PeerKey handshake for Station to Station Link (IEEE 802.11e DLS) +CONFIG_PEERKEY=y + +# IEEE 802.11w (management frame protection) +# This version is an experimental implementation based on IEEE 802.11w/D1.0 +# draft and is subject to change since the standard has not yet been finalized. +# Driver support is also needed for IEEE 802.11w. +CONFIG_IEEE80211W=y + +# Select TLS implementation +# openssl = OpenSSL (default) +# gnutls = GnuTLS (needed for TLS/IA, see also CONFIG_GNUTLS_EXTRA) +# internal = Internal TLSv1 implementation (experimental) +# none = Empty template +CONFIG_TLS=internal + +# Whether to enable TLS/IA support, which is required for EAP-TTLSv1. +# You need CONFIG_TLS=gnutls for this to have any effect. Please note that +# even though the core GnuTLS library is released under LGPL, this extra +# library uses GPL and as such, the terms of GPL apply to the combination +# of wpa_supplicant and GnuTLS if this option is enabled. BSD license may not +# apply for distribution of the resulting binary. +#CONFIG_GNUTLS_EXTRA=y + +# If CONFIG_TLS=internal is used, additional library and include paths are +# needed for LibTomMath. Alternatively, an integrated, minimal version of +# LibTomMath can be used. See beginning of libtommath.c for details on benefits +# and drawbacks of this option. +CONFIG_INTERNAL_LIBTOMMATH=y +#ifndef CONFIG_INTERNAL_LIBTOMMATH +#LTM_PATH=/usr/src/libtommath-0.39 +#CFLAGS += -I$(LTM_PATH) +#LIBS += -L$(LTM_PATH) +#LIBS_p += -L$(LTM_PATH) +#endif +# At the cost of about 4 kB of additional binary size, the internal LibTomMath +# can be configured to include faster routines for exptmod, sqr, and div to +# speed up DH and RSA calculation considerably +CONFIG_INTERNAL_LIBTOMMATH_FAST=y + +# Include NDIS event processing through WMI into wpa_supplicant/wpasvc. +# This is only for Windows builds and requires WMI-related header files and +# WbemUuid.Lib from Platform SDK even when building with MinGW. +#CONFIG_NDIS_EVENTS_INTEGRATED=y +#PLATFORMSDKLIB="/opt/Program Files/Microsoft Platform SDK/Lib" + +# Add support for old DBus control interface +# (fi.epitest.hostap.WPASupplicant) +#CONFIG_CTRL_IFACE_DBUS=y + +# Add support for new DBus control interface +# (fi.w1.hostap.wpa_supplicant1) +#CONFIG_CTRL_IFACE_DBUS_NEW=y + +# Add introspection support for new DBus control interface +#CONFIG_CTRL_IFACE_DBUS_INTRO=y + +# Add support for loading EAP methods dynamically as shared libraries. +# When this option is enabled, each EAP method can be either included +# statically (CONFIG_EAP_<method>=y) or dynamically (CONFIG_EAP_<method>=dyn). +# Dynamic EAP methods are build as shared objects (eap_*.so) and they need to +# be loaded in the beginning of the wpa_supplicant configuration file +# (see load_dynamic_eap parameter in the example file) before being used in +# the network blocks. +# +# Note that some shared parts of EAP methods are included in the main program +# and in order to be able to use dynamic EAP methods using these parts, the +# main program must have been build with the EAP method enabled (=y or =dyn). +# This means that EAP-TLS/PEAP/TTLS/FAST cannot be added as dynamic libraries +# unless at least one of them was included in the main build to force inclusion +# of the shared code. Similarly, at least one of EAP-SIM/AKA must be included +# in the main build to be able to load these methods dynamically. +# +# Please also note that using dynamic libraries will increase the total binary +# size. Thus, it may not be the best option for targets that have limited +# amount of memory/flash. +#CONFIG_DYNAMIC_EAP_METHODS=y + +# IEEE Std 802.11r-2008 (Fast BSS Transition) +#CONFIG_IEEE80211R=y + +# Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt) +#CONFIG_DEBUG_FILE=y + +# Enable privilege separation (see README 'Privilege separation' for details) +#CONFIG_PRIVSEP=y + +# Enable mitigation against certain attacks against TKIP by delaying Michael +# MIC error reports by a random amount of time between 0 and 60 seconds +#CONFIG_DELAYED_MIC_ERROR_REPORT=y + +# Enable tracing code for developer debugging +# This tracks use of memory allocations and other registrations and reports +# incorrect use with a backtrace of call (or allocation) location. +#CONFIG_WPA_TRACE=y +# For BSD, comment out these. +#LIBS += -lexecinfo +#LIBS_p += -lexecinfo +#LIBS_c += -lexecinfo + +# Use libbfd to get more details for developer debugging +# This enables use of libbfd to get more detailed symbols for the backtraces +# generated by CONFIG_WPA_TRACE=y. +#CONFIG_WPA_TRACE_BFD=y +# For BSD, comment out these. +#LIBS += -lbfd -liberty -lz +#LIBS_p += -lbfd -liberty -lz +#LIBS_c += -lbfd -liberty -lz + +CONFIG_NO_RANDOM_POOL=y +NEED_80211_COMMON=y + +CONFIG_IBSS_RSN=y + +CONFIG_P2P=y +CONFIG_AP=y diff --git a/package/hostapd/files/wpa_supplicant.sh b/package/hostapd/files/wpa_supplicant.sh index 0b5e1d391f..bd8680157a 100644 --- a/package/hostapd/files/wpa_supplicant.sh +++ b/package/hostapd/files/wpa_supplicant.sh @@ -119,13 +119,13 @@ wpa_supplicant_setup_vif() { ;; esac - local fixed_freq bssid1 beacon_interval brates mrate + local fixed_freq bssid1 beacon_int brates mrate config_get ifname "$vif" ifname config_get bridge "$vif" bridge config_get ssid "$vif" ssid config_get bssid "$vif" bssid bssid1=${bssid:+"bssid=$bssid"} - beacon_interval=${beacon_int:+"beacon_interval=$beacon_int"} + beacon_int=${beacon_int:+"beacon_int=$beacon_int"} local br brval brsub brstr [ -n "$basic_rate_list" ] && { @@ -163,7 +163,7 @@ network={ $proto $freq ${fixed:+"fixed_freq=1"} - $beacon_interval + $beacon_int $brates $mrate $ht_str diff --git a/package/hostapd/files/wps-hotplug.sh b/package/hostapd/files/wps-hotplug.sh index ffd3cf929b..058264a8db 100644 --- a/package/hostapd/files/wps-hotplug.sh +++ b/package/hostapd/files/wps-hotplug.sh @@ -1,7 +1,7 @@ #!/bin/sh if [ "$ACTION" = "pressed" -a "$BUTTON" = "wps" ]; then - for dir in /var/run/hostapd-*; do + for dir in /var/run/hostapd*; do [ -d "$dir" ] || continue hostapd_cli -p "$dir" wps_pbc done diff --git a/package/hostapd/patches/320-madwifi_key_fixes.patch b/package/hostapd/patches/100-madwifi_key_fixes.patch index 45a7ac6c83..dcd6d10bd6 100644 --- a/package/hostapd/patches/320-madwifi_key_fixes.patch +++ b/package/hostapd/patches/100-madwifi_key_fixes.patch @@ -1,6 +1,6 @@ --- a/src/drivers/driver_madwifi.c +++ b/src/drivers/driver_madwifi.c -@@ -453,7 +453,9 @@ wpa_driver_madwifi_set_key(const char *i +@@ -450,7 +450,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; -@@ -465,6 +467,20 @@ wpa_driver_madwifi_set_key(const char *i +@@ -462,6 +464,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/hostapd/patches/630-bool_fix.patch b/package/hostapd/patches/110-bool_fix.patch index 510b000027..9f82b0b057 100644 --- a/package/hostapd/patches/630-bool_fix.patch +++ b/package/hostapd/patches/110-bool_fix.patch @@ -1,6 +1,6 @@ --- a/src/ap/ieee802_1x.c +++ b/src/ap/ieee802_1x.c -@@ -2043,9 +2043,9 @@ void ieee802_1x_notify_pre_auth(struct e +@@ -1933,9 +1933,9 @@ void ieee802_1x_notify_pre_auth(struct e } @@ -11,4 +11,4 @@ + return bool_val ? "TRUE" : "FALSE"; } - #ifdef CONFIG_CTRL_IFACE_MIB + diff --git a/package/hostapd/patches/120-daemonize_fix.patch b/package/hostapd/patches/120-daemonize_fix.patch new file mode 100644 index 0000000000..20a1eb340b --- /dev/null +++ b/package/hostapd/patches/120-daemonize_fix.patch @@ -0,0 +1,97 @@ +--- a/src/utils/os_unix.c ++++ b/src/utils/os_unix.c +@@ -9,6 +9,7 @@ + #include "includes.h" + + #include <time.h> ++#include <fcntl.h> + + #ifdef ANDROID + #include <sys/capability.h> +@@ -154,59 +155,46 @@ int os_gmtime(os_time_t t, struct os_tm + return 0; + } + +- +-#ifdef __APPLE__ +-#include <fcntl.h> +-static int os_daemon(int nochdir, int noclose) ++int os_daemonize(const char *pid_file) + { +- int devnull; ++ int pid = 0, i, devnull; + +- if (chdir("/") < 0) +- return -1; ++#if defined(__uClinux__) || defined(__sun__) ++ return -1; ++#else /* defined(__uClinux__) || defined(__sun__) */ + +- devnull = open("/dev/null", O_RDWR); +- if (devnull < 0) ++#ifndef __APPLE__ ++ pid = fork(); ++ if (pid < 0) + return -1; ++#endif + +- if (dup2(devnull, STDIN_FILENO) < 0) { +- close(devnull); +- return -1; ++ if (pid > 0) { ++ if (pid_file) { ++ FILE *f = fopen(pid_file, "w"); ++ if (f) { ++ fprintf(f, "%u\n", pid); ++ fclose(f); ++ } ++ } ++ _exit(0); + } + +- if (dup2(devnull, STDOUT_FILENO) < 0) { +- close(devnull); ++ if (setsid() < 0) + return -1; +- } + +- if (dup2(devnull, STDERR_FILENO) < 0) { +- close(devnull); ++ if (chdir("/") < 0) + return -1; +- } +- +- return 0; +-} +-#else /* __APPLE__ */ +-#define os_daemon daemon +-#endif /* __APPLE__ */ + +- +-int os_daemonize(const char *pid_file) +-{ +-#if defined(__uClinux__) || defined(__sun__) +- return -1; +-#else /* defined(__uClinux__) || defined(__sun__) */ +- if (os_daemon(0, 0)) { +- perror("daemon"); ++ devnull = open("/dev/null", O_RDWR); ++ if (devnull < 0) + return -1; +- } + +- if (pid_file) { +- FILE *f = fopen(pid_file, "w"); +- if (f) { +- fprintf(f, "%u\n", getpid()); +- fclose(f); +- } +- } ++ for (i = 0; i <= STDERR_FILENO; i++) ++ dup2(devnull, i); ++ ++ if (devnull > 2) ++ close(devnull); + + return -0; + #endif /* defined(__uClinux__) || defined(__sun__) */ diff --git a/package/hostapd/patches/130-wds_sta_del_fix.patch b/package/hostapd/patches/130-wds_sta_del_fix.patch new file mode 100644 index 0000000000..06b69069e7 --- /dev/null +++ b/package/hostapd/patches/130-wds_sta_del_fix.patch @@ -0,0 +1,13 @@ +--- 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/hostapd/patches/410-multicall.patch b/package/hostapd/patches/200-multicall.patch index 723f5f6448..2289f517f8 100644 --- a/package/hostapd/patches/410-multicall.patch +++ b/package/hostapd/patches/200-multicall.patch @@ -8,7 +8,7 @@ ifndef CONFIG_OS ifdef CONFIG_NATIVE_WINDOWS -@@ -192,10 +193,14 @@ ifdef CONFIG_IEEE80211AC +@@ -200,10 +201,14 @@ ifdef CONFIG_IEEE80211AC CFLAGS += -DCONFIG_IEEE80211AC endif @@ -26,7 +26,7 @@ LIBS += $(DRV_AP_LIBS) ifdef CONFIG_L2_PACKET -@@ -860,6 +865,12 @@ install: all +@@ -890,6 +895,12 @@ install: all BCHECK=../src/drivers/build.hostapd @@ -39,7 +39,7 @@ hostapd: $(BCHECK) $(OBJS) $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) @$(E) " LD " $@ -@@ -898,6 +909,12 @@ HOBJS += ../src/crypto/aes-internal.o +@@ -928,6 +939,12 @@ HOBJS += ../src/crypto/aes-internal.o HOBJS += ../src/crypto/aes-internal-enc.o endif @@ -62,7 +62,7 @@ BINALL=wpa_supplicant wpa_cli -@@ -708,6 +709,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS +@@ -727,6 +728,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS LIBS += -ldl -rdynamic endif @@ -73,7 +73,7 @@ endif ifdef CONFIG_AP -@@ -716,9 +721,11 @@ NEED_EAP_COMMON=y +@@ -735,9 +740,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 -@@ -773,10 +780,18 @@ endif +@@ -799,10 +806,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 -@@ -1525,6 +1540,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) +@@ -1551,6 +1566,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 " $@ -@@ -1595,6 +1616,12 @@ eap_ikev2.so: ../src/eap_peer/eap_ikev2. +@@ -1625,6 +1646,12 @@ eap_eke.so: ../src/eap_peer/eap_eke.c .. %@.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 -@@ -3750,8 +3750,8 @@ union wpa_event_data { +@@ -4079,8 +4079,8 @@ union wpa_event_data { * Driver wrapper code should call this function whenever an event is received * from the driver. */ @@ -145,8 +145,8 @@ /* --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c -@@ -714,8 +714,8 @@ static void hostapd_event_eapol_rx(struc - } +@@ -844,8 +844,8 @@ static void hostapd_event_dfs_nop_finish + #endif /* NEED_AP_MLME */ -void wpa_supplicant_event(void *ctx, enum wpa_event_type event, @@ -158,7 +158,7 @@ #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 +@@ -817,8 +817,8 @@ static void wpa_priv_send_ft_response(st } @@ -169,7 +169,7 @@ { struct wpa_priv_interface *iface = ctx; -@@ -962,6 +962,7 @@ int main(int argc, char *argv[]) +@@ -960,6 +960,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 -@@ -2354,8 +2354,8 @@ static void wpa_supplicant_event_unprot_ +@@ -2710,8 +2710,8 @@ static void wpa_supplicant_update_channe } @@ -189,11 +189,11 @@ + 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 -@@ -3050,6 +3050,9 @@ static void wpa_supplicant_deinit_iface( - } +@@ -3138,6 +3138,9 @@ static void wpa_supplicant_deinit_iface( + os_free(wpa_s); } +extern void supplicant_event(void *ctx, enum wpa_event_type event, @@ -202,7 +202,7 @@ /** * wpa_supplicant_add_iface - Add a new network interface -@@ -3244,6 +3247,7 @@ struct wpa_global * wpa_supplicant_init( +@@ -3329,6 +3332,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 -@@ -554,6 +554,9 @@ static int hostapd_get_ctrl_iface_group( +@@ -511,6 +511,9 @@ static int hostapd_get_ctrl_iface_group( return 0; } @@ -222,13 +222,13 @@ int main(int argc, char *argv[]) { -@@ -579,6 +582,7 @@ int main(int argc, char *argv[]) +@@ -541,6 +544,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, "Bde:f:hKP:tvg:G:"); + c = getopt(argc, argv, "b:Bde:f:hKP:Ttvg:G:"); if (c < 0) --- a/src/drivers/drivers.c +++ b/src/drivers/drivers.c 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 be68ed1d44..0000000000 --- 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 -@@ -3290,6 +3290,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); -@@ -3607,17 +3608,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 -@@ -3636,7 +3632,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); -@@ -3646,7 +3642,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/400-noscan.patch b/package/hostapd/patches/300-noscan.patch index 18a218cb26..17e766161c 100644 --- a/package/hostapd/patches/400-noscan.patch +++ b/package/hostapd/patches/300-noscan.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -2464,6 +2464,8 @@ static int hostapd_config_fill(struct ho +@@ -2412,6 +2412,8 @@ static int hostapd_config_fill(struct ho } #endif /* CONFIG_IEEE80211W */ #ifdef CONFIG_IEEE80211N @@ -11,7 +11,7 @@ } else if (os_strcmp(buf, "ht_capab") == 0) { --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -511,6 +511,7 @@ struct hostapd_config { +@@ -527,6 +527,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 -@@ -494,7 +494,7 @@ static int ieee80211n_check_40mhz(struct +@@ -577,7 +577,7 @@ static int ieee80211n_check_40mhz(struct { struct wpa_driver_scan_params params; @@ -29,4 +29,4 @@ + if (!iface->conf->secondary_channel || iface->conf->noscan) return 0; /* HT40 not used */ - wpa_printf(MSG_DEBUG, "Scan for neighboring BSSes prior to enabling " + hostapd_set_state(iface, HAPD_IFACE_HT_SCAN); 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 a80c041d4a..0000000000 --- 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 -@@ -899,6 +899,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, -@@ -1006,6 +1010,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) { -@@ -3292,6 +3300,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; -@@ -8296,8 +8309,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/430-rescan_immediately.patch b/package/hostapd/patches/310-rescan_immediately.patch index 9d5fd324c4..043f07c627 100644 --- a/package/hostapd/patches/430-rescan_immediately.patch +++ b/package/hostapd/patches/310-rescan_immediately.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2443,7 +2443,7 @@ static struct wpa_supplicant * wpa_suppl +@@ -2488,7 +2488,7 @@ static struct wpa_supplicant * wpa_suppl if (wpa_s == NULL) return NULL; wpa_s->scan_req = INITIAL_SCAN_REQ; diff --git a/package/hostapd/patches/440-optional_rfkill.patch b/package/hostapd/patches/320-optional_rfkill.patch index 8a006df913..7ec51b1027 100644 --- a/package/hostapd/patches/440-optional_rfkill.patch +++ b/package/hostapd/patches/320-optional_rfkill.patch @@ -1,6 +1,6 @@ --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -218,7 +218,9 @@ struct wpa_driver_nl80211_data { +@@ -254,7 +254,9 @@ struct wpa_driver_nl80211_data { int if_removed; int if_disabled; int ignore_if_down_event; @@ -10,7 +10,7 @@ struct wpa_driver_capa capa; u8 *extended_capa, *extended_capa_mask; unsigned int extended_capa_len; -@@ -3128,7 +3130,7 @@ static int wpa_driver_nl80211_init_nl(st +@@ -3630,7 +3632,7 @@ static int wpa_driver_nl80211_init_nl(st return 0; } @@ -19,16 +19,16 @@ static void wpa_driver_nl80211_rfkill_blocked(void *ctx) { wpa_printf(MSG_DEBUG, "nl80211: RFKILL blocked"); -@@ -3151,6 +3153,7 @@ static void wpa_driver_nl80211_rfkill_un +@@ -3652,6 +3654,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) -@@ -3279,7 +3282,9 @@ static void * wpa_driver_nl80211_init(vo - void *global_priv) + 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 @@ -37,23 +37,23 @@ struct i802_bss *bss; if (global_priv == NULL) -@@ -3315,6 +3320,7 @@ static void * wpa_driver_nl80211_init(vo - - nl80211_get_phy_name(drv); +@@ -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; -@@ -3327,6 +3333,7 @@ static void * wpa_driver_nl80211_init(vo +@@ -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 (wpa_driver_nl80211_finish_drv_init(drv)) - goto failed; -@@ -3616,10 +3623,12 @@ static void nl80211_mgmt_unsubscribe(str + 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 } @@ -64,9 +64,9 @@ } +#endif /* CONFIG_RFKILL */ - static int - wpa_driver_nl80211_finish_drv_init_sta(struct wpa_driver_nl80211_data *drv, -@@ -3640,13 +3649,16 @@ wpa_driver_nl80211_finish_drv_init_sta(s + + 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)) { @@ -76,7 +76,7 @@ "interface '%s' due to rfkill", bss->ifname); drv->if_disabled = 1; - *send_rfkill_event = 1; + send_rfkill_event = 1; - } else { + } else +#endif @@ -84,7 +84,7 @@ wpa_printf(MSG_ERROR, "nl80211: Could not set " "interface '%s' UP", bss->ifname); return -1; -@@ -3677,8 +3689,10 @@ wpa_driver_nl80211_finish_drv_init(struc +@@ -4268,8 +4280,10 @@ wpa_driver_nl80211_finish_drv_init(struc return -1; if (send_rfkill_event) { @@ -95,7 +95,7 @@ } return 0; -@@ -3764,7 +3778,9 @@ static void wpa_driver_nl80211_deinit(st +@@ -4347,7 +4361,9 @@ static void wpa_driver_nl80211_deinit(st netlink_send_oper_ifla(drv->global->netlink, drv->ifindex, 0, IF_OPER_UP); @@ -107,7 +107,7 @@ --- a/src/drivers/driver_wext.c +++ b/src/drivers/driver_wext.c -@@ -742,7 +742,7 @@ static void wpa_driver_wext_event_rtm_de +@@ -740,7 +740,7 @@ static void wpa_driver_wext_event_rtm_de } } @@ -116,7 +116,7 @@ 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 +@@ -762,7 +762,7 @@ static void wpa_driver_wext_rfkill_unblo } /* rtnetlink ifup handler will report interface as enabled */ } @@ -125,7 +125,7 @@ static void wext_get_phy_name(struct wpa_driver_wext_data *drv) { -@@ -810,7 +810,9 @@ void * wpa_driver_wext_init(void *ctx, c +@@ -808,7 +808,9 @@ void * wpa_driver_wext_init(void *ctx, c { struct wpa_driver_wext_data *drv; struct netlink_config *cfg; @@ -135,7 +135,7 @@ char path[128]; struct stat buf; -@@ -845,6 +847,7 @@ void * wpa_driver_wext_init(void *ctx, c +@@ -843,6 +845,7 @@ void * wpa_driver_wext_init(void *ctx, c goto err2; } @@ -143,7 +143,7 @@ rcfg = os_zalloc(sizeof(*rcfg)); if (rcfg == NULL) goto err3; -@@ -857,6 +860,7 @@ void * wpa_driver_wext_init(void *ctx, c +@@ -855,6 +858,7 @@ void * wpa_driver_wext_init(void *ctx, c wpa_printf(MSG_DEBUG, "WEXT: RFKILL status not available"); os_free(rcfg); } @@ -151,7 +151,7 @@ drv->mlme_sock = -1; -@@ -874,7 +878,9 @@ void * wpa_driver_wext_init(void *ctx, c +@@ -872,7 +876,9 @@ void * wpa_driver_wext_init(void *ctx, c return drv; err3: @@ -161,7 +161,7 @@ netlink_deinit(drv->netlink); err2: close(drv->ioctl_sock); -@@ -884,10 +890,12 @@ err1: +@@ -882,10 +888,12 @@ err1: } @@ -174,7 +174,7 @@ 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 +@@ -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) { @@ -192,7 +192,7 @@ 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 +@@ -947,8 +958,10 @@ static int wpa_driver_wext_finish_drv_in 1, IF_OPER_DORMANT); if (send_rfkill_event) { @@ -203,7 +203,7 @@ } return 0; -@@ -980,7 +993,9 @@ void wpa_driver_wext_deinit(void *priv) +@@ -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); diff --git a/package/hostapd/patches/330-nl80211_fix_set_freq.patch b/package/hostapd/patches/330-nl80211_fix_set_freq.patch new file mode 100644 index 0000000000..a505a6089d --- /dev/null +++ b/package/hostapd/patches/330-nl80211_fix_set_freq.patch @@ -0,0 +1,20 @@ +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -6860,7 +6860,7 @@ static int wpa_driver_nl80211_set_freq(s + + nl80211_cmd(drv, msg, 0, NL80211_CMD_SET_WIPHY); + +- NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, drv->ifindex); ++ NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, bss->ifindex); + if (nl80211_put_freq_params(msg, freq) < 0) + goto nla_put_failure; + +@@ -11322,7 +11322,7 @@ static int nl80211_switch_channel(void * + return -ENOMEM; + + nl80211_cmd(drv, msg, 0, NL80211_CMD_CHANNEL_SWITCH); +- NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, drv->ifindex); ++ NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, bss->ifindex); + NLA_PUT_U32(msg, NL80211_ATTR_CH_SWITCH_COUNT, settings->cs_count); + ret = nl80211_put_freq_params(msg, &settings->freq_params); + if (ret) diff --git a/package/hostapd/patches/340-reload_freq_change.patch b/package/hostapd/patches/340-reload_freq_change.patch new file mode 100644 index 0000000000..9316794817 --- /dev/null +++ b/package/hostapd/patches/340-reload_freq_change.patch @@ -0,0 +1,29 @@ +--- a/src/ap/hostapd.c ++++ b/src/ap/hostapd.c +@@ -72,6 +72,16 @@ static void hostapd_reload_bss(struct ho + #endif /* CONFIG_NO_RADIUS */ + + ssid = &hapd->conf->ssid; ++ ++ hostapd_set_freq(hapd, hapd->iconf->hw_mode, hapd->iface->freq, ++ hapd->iconf->channel, ++ hapd->iconf->ieee80211n, ++ hapd->iconf->ieee80211ac, ++ hapd->iconf->secondary_channel, ++ hapd->iconf->vht_oper_chwidth, ++ hapd->iconf->vht_oper_centr_freq_seg0_idx, ++ hapd->iconf->vht_oper_centr_freq_seg1_idx); ++ + 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 + oldconf = hapd->iconf; + iface->conf = newconf; + ++ if (iface->conf->channel) ++ iface->freq = hostapd_hw_get_freq(hapd, iface->conf->channel); ++ + 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/350-nl80211_del_beacon_bss.patch index fdff9e7923..885922cdf1 100644 --- a/package/hostapd/patches/451-nl80211_del_beacon_bss.patch +++ b/package/hostapd/patches/350-nl80211_del_beacon_bss.patch @@ -1,6 +1,6 @@ --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -3699,16 +3699,18 @@ wpa_driver_nl80211_finish_drv_init(struc +@@ -4290,18 +4290,20 @@ wpa_driver_nl80211_finish_drv_init(struc } @@ -10,18 +10,21 @@ + struct wpa_driver_nl80211_data *drv = bss->drv; struct nl_msg *msg; -+ bss->beacon_set = 0; msg = nlmsg_alloc(); if (!msg) return -ENOMEM; ++ bss->beacon_set = 0; + wpa_printf(MSG_DEBUG, "nl80211: Remove beacon (ifindex=%d)", +- drv->ifindex); ++ bss->ifindex); 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: -@@ -3716,6 +3718,21 @@ static int wpa_driver_nl80211_del_beacon +@@ -4309,6 +4311,15 @@ static int wpa_driver_nl80211_del_beacon return -ENOBUFS; } @@ -29,35 +32,19 @@ +{ + struct i802_bss *bss; + -+ for (bss = &drv->first_bss; bss; bss = bss->next) ++ 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 -@@ -9855,4 +9872,5 @@ const struct wpa_driver_ops wpa_driver_n - .tdls_oper = nl80211_tdls_oper, - #endif /* CONFIG_TDLS */ - .update_ft_ies = wpa_driver_nl80211_update_ft_ies, -+ .stop_ap = wpa_driver_nl80211_stop_ap, - }; ---- a/src/drivers/driver.h -+++ b/src/drivers/driver.h -@@ -2095,6 +2095,9 @@ struct wpa_driver_ops { - */ - int (*probe_req_report)(void *priv, int report); +@@ -9911,7 +9922,6 @@ static int wpa_driver_nl80211_stop_ap(vo + if (!is_ap_interface(drv->nlmode)) + return -1; + wpa_driver_nl80211_del_beacon(drv); +- bss->beacon_set = 0; + return 0; + } -+ -+ 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/360-ctrl_iface_reload.patch index 85e871f457..170d4f2f0c 100644 --- a/package/hostapd/patches/452-ctrl_iface_reload.patch +++ b/package/hostapd/patches/360-ctrl_iface_reload.patch @@ -1,6 +1,6 @@ --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -33,6 +33,7 @@ +@@ -34,6 +34,7 @@ #include "wps/wps.h" #include "config_file.h" #include "ctrl_iface.h" @@ -8,7 +8,7 @@ struct wpa_ctrl_dst { -@@ -43,6 +44,7 @@ struct wpa_ctrl_dst { +@@ -44,6 +45,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); -@@ -152,6 +154,68 @@ static int hostapd_ctrl_iface_new_sta(st +@@ -153,6 +155,68 @@ static int hostapd_ctrl_iface_new_sta(st return 0; } @@ -85,7 +85,7 @@ #ifdef CONFIG_IEEE80211W #ifdef NEED_AP_MLME -@@ -902,6 +966,10 @@ static void hostapd_ctrl_iface_receive(i +@@ -1199,6 +1263,10 @@ static void hostapd_ctrl_iface_receive(i reply_len += res; } #endif /* CONFIG_NO_RADIUS */ diff --git a/package/hostapd/patches/453-ap_sta_support.patch b/package/hostapd/patches/370-ap_sta_support.patch index a3dff04b5f..a3d05727eb 100644 --- a/package/hostapd/patches/453-ap_sta_support.patch +++ b/package/hostapd/patches/370-ap_sta_support.patch @@ -1,23 +1,26 @@ --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h -@@ -96,6 +96,8 @@ struct wpa_interface { - * receiving of EAPOL frames from an additional interface. - */ - const char *bridge_ifname; -+ -+ const char *hostapd_ctrl; - }; +@@ -96,6 +96,11 @@ struct wpa_interface { + const char *ifname; - /** -@@ -306,6 +308,8 @@ struct wpa_supplicant { + /** ++ * hostapd_ctrl - path to hostapd control socket for notification ++ */ ++ const char *hostapd_ctrl; ++ ++ /** + * bridge_ifname - Optional bridge interface name + * + * If the driver interface (ifname) is included in a Linux bridge +@@ -325,6 +330,8 @@ struct wpa_supplicant { #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */ char bridge_ifname[16]; + struct wpa_ctrl *hostapd; + char *confname; + char *confanother; struct wpa_config *conf; - int countermeasures; --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile @@ -13,6 +13,10 @@ PKG_CONFIG ?= pkg-config @@ -31,24 +34,21 @@ -include .config -include $(if $(MULTICALL),../hostapd/.config) -@@ -76,6 +80,10 @@ OBJS_c = wpa_cli.o ../src/common/wpa_ctr +@@ -76,6 +80,8 @@ 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 -@@ -107,6 +107,55 @@ extern int wpa_debug_show_keys; +@@ -109,6 +109,46 @@ 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"; @@ -67,24 +67,17 @@ + char *cmd = NULL; + char buf[256]; + int len = sizeof(buf); -+ int channel, hw_mode; ++ enum hostapd_hw_mode hw_mode; ++ u8 channel; + 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; -+ } -+ ++ hw_mode = ieee80211_freq_to_chan(bss->freq, &channel); + if (asprintf(&cmd, "UPDATE channel=%d sec_chan=0 hw_mode=%d ieee80211n=%d", -+ channel, hw_mode, !!bss->ht_capab) < 0) { ++ 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); @@ -95,33 +88,27 @@ + } + 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) { -@@ -667,8 +716,16 @@ void wpa_supplicant_set_state(struct wpa +@@ -685,8 +725,12 @@ void wpa_supplicant_set_state(struct wpa #endif /* CONFIG_P2P */ sme_sched_obss_scan(wpa_s, 1); -+#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 -@@ -2853,6 +2910,21 @@ static int wpa_supplicant_init_iface(str - os_strlcpy(wpa_s->bridge_ifname, iface->bridge_ifname, +@@ -2906,6 +2950,20 @@ static int wpa_supplicant_init_iface(str sizeof(wpa_s->bridge_ifname)); } -+#ifdef MULTICALL + + if (iface->hostapd_ctrl) { + char *cmd = "DOWN"; + char buf[256]; @@ -135,10 +122,22 @@ + if (hostapd_stop(wpa_s) < 0) + return -1; + } -+#endif - ++ /* 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( + if (terminate) + wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING); + ++ if (wpa_s->hostapd) { ++ wpa_ctrl_close(wpa_s->hostapd); ++ wpa_s->hostapd = NULL; ++ } ++ + if (wpa_s->ctrl_iface) { + wpa_supplicant_ctrl_iface_deinit(wpa_s->ctrl_iface); + wpa_s->ctrl_iface = NULL; --- a/wpa_supplicant/bss.c +++ b/wpa_supplicant/bss.c @@ -11,6 +11,7 @@ @@ -174,16 +173,16 @@ --- a/wpa_supplicant/main.c +++ b/wpa_supplicant/main.c -@@ -25,7 +25,7 @@ static void usage(void) - "usage:\n" +@@ -27,7 +27,7 @@ static void usage(void) " wpa_supplicant [-BddhKLqqstuvW] [-P<pid file>] " "[-g<global ctrl>] \\\n" + " [-G<group>] \\\n" - " -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] " -+ " -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] [-H<hostapd path>]" ++ " -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) +@@ -72,6 +72,7 @@ static void usage(void) #endif /* CONFIG_DEBUG_LINUX_TRACING */ printf(" -t = include timestamp in debug messages\n" " -h = show this help text\n" @@ -191,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" -@@ -155,7 +156,7 @@ int main(int argc, char *argv[]) +@@ -160,7 +161,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"); +- "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"); if (c < 0) break; switch (c) { -@@ -199,6 +200,9 @@ int main(int argc, char *argv[]) +@@ -207,6 +208,9 @@ int main(int argc, char *argv[]) usage(); exitcode = 0; goto out; diff --git a/package/hostapd/patches/460-disable_ctrl_iface_mib.patch b/package/hostapd/patches/380-disable_ctrl_iface_mib.patch index a51ade8295..27f21bdb8f 100644 --- a/package/hostapd/patches/460-disable_ctrl_iface_mib.patch +++ b/package/hostapd/patches/380-disable_ctrl_iface_mib.patch @@ -1,6 +1,6 @@ --- a/hostapd/Makefile +++ b/hostapd/Makefile -@@ -136,6 +136,9 @@ endif +@@ -144,6 +144,9 @@ endif ifdef CONFIG_NO_CTRL_IFACE CFLAGS += -DCONFIG_NO_CTRL_IFACE else @@ -12,15 +12,15 @@ endif --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -937,6 +937,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; +@@ -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, + 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) { -@@ -966,10 +967,12 @@ static void hostapd_ctrl_iface_receive(i +@@ -1263,10 +1264,12 @@ static void hostapd_ctrl_iface_receive(i reply_len += res; } #endif /* CONFIG_NO_RADIUS */ @@ -33,7 +33,7 @@ } else if (os_strcmp(buf, "STA-FIRST") == 0) { reply_len = hostapd_ctrl_iface_sta_first(hapd, reply, reply_size); -@@ -979,6 +982,7 @@ static void hostapd_ctrl_iface_receive(i +@@ -1276,6 +1279,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 +43,7 @@ reply_len = -1; --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -758,6 +758,9 @@ ifdef CONFIG_WNM +@@ -778,6 +778,9 @@ ifdef CONFIG_WNM OBJS += ../src/ap/wnm_ap.o endif ifdef CONFIG_CTRL_IFACE @@ -55,7 +55,7 @@ --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c -@@ -5051,6 +5051,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -5262,6 +5262,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 +63,7 @@ } else if (os_strcmp(buf, "MIB") == 0) { reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size); if (reply_len >= 0) { -@@ -5062,6 +5063,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -5273,6 +5274,7 @@ char * wpa_supplicant_ctrl_iface_process else reply_len += res; } @@ -71,7 +71,7 @@ } else if (os_strncmp(buf, "STATUS", 6) == 0) { reply_len = wpa_supplicant_ctrl_iface_status( wpa_s, buf + 6, reply, reply_size); -@@ -5465,6 +5467,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -5687,6 +5689,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 +79,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) { -@@ -5473,6 +5476,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -5695,6 +5698,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); @@ -105,22 +105,22 @@ #ifdef CONFIG_P2P_MANAGER static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype, -@@ -303,3 +305,4 @@ int hostapd_ctrl_iface_disassociate(stru +@@ -423,3 +425,4 @@ int hostapd_parse_csa_settings(const cha return 0; } + --- a/src/ap/ieee802_1x.c +++ b/src/ap/ieee802_1x.c -@@ -2048,6 +2048,7 @@ static const char * bool_txt(Boolean boo - return bool ? "TRUE" : "FALSE"; +@@ -1938,6 +1938,7 @@ static const char * bool_txt(Boolean boo + return bool_val ? "TRUE" : "FALSE"; } +#ifdef CONFIG_CTRL_IFACE_MIB int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen) { -@@ -2200,6 +2201,7 @@ int ieee802_1x_get_mib_sta(struct hostap +@@ -2090,6 +2091,7 @@ int ieee802_1x_get_mib_sta(struct hostap return len; } @@ -130,7 +130,7 @@ struct sta_info *sta, int success) --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c -@@ -2687,6 +2687,7 @@ static const char * wpa_bool_txt(int boo +@@ -2708,6 +2708,7 @@ static const char * wpa_bool_txt(int boo return bool ? "TRUE" : "FALSE"; } @@ -138,7 +138,7 @@ #define RSN_SUITE "%02x-%02x-%02x-%d" #define RSN_SUITE_ARG(s) \ -@@ -2831,7 +2832,7 @@ int wpa_get_mib_sta(struct wpa_state_mac +@@ -2852,7 +2853,7 @@ int wpa_get_mib_sta(struct wpa_state_mac return len; } @@ -149,7 +149,7 @@ { --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -1848,6 +1848,8 @@ static u32 wpa_key_mgmt_suite(struct wpa +@@ -1844,6 +1844,8 @@ static u32 wpa_key_mgmt_suite(struct wpa } @@ -158,7 +158,7 @@ #define RSN_SUITE "%02x-%02x-%02x-%d" #define RSN_SUITE_ARG(s) \ ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff -@@ -1931,6 +1933,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch +@@ -1927,6 +1929,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch return (int) len; } diff --git a/package/hostapd/patches/470-wpa_ie_cap_workaround.patch b/package/hostapd/patches/390-wpa_ie_cap_workaround.patch index 974ec3ded5..00a32229d4 100644 --- a/package/hostapd/patches/470-wpa_ie_cap_workaround.patch +++ b/package/hostapd/patches/390-wpa_ie_cap_workaround.patch @@ -1,6 +1,6 @@ --- a/src/common/wpa_common.c +++ b/src/common/wpa_common.c -@@ -965,6 +965,31 @@ const char * wpa_key_mgmt_txt(int key_mg +@@ -959,6 +959,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) -@@ -972,8 +997,19 @@ int wpa_compare_rsn_ie(int ft_initial_as +@@ -966,8 +991,19 @@ int wpa_compare_rsn_ie(int ft_initial_as if (ie1 == NULL || ie2 == NULL) return -1; diff --git a/package/hostapd/patches/480-terminate_on_setup_failure.patch b/package/hostapd/patches/400-terminate_on_setup_failure.patch index 3f8a7783ba..0d9065ab2e 100644 --- a/package/hostapd/patches/480-terminate_on_setup_failure.patch +++ b/package/hostapd/patches/400-terminate_on_setup_failure.patch @@ -1,20 +1,22 @@ --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -911,11 +911,8 @@ int hostapd_setup_interface_complete(str +@@ -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"); -- eloop_terminate(); +- 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 (hapd->iconf->channel) { -@@ -935,7 +932,7 @@ int hostapd_setup_interface_complete(str + 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"); @@ -23,7 +25,7 @@ } } -@@ -946,7 +943,7 @@ int hostapd_setup_interface_complete(str +@@ -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."); @@ -32,7 +34,7 @@ } } -@@ -954,14 +951,14 @@ int hostapd_setup_interface_complete(str +@@ -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"); @@ -49,7 +51,7 @@ } prev_addr = hapd->own_addr; -@@ -971,7 +968,7 @@ int hostapd_setup_interface_complete(str +@@ -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)) @@ -58,7 +60,7 @@ if (hostapd_mac_comp_empty(hapd->conf->bssid) == 0) prev_addr = hapd->own_addr; } -@@ -983,7 +980,7 @@ int hostapd_setup_interface_complete(str +@@ -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__); @@ -67,14 +69,16 @@ } /* -@@ -1004,6 +1001,11 @@ int hostapd_setup_interface_complete(str - iface->bss[0]->conf->iface); +@@ -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"); -+ eloop_terminate(); ++ hostapd_set_state(iface, HAPD_IFACE_DISABLED); ++ if (iface->interfaces && iface->interfaces->terminate_on_error) ++ eloop_terminate(); + return -1; } diff --git a/package/hostapd/patches/410-bring_down_interface.patch b/package/hostapd/patches/410-bring_down_interface.patch new file mode 100644 index 0000000000..31033a01a4 --- /dev/null +++ b/package/hostapd/patches/410-bring_down_interface.patch @@ -0,0 +1,25 @@ +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -8480,12 +8480,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); +- if (ret == -EACCES) +- break; +- res = i802_set_iface_flags(bss, 1); +- if (res && !ret) +- ret = -1; +- else if (ret != -EBUSY) ++ if (ret != -EBUSY) + break; + } else + wpa_printf(MSG_DEBUG, "nl80211: Failed to set " +@@ -8498,6 +8493,8 @@ static int wpa_driver_nl80211_set_mode(s + "interface is down"); + drv->nlmode = nlmode; + drv->ignore_if_down_event = 1; ++ if (i802_set_iface_flags(bss, 1)) ++ ret = -1; + } + + done: diff --git a/package/hostapd/patches/520-fix_wps_pin_crash.patch b/package/hostapd/patches/420-fix_wps_pin_crash.patch index 80d562c8c2..130bd53e08 100644 --- a/package/hostapd/patches/520-fix_wps_pin_crash.patch +++ b/package/hostapd/patches/420-fix_wps_pin_crash.patch @@ -1,6 +1,6 @@ --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -479,6 +479,9 @@ static int hostapd_ctrl_iface_wps_ap_pin +@@ -480,6 +480,9 @@ static int hostapd_ctrl_iface_wps_ap_pin char *pos; const char *pin_txt; diff --git a/package/hostapd/patches/420-timestamp_check.patch b/package/hostapd/patches/420-timestamp_check.patch deleted file mode 100644 index b2d4a05115..0000000000 --- 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/530-wps_single_auth_enc_type.patch b/package/hostapd/patches/430-wps_single_auth_enc_type.patch index 6f4a6557d5..6e86658857 100644 --- a/package/hostapd/patches/530-wps_single_auth_enc_type.patch +++ b/package/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 -@@ -989,11 +989,9 @@ int hostapd_init_wps(struct hostapd_data +@@ -1069,11 +1069,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) -@@ -1001,7 +999,7 @@ int hostapd_init_wps(struct hostapd_data +@@ -1081,7 +1079,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/hostapd/patches/540-dynamic_20_40_mhz.patch b/package/hostapd/patches/440-dynamic_20_40_mhz.patch index a7b39dbe89..905ec2c1b4 100644 --- a/package/hostapd/patches/540-dynamic_20_40_mhz.patch +++ b/package/hostapd/patches/440-dynamic_20_40_mhz.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -2474,6 +2474,10 @@ static int hostapd_config_fill(struct ho +@@ -2422,6 +2422,10 @@ static int hostapd_config_fill(struct ho "ht_capab", line); errors++; } @@ -10,20 +10,20 @@ + conf->dynamic_ht40 = 1500; } else if (os_strcmp(buf, "require_ht") == 0) { conf->require_ht = atoi(pos); - #endif /* CONFIG_IEEE80211N */ + } else if (os_strcmp(buf, "obss_interval") == 0) { --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -515,6 +515,7 @@ struct hostapd_config { +@@ -531,6 +531,7 @@ struct hostapd_config { int ieee80211n; int secondary_channel; int require_ht; + int dynamic_ht40; + int obss_interval; u32 vht_capab; int ieee80211ac; - int require_vht; --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -22,6 +22,7 @@ +@@ -23,6 +23,7 @@ #include "beacon.h" #include "iapp.h" #include "ieee802_1x.h" @@ -31,17 +31,17 @@ #include "ieee802_11_auth.h" #include "vlan_init.h" #include "wpa_auth.h" -@@ -348,6 +349,7 @@ static void hostapd_cleanup_iface_pre(st - +@@ -332,6 +333,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); + 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 -@@ -269,6 +269,9 @@ struct hostapd_iface { +@@ -326,6 +326,9 @@ struct hostapd_iface { /* Overlapping BSS information */ int olbc_ht; @@ -49,11 +49,11 @@ + struct os_time last_20mhz_trigger; + u16 ht_op_mode; - void (*scan_cb)(struct hostapd_iface *iface); - }; + + /* surveying helpers */ --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -1484,6 +1484,9 @@ static void handle_beacon(struct hostapd +@@ -1538,6 +1538,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 -@@ -81,4 +81,17 @@ int hostapd_update_time_adv(struct hosta +@@ -82,4 +82,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); @@ -97,7 +97,7 @@ u8 * hostapd_eid_ht_capabilities(struct hostapd_data *hapd, u8 *eid) -@@ -70,12 +72,15 @@ u8 * hostapd_eid_ht_operation(struct hos +@@ -86,12 +88,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); -@@ -270,3 +275,84 @@ void hostapd_get_ht_capab(struct hostapd +@@ -286,3 +291,84 @@ void hostapd_get_ht_capab(struct hostapd neg_ht_cap->ht_capabilities_info = host_to_le16(cap); } diff --git a/package/hostapd/patches/550-limit_debug_messages.patch b/package/hostapd/patches/450-limit_debug_messages.patch index 659e980112..aaea94137f 100644 --- a/package/hostapd/patches/550-limit_debug_messages.patch +++ b/package/hostapd/patches/450-limit_debug_messages.patch @@ -182,7 +182,7 @@ /* * 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 +@@ -174,7 +215,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 +196,7 @@ /** * wpa_msg_ctrl - Conditional printf for ctrl_iface monitors -@@ -186,8 +232,13 @@ void wpa_msg(void *ctx, int level, const +@@ -188,8 +234,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. */ @@ -209,5 +209,5 @@ + _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); + /** + * wpa_msg_global - Global printf for ctrl_iface monitors 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 ffa757e9ca..0000000000 --- a/package/hostapd/patches/450-reload_freq_change.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- a/src/ap/hostapd.c -+++ b/src/ap/hostapd.c -@@ -156,6 +156,24 @@ 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->ieee80211ac, -+ newconf->secondary_channel, -+ newconf->vht_oper_chwidth, -+ newconf->vht_oper_centr_freq_seg0_idx, -+ newconf->vht_oper_centr_freq_seg1_idx)) { -+ 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/560-indicate-features.patch b/package/hostapd/patches/460-indicate-features.patch index 9073bd43a0..7a44da122b 100644 --- a/package/hostapd/patches/560-indicate-features.patch +++ b/package/hostapd/patches/460-indicate-features.patch @@ -8,18 +8,18 @@ #include "crypto/random.h" #include "crypto/tls.h" #include "common/version.h" -@@ -584,7 +585,7 @@ int main(int argc, char *argv[]) +@@ -546,7 +547,7 @@ int main(int argc, char *argv[]) wpa_supplicant_event = hostapd_wpa_event; for (;;) { -- c = getopt(argc, argv, "Bde:f:hKP:tvg:G:"); -+ c = getopt(argc, argv, "Bde:f:hKP:tg:G:v::"); +- c = getopt(argc, argv, "b:Bde:f:hKP:Ttvg:G:"); ++ c = getopt(argc, argv, "b:Bde:f:hKP:Ttg:G:v::"); if (c < 0) break; switch (c) { -@@ -616,6 +617,8 @@ int main(int argc, char *argv[]) - wpa_debug_timestamp++; +@@ -583,6 +584,8 @@ int main(int argc, char *argv[]) break; + #endif /* CONFIG_DEBUG_LINUX_TRACING */ case 'v': + if (optarg) + exit(!has_feature(optarg)); @@ -35,17 +35,17 @@ +#include "build_features.h" #include "wpa_supplicant_i.h" #include "driver_i.h" - -@@ -156,7 +157,7 @@ int main(int argc, char *argv[]) + #include "p2p_supplicant.h" +@@ -161,7 +162,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"); +- "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"); if (c < 0) break; switch (c) { -@@ -248,8 +249,12 @@ int main(int argc, char *argv[]) +@@ -259,8 +260,12 @@ int main(int argc, char *argv[]) break; #endif /* CONFIG_DBUS */ case 'v': diff --git a/package/hostapd/patches/590-hostapd_cli_ifdef.patch b/package/hostapd/patches/470-hostapd_cli_ifdef.patch index cbf1e485cd..5ac0fddf70 100644 --- a/package/hostapd/patches/590-hostapd_cli_ifdef.patch +++ b/package/hostapd/patches/470-hostapd_cli_ifdef.patch @@ -8,15 +8,15 @@ " wps_pin <uuid> <pin> [timeout] [addr] add WPS Enrollee PIN\n" " wps_check_pin <PIN> verify PIN checksum\n" " wps_pbc indicate button pushed to initiate PBC\n" -@@ -79,7 +78,6 @@ static const char *commands_help = - #endif /* CONFIG_WPS_NFC */ +@@ -80,7 +79,6 @@ static const char *commands_help = " wps_ap_pin <cmd> [params..] enable/disable AP PIN\n" " wps_config <SSID> <auth> <encr> <key> configure AP\n" + " wps_get_status show current WPS status\n" -#endif /* CONFIG_WPS */ " get_config show current configuration\n" " help show this usage help\n" " interface [ifname] show interfaces/select interface\n" -@@ -340,7 +338,6 @@ static int hostapd_cli_cmd_sa_query(stru +@@ -352,7 +350,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[]) { -@@ -559,7 +556,6 @@ static int hostapd_cli_cmd_wps_config(st +@@ -578,7 +575,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, -@@ -805,7 +801,6 @@ static struct hostapd_cli_cmd hostapd_cl +@@ -903,7 +899,6 @@ static struct hostapd_cli_cmd hostapd_cl #ifdef CONFIG_IEEE80211W { "sa_query", hostapd_cli_cmd_sa_query }, #endif /* CONFIG_IEEE80211W */ @@ -40,10 +40,10 @@ { "wps_pin", hostapd_cli_cmd_wps_pin }, { "wps_check_pin", hostapd_cli_cmd_wps_check_pin }, { "wps_pbc", hostapd_cli_cmd_wps_pbc }, -@@ -818,7 +813,6 @@ static struct hostapd_cli_cmd hostapd_cl - #endif /* CONFIG_WPS_NFC */ +@@ -917,7 +912,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 }, -#endif /* CONFIG_WPS */ { "disassoc_imminent", hostapd_cli_cmd_disassoc_imminent }, { "ess_disassoc", hostapd_cli_cmd_ess_disassoc }, diff --git a/package/hostapd/patches/471-wpa_cli_ifdef.patch b/package/hostapd/patches/471-wpa_cli_ifdef.patch new file mode 100644 index 0000000000..cc8444416a --- /dev/null +++ b/package/hostapd/patches/471-wpa_cli_ifdef.patch @@ -0,0 +1,13 @@ +--- a/wpa_supplicant/wpa_cli.c ++++ b/wpa_supplicant/wpa_cli.c +@@ -26,6 +26,10 @@ + #endif /* ANDROID */ + + ++#ifndef CONFIG_P2P ++#define CONFIG_P2P ++#endif ++ + static const char *wpa_cli_version = + "wpa_cli v" VERSION_STR "\n" + "Copyright (c) 2004-2013, Jouni Malinen <j@w1.fi> and contributors"; diff --git a/package/hostapd/patches/610-max_num_sta_probe.patch b/package/hostapd/patches/480-max_num_sta_probe.patch index 141eb5b6e3..e5ca8b4434 100644 --- a/package/hostapd/patches/610-max_num_sta_probe.patch +++ b/package/hostapd/patches/480-max_num_sta_probe.patch @@ -1,6 +1,6 @@ --- a/src/ap/beacon.c +++ b/src/ap/beacon.c -@@ -455,6 +455,10 @@ void handle_probe_req(struct hostapd_dat +@@ -501,6 +501,10 @@ void handle_probe_req(struct hostapd_dat return; } diff --git a/package/hostapd/patches/620-scan_wait.patch b/package/hostapd/patches/490-scan_wait.patch index ac2d445a43..61715d6a98 100644 --- a/package/hostapd/patches/620-scan_wait.patch +++ b/package/hostapd/patches/490-scan_wait.patch @@ -23,16 +23,17 @@ +} /** - * hostapd_init - Allocate and initialize per-interface data -@@ -190,6 +200,7 @@ static struct hostapd_iface * hostapd_in - if (hapd == NULL) - goto fail; - hapd->msg_ctx = hapd; -+ hapd->setup_complete_cb = hostapd_setup_complete_cb; + * hostapd_driver_init - Preparate driver interface +@@ -165,6 +175,8 @@ static int hostapd_driver_init(struct ho + return -1; } - return hapd_iface; -@@ -429,8 +440,6 @@ static void hostapd_global_deinit(const ++ hapd->setup_complete_cb = hostapd_setup_complete_cb; ++ + /* 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 #endif /* CONFIG_NATIVE_WINDOWS */ eap_server_unregister_methods(); @@ -41,7 +42,7 @@ } -@@ -456,11 +465,6 @@ static int hostapd_global_run(struct hap +@@ -408,11 +418,6 @@ static int hostapd_global_run(struct hap } #endif /* EAP_SERVER_TNC */ @@ -53,13 +54,13 @@ eloop_run(); return 0; -@@ -564,8 +568,7 @@ int main(int argc, char *argv[]) +@@ -521,8 +526,7 @@ int main(int argc, char *argv[]) struct hapd_interfaces interfaces; int ret = 1; - size_t i; + size_t i, j; - int c, debug = 0, daemonize = 0; - char *pid_file = NULL; + int c, debug = 0; const char *log_file = NULL; const char *entropy_file = NULL; - + char **bss_config = NULL, **tmp_bss; 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 ccecb2240a..0000000000 --- a/package/hostapd/patches/500-random_pool_add_kernel.patch +++ /dev/null @@ -1,177 +0,0 @@ ---- a/src/crypto/random.c -+++ b/src/crypto/random.c -@@ -25,6 +25,7 @@ - #include "utils/includes.h" - #ifdef __linux__ - #include <fcntl.h> -+#include <sys/stat.h> - #endif /* __linux__ */ - - #include "utils/common.h" -@@ -33,6 +34,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 -@@ -43,6 +46,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; -@@ -123,7 +128,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; -@@ -213,16 +218,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 -@@ -257,6 +268,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; - } -@@ -269,6 +281,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; - } - -@@ -284,10 +297,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); - } - - -@@ -444,3 +463,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 -@@ -1226,9 +1226,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 -@@ -1191,9 +1191,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 -@@ -775,12 +775,12 @@ endif - ifdef CONFIG_NO_RANDOM_POOL - L_CFLAGS += -DCONFIG_NO_RANDOM_POOL - else --OBJS += src/crypto/random.c --HOBJS += src/crypto/random.c - HOBJS += src/utils/eloop.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 -@@ -748,12 +748,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/601-wpa_supplicant-add-new-config-params-to-be-used-with.patch b/package/hostapd/patches/500-wpa_supplicant-add-new-config-params-to-be-used-with.patch index 3345e557f3..544151ef2b 100644 --- a/package/hostapd/patches/601-wpa_supplicant-add-new-config-params-to-be-used-with.patch +++ b/package/hostapd/patches/500-wpa_supplicant-add-new-config-params-to-be-used-with.patch @@ -20,9 +20,9 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org> +#include "drivers/nl80211_copy.h" #include "common/defs.h" + #include "utils/list.h" - #define HOSTAPD_CHAN_DISABLED 0x00000001 -@@ -363,6 +364,11 @@ struct wpa_driver_associate_params { +@@ -404,6 +405,11 @@ struct wpa_driver_associate_params { */ int freq; @@ -44,7 +44,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org> #include "config.h" -@@ -1376,6 +1377,97 @@ static char * wpa_config_write_p2p_clien +@@ -1512,6 +1513,97 @@ static char * wpa_config_write_psk_list( #endif /* CONFIG_P2P */ @@ -142,7 +142,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org> /* Helper macros for network block parser */ #ifdef OFFSET -@@ -1574,6 +1666,9 @@ static const struct parse_data ssid_fiel +@@ -1715,6 +1807,9 @@ static const struct parse_data ssid_fiel { INT(ap_max_inactivity) }, { INT(dtim_period) }, { INT(beacon_int) }, @@ -154,15 +154,15 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org> #undef OFFSET --- a/wpa_supplicant/config_ssid.h +++ b/wpa_supplicant/config_ssid.h -@@ -11,6 +11,7 @@ - +@@ -12,6 +12,7 @@ #include "common/defs.h" + #include "utils/list.h" #include "eap_peer/eap_config.h" +#include "drivers/nl80211_copy.h" #define MAX_SSID_LEN 32 -@@ -600,6 +601,10 @@ struct wpa_ssid { +@@ -620,6 +621,10 @@ struct wpa_ssid { * dereferences since it may not be updated in all cases. */ void *parent_cred; @@ -175,7 +175,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org> #endif /* CONFIG_SSID_H */ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -1597,15 +1597,24 @@ void wpa_supplicant_associate(struct wpa +@@ -1623,15 +1623,24 @@ void wpa_supplicant_associate(struct wpa params.ssid_len = ssid->ssid_len; } diff --git a/package/hostapd/patches/602-driver_nl80211-use-new-parameters-during-ibss-join.patch b/package/hostapd/patches/501-driver_nl80211-use-new-parameters-during-ibss-join.patch index 5a6eb5e447..565bbc9762 100644 --- a/package/hostapd/patches/602-driver_nl80211-use-new-parameters-during-ibss-join.patch +++ b/package/hostapd/patches/501-driver_nl80211-use-new-parameters-during-ibss-join.patch @@ -10,7 +10,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org> --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -7040,7 +7040,7 @@ static int wpa_driver_nl80211_ibss(struc +@@ -7903,7 +7903,7 @@ static int wpa_driver_nl80211_ibss(struc struct wpa_driver_associate_params *params) { struct nl_msg *msg; @@ -19,7 +19,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org> int count = 0; wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex); -@@ -7073,6 +7073,37 @@ retry: +@@ -7936,6 +7936,37 @@ retry: wpa_printf(MSG_DEBUG, " * freq=%d", params->freq); NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, params->freq); diff --git a/package/hostapd/patches/604-wpa_s-support-htmode-param.patch b/package/hostapd/patches/502-wpa_s-support-htmode-param.patch index 267bde8f12..adb20a25c5 100644 --- a/package/hostapd/patches/604-wpa_s-support-htmode-param.patch +++ b/package/hostapd/patches/502-wpa_s-support-htmode-param.patch @@ -16,7 +16,7 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org> --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -368,6 +368,8 @@ struct wpa_driver_associate_params { +@@ -409,6 +409,8 @@ struct wpa_driver_associate_params { int fixed_freq; unsigned char rates[NL80211_MAX_SUPP_RATES]; int mcast_rate; @@ -27,7 +27,7 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org> * bg_scan_period - Background scan period in seconds, 0 to disable --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -7104,6 +7104,22 @@ retry: +@@ -7967,6 +7967,22 @@ retry: NLA_PUT_U32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate); } @@ -52,7 +52,7 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org> goto nla_put_failure; --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c -@@ -1408,6 +1408,71 @@ static char * wpa_config_write_mcast_rat +@@ -1544,6 +1544,71 @@ static char * wpa_config_write_mcast_rat } #endif /* NO_CONFIG_WRITE */ @@ -124,7 +124,7 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org> static int wpa_config_parse_rates(const struct parse_data *data, struct wpa_ssid *ssid, int line, const char *value) -@@ -1669,6 +1734,7 @@ static const struct parse_data ssid_fiel +@@ -1810,6 +1875,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 <ordex@autistici.org> #undef OFFSET --- a/wpa_supplicant/config_ssid.h +++ b/wpa_supplicant/config_ssid.h -@@ -605,6 +605,8 @@ struct wpa_ssid { +@@ -625,6 +625,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 <ordex@autistici.org> #endif /* CONFIG_SSID_H */ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -1613,6 +1613,8 @@ void wpa_supplicant_associate(struct wpa +@@ -1639,6 +1639,8 @@ void wpa_supplicant_associate(struct wpa i++; } params.mcast_rate = ssid->mcast_rate; 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 e92c122b82..0000000000 --- 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 -@@ -7616,8 +7616,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) -@@ -7633,6 +7631,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/510-wpa_supplicant_p2p_parse_ifcomb.patch b/package/hostapd/patches/510-wpa_supplicant_p2p_parse_ifcomb.patch new file mode 100644 index 0000000000..fe72ee29c6 --- /dev/null +++ b/package/hostapd/patches/510-wpa_supplicant_p2p_parse_ifcomb.patch @@ -0,0 +1,18 @@ +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -3157,10 +3157,12 @@ static int wiphy_info_iface_comb_process + } + + if (combination_has_p2p && combination_has_mgd) { +- info->p2p_concurrent = 1; +- info->num_multichan_concurrent = ++ int num_channels = + nla_get_u32(tb_comb[NL80211_IFACE_COMB_NUM_CHANNELS]); +- return 1; ++ ++ info->p2p_concurrent = 1; ++ if (info->num_multichan_concurrent < num_channels) ++ info->num_multichan_concurrent = num_channels; + } + + return 0; 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 5f140489b0..0000000000 --- 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 -@@ -127,7 +127,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; |