hostapd: update to 2014-10-25
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 43059
This commit is contained in:
		| @@ -8,9 +8,9 @@ | |||||||
| include $(TOPDIR)/rules.mk | include $(TOPDIR)/rules.mk | ||||||
|  |  | ||||||
| PKG_NAME:=hostapd | PKG_NAME:=hostapd | ||||||
| PKG_VERSION:=2014-06-03.1 | PKG_VERSION:=2014-10-25 | ||||||
| PKG_RELEASE:=1 | PKG_RELEASE:=1 | ||||||
| PKG_REV:=84df167554569af8c87f0a8ac1fb508192417d8e | PKG_REV:=01e2231fdc4fbec61fbc382238e3606a1d2826e4 | ||||||
|  |  | ||||||
| PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 | ||||||
| PKG_SOURCE_URL:=git://w1.fi/srv/git/hostap.git | PKG_SOURCE_URL:=git://w1.fi/srv/git/hostap.git | ||||||
|   | |||||||
| @@ -1,32 +0,0 @@ | |||||||
| From 9c829900bb01d6fb22e78ba78195c78de39f64b9 Mon Sep 17 00:00:00 2001 |  | ||||||
| From: Jouni Malinen <j@w1.fi> |  | ||||||
| Date: Sat, 04 Oct 2014 19:11:00 +0000 |  | ||||||
| Subject: Fix authenticator OKC fetch from PMKSA cache to avoid infinite loop |  | ||||||
|  |  | ||||||
| If the first entry in the PMKSA cache did not match the station's MAC |  | ||||||
| address, an infinite loop could be reached in pmksa_cache_get_okc() when |  | ||||||
| trying to find a PMKSA cache entry for opportunistic key caching cases. |  | ||||||
| This would only happen if OKC is enabled (okc=1 included in the |  | ||||||
| configuration file). |  | ||||||
|  |  | ||||||
| Signed-off-by: Jouni Malinen <j@w1.fi> |  | ||||||
| --- |  | ||||||
| --- a/src/ap/pmksa_cache_auth.c |  | ||||||
| +++ b/src/ap/pmksa_cache_auth.c |  | ||||||
| @@ -394,15 +394,13 @@ struct rsn_pmksa_cache_entry * pmksa_cac |  | ||||||
|  	struct rsn_pmksa_cache_entry *entry; |  | ||||||
|  	u8 new_pmkid[PMKID_LEN]; |  | ||||||
|   |  | ||||||
| -	entry = pmksa->pmksa; |  | ||||||
| -	while (entry) { |  | ||||||
| +	for (entry = pmksa->pmksa; entry; entry = entry->next) { |  | ||||||
|  		if (os_memcmp(entry->spa, spa, ETH_ALEN) != 0) |  | ||||||
|  			continue; |  | ||||||
|  		rsn_pmkid(entry->pmk, entry->pmk_len, aa, spa, new_pmkid, |  | ||||||
|  			  wpa_key_mgmt_sha256(entry->akmp)); |  | ||||||
|  		if (os_memcmp(new_pmkid, pmkid, PMKID_LEN) == 0) |  | ||||||
|  			return entry; |  | ||||||
| -		entry = entry->next; |  | ||||||
|  	} |  | ||||||
|  	return NULL; |  | ||||||
|  } |  | ||||||
| @@ -1,110 +0,0 @@ | |||||||
| From 89de07a9442072f88d49869d8ecd8d42bae050a0 Mon Sep 17 00:00:00 2001 |  | ||||||
| From: Jouni Malinen <jouni@qca.qualcomm.com> |  | ||||||
| Date: Mon, 6 Oct 2014 16:27:44 +0300 |  | ||||||
| Subject: [PATCH 1/3] Add os_exec() helper to run external programs |  | ||||||
|  |  | ||||||
| Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> |  | ||||||
| --- |  | ||||||
|  src/utils/os.h       |  9 +++++++++ |  | ||||||
|  src/utils/os_unix.c  | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++ |  | ||||||
|  src/utils/os_win32.c |  6 ++++++ |  | ||||||
|  3 files changed, 70 insertions(+) |  | ||||||
|  |  | ||||||
| --- a/src/utils/os.h |  | ||||||
| +++ b/src/utils/os.h |  | ||||||
| @@ -584,6 +584,15 @@ static inline void os_remove_in_array(vo |  | ||||||
|   */ |  | ||||||
|  size_t os_strlcpy(char *dest, const char *src, size_t siz); |  | ||||||
|   |  | ||||||
| +/** |  | ||||||
| + * os_exec - Execute an external program |  | ||||||
| + * @program: Path to the program |  | ||||||
| + * @arg: Command line argument string |  | ||||||
| + * @wait_completion: Whether to wait until the program execution completes |  | ||||||
| + * Returns: 0 on success, -1 on error |  | ||||||
| + */ |  | ||||||
| +int os_exec(const char *program, const char *arg, int wait_completion); |  | ||||||
| + |  | ||||||
|   |  | ||||||
|  #ifdef OS_REJECT_C_LIB_FUNCTIONS |  | ||||||
|  #define malloc OS_DO_NOT_USE_malloc |  | ||||||
| --- a/src/utils/os_unix.c |  | ||||||
| +++ b/src/utils/os_unix.c |  | ||||||
| @@ -9,6 +9,7 @@ |  | ||||||
|  #include "includes.h" |  | ||||||
|   |  | ||||||
|  #include <time.h> |  | ||||||
| +#include <sys/wait.h> |  | ||||||
|   |  | ||||||
|  #ifdef ANDROID |  | ||||||
|  #include <sys/capability.h> |  | ||||||
| @@ -540,3 +541,57 @@ char * os_strdup(const char *s) |  | ||||||
|  } |  | ||||||
|   |  | ||||||
|  #endif /* WPA_TRACE */ |  | ||||||
| + |  | ||||||
| + |  | ||||||
| +int os_exec(const char *program, const char *arg, int wait_completion) |  | ||||||
| +{ |  | ||||||
| +	pid_t pid; |  | ||||||
| +	int pid_status; |  | ||||||
| + |  | ||||||
| +	pid = fork(); |  | ||||||
| +	if (pid < 0) { |  | ||||||
| +		perror("fork"); |  | ||||||
| +		return -1; |  | ||||||
| +	} |  | ||||||
| + |  | ||||||
| +	if (pid == 0) { |  | ||||||
| +		/* run the external command in the child process */ |  | ||||||
| +		const int MAX_ARG = 30; |  | ||||||
| +		char *_program, *_arg, *pos; |  | ||||||
| +		char *argv[MAX_ARG + 1]; |  | ||||||
| +		int i; |  | ||||||
| + |  | ||||||
| +		_program = os_strdup(program); |  | ||||||
| +		_arg = os_strdup(arg); |  | ||||||
| + |  | ||||||
| +		argv[0] = _program; |  | ||||||
| + |  | ||||||
| +		i = 1; |  | ||||||
| +		pos = _arg; |  | ||||||
| +		while (i < MAX_ARG && pos && *pos) { |  | ||||||
| +			while (*pos == ' ') |  | ||||||
| +				pos++; |  | ||||||
| +			if (*pos == '\0') |  | ||||||
| +				break; |  | ||||||
| +			argv[i++] = pos; |  | ||||||
| +			pos = os_strchr(pos, ' '); |  | ||||||
| +			if (pos) |  | ||||||
| +				*pos++ = '\0'; |  | ||||||
| +		} |  | ||||||
| +		argv[i] = NULL; |  | ||||||
| + |  | ||||||
| +		execv(program, argv); |  | ||||||
| +		perror("execv"); |  | ||||||
| +		os_free(_program); |  | ||||||
| +		os_free(_arg); |  | ||||||
| +		exit(0); |  | ||||||
| +		return -1; |  | ||||||
| +	} |  | ||||||
| + |  | ||||||
| +	if (wait_completion) { |  | ||||||
| +		/* wait for the child process to complete in the parent */ |  | ||||||
| +		waitpid(pid, &pid_status, 0); |  | ||||||
| +	} |  | ||||||
| + |  | ||||||
| +	return 0; |  | ||||||
| +} |  | ||||||
| --- a/src/utils/os_win32.c |  | ||||||
| +++ b/src/utils/os_win32.c |  | ||||||
| @@ -244,3 +244,9 @@ size_t os_strlcpy(char *dest, const char |  | ||||||
|   |  | ||||||
|  	return s - src - 1; |  | ||||||
|  } |  | ||||||
| + |  | ||||||
| + |  | ||||||
| +int os_exec(const char *program, const char *arg, int wait_completion) |  | ||||||
| +{ |  | ||||||
| +	return -1; |  | ||||||
| +} |  | ||||||
| @@ -1,54 +0,0 @@ | |||||||
| From c5f258de76dbb67fb64beab39a99e5c5711f41fe Mon Sep 17 00:00:00 2001 |  | ||||||
| From: Jouni Malinen <jouni@qca.qualcomm.com> |  | ||||||
| Date: Mon, 6 Oct 2014 17:25:52 +0300 |  | ||||||
| Subject: [PATCH 2/3] wpa_cli: Use os_exec() for action script execution |  | ||||||
|  |  | ||||||
| Use os_exec() to run the action script operations to avoid undesired |  | ||||||
| command line processing for control interface event strings. Previously, |  | ||||||
| it could have been possible for some of the event strings to include |  | ||||||
| unsanitized data which is not suitable for system() use. (CVE-2014-3686) |  | ||||||
|  |  | ||||||
| Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> |  | ||||||
| --- |  | ||||||
|  wpa_supplicant/wpa_cli.c | 25 ++++++++----------------- |  | ||||||
|  1 file changed, 8 insertions(+), 17 deletions(-) |  | ||||||
|  |  | ||||||
| --- a/wpa_supplicant/wpa_cli.c |  | ||||||
| +++ b/wpa_supplicant/wpa_cli.c |  | ||||||
| @@ -3149,28 +3149,19 @@ static int str_match(const char *a, cons |  | ||||||
|  static int wpa_cli_exec(const char *program, const char *arg1, |  | ||||||
|  			const char *arg2) |  | ||||||
|  { |  | ||||||
| -	char *cmd; |  | ||||||
| +	char *arg; |  | ||||||
|  	size_t len; |  | ||||||
|  	int res; |  | ||||||
| -	int ret = 0; |  | ||||||
|   |  | ||||||
| -	len = os_strlen(program) + os_strlen(arg1) + os_strlen(arg2) + 3; |  | ||||||
| -	cmd = os_malloc(len); |  | ||||||
| -	if (cmd == NULL) |  | ||||||
| +	len = os_strlen(arg1) + os_strlen(arg2) + 2; |  | ||||||
| +	arg = os_malloc(len); |  | ||||||
| +	if (arg == NULL) |  | ||||||
|  		return -1; |  | ||||||
| -	res = os_snprintf(cmd, len, "%s %s %s", program, arg1, arg2); |  | ||||||
| -	if (res < 0 || (size_t) res >= len) { |  | ||||||
| -		os_free(cmd); |  | ||||||
| -		return -1; |  | ||||||
| -	} |  | ||||||
| -	cmd[len - 1] = '\0'; |  | ||||||
| -#ifndef _WIN32_WCE |  | ||||||
| -	if (system(cmd) < 0) |  | ||||||
| -		ret = -1; |  | ||||||
| -#endif /* _WIN32_WCE */ |  | ||||||
| -	os_free(cmd); |  | ||||||
| +	os_snprintf(arg, len, "%s %s", arg1, arg2); |  | ||||||
| +	res = os_exec(program, arg, 1); |  | ||||||
| +	os_free(arg); |  | ||||||
|   |  | ||||||
| -	return ret; |  | ||||||
| +	return res; |  | ||||||
|  } |  | ||||||
|   |  | ||||||
|   |  | ||||||
| @@ -1,54 +0,0 @@ | |||||||
| From 5d4fa2a29bef013e61185beb21a3ec110885eb9a Mon Sep 17 00:00:00 2001 |  | ||||||
| From: Jouni Malinen <jouni@qca.qualcomm.com> |  | ||||||
| Date: Mon, 6 Oct 2014 18:49:01 +0300 |  | ||||||
| Subject: [PATCH 3/3] hostapd_cli: Use os_exec() for action script execution |  | ||||||
|  |  | ||||||
| Use os_exec() to run the action script operations to avoid undesired |  | ||||||
| command line processing for control interface event strings. Previously, |  | ||||||
| it could have been possible for some of the event strings to include |  | ||||||
| unsanitized data which is not suitable for system() use. (CVE-2014-3686) |  | ||||||
|  |  | ||||||
| Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> |  | ||||||
| --- |  | ||||||
|  hostapd/hostapd_cli.c | 25 ++++++++----------------- |  | ||||||
|  1 file changed, 8 insertions(+), 17 deletions(-) |  | ||||||
|  |  | ||||||
| --- a/hostapd/hostapd_cli.c |  | ||||||
| +++ b/hostapd/hostapd_cli.c |  | ||||||
| @@ -238,28 +238,19 @@ static int hostapd_cli_cmd_mib(struct wp |  | ||||||
|  static int hostapd_cli_exec(const char *program, const char *arg1, |  | ||||||
|  			    const char *arg2) |  | ||||||
|  { |  | ||||||
| -	char *cmd; |  | ||||||
| +	char *arg; |  | ||||||
|  	size_t len; |  | ||||||
|  	int res; |  | ||||||
| -	int ret = 0; |  | ||||||
|   |  | ||||||
| -	len = os_strlen(program) + os_strlen(arg1) + os_strlen(arg2) + 3; |  | ||||||
| -	cmd = os_malloc(len); |  | ||||||
| -	if (cmd == NULL) |  | ||||||
| +	len = os_strlen(arg1) + os_strlen(arg2) + 2; |  | ||||||
| +	arg = os_malloc(len); |  | ||||||
| +	if (arg == NULL) |  | ||||||
|  		return -1; |  | ||||||
| -	res = os_snprintf(cmd, len, "%s %s %s", program, arg1, arg2); |  | ||||||
| -	if (res < 0 || (size_t) res >= len) { |  | ||||||
| -		os_free(cmd); |  | ||||||
| -		return -1; |  | ||||||
| -	} |  | ||||||
| -	cmd[len - 1] = '\0'; |  | ||||||
| -#ifndef _WIN32_WCE |  | ||||||
| -	if (system(cmd) < 0) |  | ||||||
| -		ret = -1; |  | ||||||
| -#endif /* _WIN32_WCE */ |  | ||||||
| -	os_free(cmd); |  | ||||||
| +	os_snprintf(arg, len, "%s %s", arg1, arg2); |  | ||||||
| +	res = os_exec(program, arg, 1); |  | ||||||
| +	os_free(arg); |  | ||||||
|   |  | ||||||
| -	return ret; |  | ||||||
| +	return res; |  | ||||||
|  } |  | ||||||
|   |  | ||||||
|   |  | ||||||
| @@ -1,6 +1,6 @@ | |||||||
| --- a/src/ap/ieee802_1x.c | --- a/src/ap/ieee802_1x.c | ||||||
| +++ b/src/ap/ieee802_1x.c | +++ b/src/ap/ieee802_1x.c | ||||||
| @@ -2119,9 +2119,9 @@ void ieee802_1x_notify_pre_auth(struct e | @@ -2232,9 +2232,9 @@ void ieee802_1x_notify_pre_auth(struct e | ||||||
|  } |  } | ||||||
|   |   | ||||||
|   |   | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|   |   | ||||||
|  ifdef CONFIG_TESTING_OPTIONS |  ifdef CONFIG_TESTING_OPTIONS | ||||||
|  CFLAGS += -DCONFIG_TESTING_OPTIONS |  CFLAGS += -DCONFIG_TESTING_OPTIONS | ||||||
| @@ -223,10 +224,14 @@ ifdef CONFIG_IEEE80211AC | @@ -224,10 +225,14 @@ ifdef CONFIG_IEEE80211AC | ||||||
|  CFLAGS += -DCONFIG_IEEE80211AC |  CFLAGS += -DCONFIG_IEEE80211AC | ||||||
|  endif |  endif | ||||||
|   |   | ||||||
| @@ -26,7 +26,7 @@ | |||||||
|  LIBS += $(DRV_AP_LIBS) |  LIBS += $(DRV_AP_LIBS) | ||||||
|   |   | ||||||
|  ifdef CONFIG_L2_PACKET |  ifdef CONFIG_L2_PACKET | ||||||
| @@ -913,6 +918,12 @@ install: all | @@ -914,6 +919,12 @@ install: all | ||||||
|   |   | ||||||
|  BCHECK=../src/drivers/build.hostapd |  BCHECK=../src/drivers/build.hostapd | ||||||
|   |   | ||||||
| @@ -39,7 +39,7 @@ | |||||||
|  hostapd: $(BCHECK) $(OBJS) |  hostapd: $(BCHECK) $(OBJS) | ||||||
|  	$(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) |  	$(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) | ||||||
|  	@$(E) "  LD " $@ |  	@$(E) "  LD " $@ | ||||||
| @@ -951,6 +962,12 @@ HOBJS += ../src/crypto/aes-internal.o | @@ -952,6 +963,12 @@ HOBJS += ../src/crypto/aes-internal.o | ||||||
|  HOBJS += ../src/crypto/aes-internal-enc.o |  HOBJS += ../src/crypto/aes-internal-enc.o | ||||||
|  endif |  endif | ||||||
|   |   | ||||||
| @@ -62,7 +62,7 @@ | |||||||
|   |   | ||||||
|  ifdef CONFIG_TESTING_OPTIONS |  ifdef CONFIG_TESTING_OPTIONS | ||||||
|  CFLAGS += -DCONFIG_TESTING_OPTIONS |  CFLAGS += -DCONFIG_TESTING_OPTIONS | ||||||
| @@ -741,6 +742,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS | @@ -745,6 +746,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS | ||||||
|  CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS |  CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS | ||||||
|  LIBS += -ldl -rdynamic |  LIBS += -ldl -rdynamic | ||||||
|  endif |  endif | ||||||
| @@ -73,7 +73,7 @@ | |||||||
|  endif |  endif | ||||||
|   |   | ||||||
|  ifdef CONFIG_MACSEC |  ifdef CONFIG_MACSEC | ||||||
| @@ -762,9 +767,11 @@ NEED_EAP_COMMON=y | @@ -765,9 +770,11 @@ NEED_EAP_COMMON=y | ||||||
|  NEED_RSN_AUTHENTICATOR=y |  NEED_RSN_AUTHENTICATOR=y | ||||||
|  CFLAGS += -DCONFIG_AP |  CFLAGS += -DCONFIG_AP | ||||||
|  OBJS += ap.o |  OBJS += ap.o | ||||||
| @@ -85,7 +85,7 @@ | |||||||
|  OBJS += ../src/ap/hostapd.o |  OBJS += ../src/ap/hostapd.o | ||||||
|  OBJS += ../src/ap/wpa_auth_glue.o |  OBJS += ../src/ap/wpa_auth_glue.o | ||||||
|  OBJS += ../src/ap/utils.o |  OBJS += ../src/ap/utils.o | ||||||
| @@ -826,10 +833,18 @@ endif | @@ -830,10 +837,18 @@ endif | ||||||
|  ifdef CONFIG_HS20 |  ifdef CONFIG_HS20 | ||||||
|  OBJS += ../src/ap/hs20.o |  OBJS += ../src/ap/hs20.o | ||||||
|  endif |  endif | ||||||
| @@ -104,7 +104,7 @@ | |||||||
|  NEED_AES_WRAP=y |  NEED_AES_WRAP=y | ||||||
|  OBJS += ../src/ap/wpa_auth.o |  OBJS += ../src/ap/wpa_auth.o | ||||||
|  OBJS += ../src/ap/wpa_auth_ie.o |  OBJS += ../src/ap/wpa_auth_ie.o | ||||||
| @@ -1602,6 +1617,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) | @@ -1589,6 +1604,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) | ||||||
|   |   | ||||||
|  $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config |  $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config | ||||||
|   |   | ||||||
| @@ -117,7 +117,7 @@ | |||||||
|  wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) |  wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) | ||||||
|  	$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) |  	$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) | ||||||
|  	@$(E) "  LD " $@ |  	@$(E) "  LD " $@ | ||||||
| @@ -1682,6 +1703,12 @@ endif | @@ -1669,6 +1690,12 @@ endif | ||||||
|  %@.service: %.service.arg.in |  %@.service: %.service.arg.in | ||||||
|  	sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@ |  	sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@ | ||||||
|   |   | ||||||
| @@ -132,7 +132,7 @@ | |||||||
|  wpa_cli.exe: wpa_cli |  wpa_cli.exe: wpa_cli | ||||||
| --- a/src/drivers/driver.h | --- a/src/drivers/driver.h | ||||||
| +++ b/src/drivers/driver.h | +++ b/src/drivers/driver.h | ||||||
| @@ -4117,8 +4117,8 @@ union wpa_event_data { | @@ -4294,8 +4294,8 @@ union wpa_event_data { | ||||||
|   * Driver wrapper code should call this function whenever an event is received |   * Driver wrapper code should call this function whenever an event is received | ||||||
|   * from the driver. |   * from the driver. | ||||||
|   */ |   */ | ||||||
| @@ -145,7 +145,7 @@ | |||||||
|  /* |  /* | ||||||
| --- a/src/ap/drv_callbacks.c | --- a/src/ap/drv_callbacks.c | ||||||
| +++ b/src/ap/drv_callbacks.c | +++ b/src/ap/drv_callbacks.c | ||||||
| @@ -926,8 +926,8 @@ static void hostapd_event_dfs_nop_finish | @@ -989,8 +989,8 @@ static void hostapd_event_dfs_nop_finish | ||||||
|  #endif /* NEED_AP_MLME */ |  #endif /* NEED_AP_MLME */ | ||||||
|   |   | ||||||
|   |   | ||||||
| @@ -179,7 +179,7 @@ | |||||||
|  	for (;;) { |  	for (;;) { | ||||||
| --- a/wpa_supplicant/events.c | --- a/wpa_supplicant/events.c | ||||||
| +++ b/wpa_supplicant/events.c | +++ b/wpa_supplicant/events.c | ||||||
| @@ -2919,8 +2919,8 @@ static void wpa_supplicant_notify_avoid_ | @@ -2924,8 +2924,8 @@ static void wpa_supplicant_event_assoc_a | ||||||
|  } |  } | ||||||
|   |   | ||||||
|   |   | ||||||
| @@ -192,7 +192,7 @@ | |||||||
|   |   | ||||||
| --- a/wpa_supplicant/wpa_supplicant.c | --- a/wpa_supplicant/wpa_supplicant.c | ||||||
| +++ b/wpa_supplicant/wpa_supplicant.c | +++ b/wpa_supplicant/wpa_supplicant.c | ||||||
| @@ -3811,6 +3811,9 @@ static void wpa_supplicant_deinit_iface( | @@ -3980,6 +3980,9 @@ static void wpa_supplicant_deinit_iface( | ||||||
|  	os_free(wpa_s); |  	os_free(wpa_s); | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -202,7 +202,7 @@ | |||||||
|   |   | ||||||
|  /** |  /** | ||||||
|   * wpa_supplicant_add_iface - Add a new network interface |   * wpa_supplicant_add_iface - Add a new network interface | ||||||
| @@ -4002,6 +4005,7 @@ struct wpa_global * wpa_supplicant_init( | @@ -4181,6 +4184,7 @@ struct wpa_global * wpa_supplicant_init( | ||||||
|  	wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb); |  	wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb); | ||||||
|  #endif /* CONFIG_NO_WPA_MSG */ |  #endif /* CONFIG_NO_WPA_MSG */ | ||||||
|   |   | ||||||
| @@ -212,7 +212,7 @@ | |||||||
|  		wpa_debug_open_syslog(); |  		wpa_debug_open_syslog(); | ||||||
| --- a/hostapd/main.c | --- a/hostapd/main.c | ||||||
| +++ b/hostapd/main.c | +++ b/hostapd/main.c | ||||||
| @@ -502,6 +502,9 @@ static int hostapd_get_ctrl_iface_group( | @@ -504,6 +504,9 @@ static int hostapd_get_ctrl_iface_group( | ||||||
|  	return 0; |  	return 0; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -222,7 +222,7 @@ | |||||||
|   |   | ||||||
|  #ifdef CONFIG_WPS |  #ifdef CONFIG_WPS | ||||||
|  static int gen_uuid(const char *txt_addr) |  static int gen_uuid(const char *txt_addr) | ||||||
| @@ -553,6 +556,7 @@ int main(int argc, char *argv[]) | @@ -555,6 +558,7 @@ int main(int argc, char *argv[]) | ||||||
|  	interfaces.global_iface_name = NULL; |  	interfaces.global_iface_name = NULL; | ||||||
|  	interfaces.global_ctrl_sock = -1; |  	interfaces.global_ctrl_sock = -1; | ||||||
|   |   | ||||||
| @@ -257,7 +257,7 @@ | |||||||
|  struct wpa_driver_ops *wpa_drivers[] = { NULL }; |  struct wpa_driver_ops *wpa_drivers[] = { NULL }; | ||||||
|   |   | ||||||
|   |   | ||||||
| @@ -1185,6 +1189,8 @@ static void usage(void) | @@ -1194,6 +1198,8 @@ static void usage(void) | ||||||
|  	       "option several times.\n"); |  	       "option several times.\n"); | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -266,7 +266,7 @@ | |||||||
|   |   | ||||||
|  int main(int argc, char *argv[]) |  int main(int argc, char *argv[]) | ||||||
|  { |  { | ||||||
| @@ -1203,6 +1209,7 @@ int main(int argc, char *argv[]) | @@ -1212,6 +1218,7 @@ int main(int argc, char *argv[]) | ||||||
|  	if (os_program_init()) |  	if (os_program_init()) | ||||||
|  		return -1; |  		return -1; | ||||||
|   |   | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| --- a/hostapd/config_file.c | --- a/hostapd/config_file.c | ||||||
| +++ b/hostapd/config_file.c | +++ b/hostapd/config_file.c | ||||||
| @@ -2639,6 +2639,8 @@ static int hostapd_config_fill(struct ho | @@ -2651,6 +2651,8 @@ static int hostapd_config_fill(struct ho | ||||||
|  		} |  		} | ||||||
|  #endif /* CONFIG_IEEE80211W */ |  #endif /* CONFIG_IEEE80211W */ | ||||||
|  #ifdef CONFIG_IEEE80211N |  #ifdef CONFIG_IEEE80211N | ||||||
| @@ -11,7 +11,7 @@ | |||||||
|  	} else if (os_strcmp(buf, "ht_capab") == 0) { |  	} else if (os_strcmp(buf, "ht_capab") == 0) { | ||||||
| --- a/src/ap/ap_config.h | --- a/src/ap/ap_config.h | ||||||
| +++ b/src/ap/ap_config.h | +++ b/src/ap/ap_config.h | ||||||
| @@ -576,6 +576,7 @@ struct hostapd_config { | @@ -605,6 +605,7 @@ struct hostapd_config { | ||||||
|   |   | ||||||
|  	int ht_op_mode_fixed; |  	int ht_op_mode_fixed; | ||||||
|  	u16 ht_capab; |  	u16 ht_capab; | ||||||
| @@ -32,17 +32,17 @@ | |||||||
|  	hostapd_set_state(iface, HAPD_IFACE_HT_SCAN); |  	hostapd_set_state(iface, HAPD_IFACE_HT_SCAN); | ||||||
| --- a/src/ap/ieee802_11_ht.c | --- a/src/ap/ieee802_11_ht.c | ||||||
| +++ b/src/ap/ieee802_11_ht.c | +++ b/src/ap/ieee802_11_ht.c | ||||||
| @@ -221,6 +221,9 @@ void hostapd_2040_coex_action(struct hos | @@ -220,6 +220,9 @@ void hostapd_2040_coex_action(struct hos | ||||||
|  	if (!(iface->conf->ht_capab & HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET)) |  	if (!(iface->conf->ht_capab & HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET)) | ||||||
|  		return; |  		return; | ||||||
|   |   | ||||||
| +	if (iface->conf->noscan) | +	if (iface->conf->noscan) | ||||||
| +		return; | +		return; | ||||||
| + | + | ||||||
|  	hdr_len = data - (u8 *) mgmt; |  	if (len < IEEE80211_HDRLEN + 1) | ||||||
|  	if (hdr_len > len) |  | ||||||
|  		return; |  		return; | ||||||
| @@ -319,6 +322,9 @@ void ht40_intolerant_add(struct hostapd_ |  	data++; | ||||||
|  | @@ -317,6 +320,9 @@ void ht40_intolerant_add(struct hostapd_ | ||||||
|  	if (iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G) |  	if (iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G) | ||||||
|  		return; |  		return; | ||||||
|   |   | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| --- a/wpa_supplicant/wpa_supplicant.c | --- a/wpa_supplicant/wpa_supplicant.c | ||||||
| +++ b/wpa_supplicant/wpa_supplicant.c | +++ b/wpa_supplicant/wpa_supplicant.c | ||||||
| @@ -2752,7 +2752,7 @@ static struct wpa_supplicant * wpa_suppl | @@ -2914,7 +2914,7 @@ static struct wpa_supplicant * wpa_suppl | ||||||
|  	if (wpa_s == NULL) |  	if (wpa_s == NULL) | ||||||
|  		return NULL; |  		return NULL; | ||||||
|  	wpa_s->scan_req = INITIAL_SCAN_REQ; |  	wpa_s->scan_req = INITIAL_SCAN_REQ; | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|   |   | ||||||
|  ifdef CONFIG_LIBNL32 |  ifdef CONFIG_LIBNL32 | ||||||
|    DRV_LIBS += -lnl-3 |    DRV_LIBS += -lnl-3 | ||||||
| @@ -114,7 +113,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT | @@ -115,7 +114,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT | ||||||
|  CONFIG_WIRELESS_EXTENSION=y |  CONFIG_WIRELESS_EXTENSION=y | ||||||
|  NEED_NETLINK=y |  NEED_NETLINK=y | ||||||
|  NEED_LINUX_IOCTL=y |  NEED_LINUX_IOCTL=y | ||||||
| @@ -16,7 +16,7 @@ | |||||||
|  endif |  endif | ||||||
|   |   | ||||||
|  ifdef CONFIG_DRIVER_NDIS |  ifdef CONFIG_DRIVER_NDIS | ||||||
| @@ -140,7 +138,6 @@ endif | @@ -141,7 +139,6 @@ endif | ||||||
|  ifdef CONFIG_WIRELESS_EXTENSION |  ifdef CONFIG_WIRELESS_EXTENSION | ||||||
|  DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION |  DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION | ||||||
|  DRV_WPA_OBJS += ../src/drivers/driver_wext.o |  DRV_WPA_OBJS += ../src/drivers/driver_wext.o | ||||||
| @@ -24,7 +24,7 @@ | |||||||
|  endif |  endif | ||||||
|   |   | ||||||
|  ifdef NEED_NETLINK |  ifdef NEED_NETLINK | ||||||
| @@ -153,6 +150,7 @@ endif | @@ -154,6 +151,7 @@ endif | ||||||
|   |   | ||||||
|  ifdef NEED_RFKILL |  ifdef NEED_RFKILL | ||||||
|  DRV_OBJS += ../src/drivers/rfkill.o |  DRV_OBJS += ../src/drivers/rfkill.o | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| --- a/src/drivers/driver_nl80211.c | --- a/src/drivers/driver_nl80211.c | ||||||
| +++ b/src/drivers/driver_nl80211.c | +++ b/src/drivers/driver_nl80211.c | ||||||
| @@ -7488,7 +7488,7 @@ static int nl80211_set_channel(struct i8 | @@ -7840,7 +7840,7 @@ static int nl80211_set_channel(struct i8 | ||||||
|  	nl80211_cmd(drv, msg, 0, set_chan ? NL80211_CMD_SET_CHANNEL : |  	nl80211_cmd(drv, msg, 0, set_chan ? NL80211_CMD_SET_CHANNEL : | ||||||
|  		    NL80211_CMD_SET_WIPHY); |  		    NL80211_CMD_SET_WIPHY); | ||||||
|   |   | ||||||
| @@ -9,12 +9,3 @@ | |||||||
|  	if (nl80211_put_freq_params(msg, freq) < 0) |  	if (nl80211_put_freq_params(msg, freq) < 0) | ||||||
|  		goto nla_put_failure; |  		goto nla_put_failure; | ||||||
|   |   | ||||||
| @@ -12047,7 +12047,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) |  | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| --- a/src/ap/hostapd.c | --- a/src/ap/hostapd.c | ||||||
| +++ b/src/ap/hostapd.c | +++ b/src/ap/hostapd.c | ||||||
| @@ -70,6 +70,16 @@ static void hostapd_reload_bss(struct ho | @@ -71,6 +71,16 @@ static void hostapd_reload_bss(struct ho | ||||||
|  #endif /* CONFIG_NO_RADIUS */ |  #endif /* CONFIG_NO_RADIUS */ | ||||||
|   |   | ||||||
|  	ssid = &hapd->conf->ssid; |  	ssid = &hapd->conf->ssid; | ||||||
| @@ -17,7 +17,7 @@ | |||||||
|  	if (!ssid->wpa_psk_set && ssid->wpa_psk && !ssid->wpa_psk->next && |  	if (!ssid->wpa_psk_set && ssid->wpa_psk && !ssid->wpa_psk->next && | ||||||
|  	    ssid->wpa_passphrase_set && ssid->wpa_passphrase) { |  	    ssid->wpa_passphrase_set && ssid->wpa_passphrase) { | ||||||
|  		/* |  		/* | ||||||
| @@ -170,20 +180,12 @@ int hostapd_reload_config(struct hostapd | @@ -171,20 +181,12 @@ int hostapd_reload_config(struct hostapd | ||||||
|  	oldconf = hapd->iconf; |  	oldconf = hapd->iconf; | ||||||
|  	iface->conf = newconf; |  	iface->conf = newconf; | ||||||
|   |   | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| --- a/src/drivers/driver_nl80211.c | --- a/src/drivers/driver_nl80211.c | ||||||
| +++ b/src/drivers/driver_nl80211.c | +++ b/src/drivers/driver_nl80211.c | ||||||
| @@ -4817,18 +4817,20 @@ wpa_driver_nl80211_finish_drv_init(struc | @@ -5083,18 +5083,20 @@ wpa_driver_nl80211_finish_drv_init(struc | ||||||
|  } |  } | ||||||
|   |   | ||||||
|   |   | ||||||
| @@ -24,7 +24,7 @@ | |||||||
|   |   | ||||||
|  	return send_and_recv_msgs(drv, msg, NULL, NULL); |  	return send_and_recv_msgs(drv, msg, NULL, NULL); | ||||||
|   nla_put_failure: |   nla_put_failure: | ||||||
| @@ -4836,6 +4838,15 @@ static int wpa_driver_nl80211_del_beacon | @@ -5102,6 +5104,15 @@ static int wpa_driver_nl80211_del_beacon | ||||||
|  	return -ENOBUFS; |  	return -ENOBUFS; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -40,7 +40,7 @@ | |||||||
|   |   | ||||||
|  /** |  /** | ||||||
|   * wpa_driver_nl80211_deinit - Deinitialize nl80211 driver interface |   * wpa_driver_nl80211_deinit - Deinitialize nl80211 driver interface | ||||||
| @@ -10617,7 +10628,6 @@ static int wpa_driver_nl80211_stop_ap(vo | @@ -11147,7 +11158,6 @@ static int wpa_driver_nl80211_stop_ap(vo | ||||||
|  	if (!is_ap_interface(drv->nlmode)) |  	if (!is_ap_interface(drv->nlmode)) | ||||||
|  		return -1; |  		return -1; | ||||||
|  	wpa_driver_nl80211_del_beacon(drv); |  	wpa_driver_nl80211_del_beacon(drv); | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| --- a/hostapd/ctrl_iface.c | --- a/hostapd/ctrl_iface.c | ||||||
| +++ b/hostapd/ctrl_iface.c | +++ b/hostapd/ctrl_iface.c | ||||||
| @@ -37,6 +37,7 @@ | @@ -43,6 +43,7 @@ | ||||||
|  #include "wps/wps.h" |  #include "wps/wps.h" | ||||||
|  #include "config_file.h" |  #include "config_file.h" | ||||||
|  #include "ctrl_iface.h" |  #include "ctrl_iface.h" | ||||||
| @@ -8,7 +8,7 @@ | |||||||
|   |   | ||||||
|   |   | ||||||
|  struct wpa_ctrl_dst { |  struct wpa_ctrl_dst { | ||||||
| @@ -47,6 +48,7 @@ struct wpa_ctrl_dst { | @@ -53,6 +54,7 @@ struct wpa_ctrl_dst { | ||||||
|  	int errors; |  	int errors; | ||||||
|  }; |  }; | ||||||
|   |   | ||||||
| @@ -16,7 +16,7 @@ | |||||||
|   |   | ||||||
|  static void hostapd_ctrl_iface_send(struct hostapd_data *hapd, int level, |  static void hostapd_ctrl_iface_send(struct hostapd_data *hapd, int level, | ||||||
|  				    const char *buf, size_t len); |  				    const char *buf, size_t len); | ||||||
| @@ -156,6 +158,68 @@ static int hostapd_ctrl_iface_new_sta(st | @@ -162,6 +164,68 @@ static int hostapd_ctrl_iface_new_sta(st | ||||||
|  	return 0; |  	return 0; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -85,7 +85,7 @@ | |||||||
|   |   | ||||||
|  #ifdef CONFIG_IEEE80211W |  #ifdef CONFIG_IEEE80211W | ||||||
|  #ifdef NEED_AP_MLME |  #ifdef NEED_AP_MLME | ||||||
| @@ -1546,6 +1610,10 @@ static void hostapd_ctrl_iface_receive(i | @@ -1761,6 +1825,10 @@ static void hostapd_ctrl_iface_receive(i | ||||||
|  	} else if (os_strncmp(buf, "VENDOR ", 7) == 0) { |  	} else if (os_strncmp(buf, "VENDOR ", 7) == 0) { | ||||||
|  		reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply, |  		reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply, | ||||||
|  						      reply_size); |  						      reply_size); | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| --- a/wpa_supplicant/wpa_supplicant_i.h | --- a/wpa_supplicant/wpa_supplicant_i.h | ||||||
| +++ b/wpa_supplicant/wpa_supplicant_i.h | +++ b/wpa_supplicant/wpa_supplicant_i.h | ||||||
| @@ -108,6 +108,11 @@ struct wpa_interface { | @@ -109,6 +109,11 @@ struct wpa_interface { | ||||||
|  	const char *ifname; |  	const char *ifname; | ||||||
|   |   | ||||||
|  	/** |  	/** | ||||||
| @@ -12,7 +12,7 @@ | |||||||
|  	 * bridge_ifname - Optional bridge interface name |  	 * bridge_ifname - Optional bridge interface name | ||||||
|  	 * |  	 * | ||||||
|  	 * If the driver interface (ifname) is included in a Linux bridge |  	 * If the driver interface (ifname) is included in a Linux bridge | ||||||
| @@ -395,6 +400,8 @@ struct wpa_supplicant { | @@ -406,6 +411,8 @@ struct wpa_supplicant { | ||||||
|  #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */ |  #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */ | ||||||
|  	char bridge_ifname[16]; |  	char bridge_ifname[16]; | ||||||
|   |   | ||||||
| @@ -101,8 +101,8 @@ | |||||||
|  /* Configure default/group WEP keys for static WEP */ |  /* Configure default/group WEP keys for static WEP */ | ||||||
|  int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) |  int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) | ||||||
|  { |  { | ||||||
| @@ -711,8 +760,12 @@ void wpa_supplicant_set_state(struct wpa | @@ -731,8 +780,12 @@ void wpa_supplicant_set_state(struct wpa | ||||||
|  #endif /* CONFIG_P2P */ |  		wpas_p2p_completed(wpa_s); | ||||||
|   |   | ||||||
|  		sme_sched_obss_scan(wpa_s, 1); |  		sme_sched_obss_scan(wpa_s, 1); | ||||||
| +		if (wpa_s->hostapd) | +		if (wpa_s->hostapd) | ||||||
| @@ -114,7 +114,7 @@ | |||||||
|  		wpa_s->new_connection = 1; |  		wpa_s->new_connection = 1; | ||||||
|  		wpa_drv_set_operstate(wpa_s, 0); |  		wpa_drv_set_operstate(wpa_s, 0); | ||||||
|  #ifndef IEEE8021X_EAPOL |  #ifndef IEEE8021X_EAPOL | ||||||
| @@ -3595,6 +3648,20 @@ static int wpa_supplicant_init_iface(str | @@ -3753,6 +3806,20 @@ static int wpa_supplicant_init_iface(str | ||||||
|  			   sizeof(wpa_s->bridge_ifname)); |  			   sizeof(wpa_s->bridge_ifname)); | ||||||
|  	} |  	} | ||||||
|   |   | ||||||
| @@ -135,7 +135,7 @@ | |||||||
|  	/* RSNA Supplicant Key Management - INITIALIZE */ |  	/* RSNA Supplicant Key Management - INITIALIZE */ | ||||||
|  	eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE); |  	eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE); | ||||||
|  	eapol_sm_notify_portValid(wpa_s->eapol, FALSE); |  	eapol_sm_notify_portValid(wpa_s->eapol, FALSE); | ||||||
| @@ -3798,6 +3865,11 @@ static void wpa_supplicant_deinit_iface( | @@ -3967,6 +4034,11 @@ static void wpa_supplicant_deinit_iface( | ||||||
|  	if (terminate) |  	if (terminate) | ||||||
|  		wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING); |  		wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING); | ||||||
|   |   | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| --- a/hostapd/Makefile | --- a/hostapd/Makefile | ||||||
| +++ b/hostapd/Makefile | +++ b/hostapd/Makefile | ||||||
| @@ -163,6 +163,9 @@ endif | @@ -164,6 +164,9 @@ endif | ||||||
|  ifdef CONFIG_NO_CTRL_IFACE |  ifdef CONFIG_NO_CTRL_IFACE | ||||||
|  CFLAGS += -DCONFIG_NO_CTRL_IFACE |  CFLAGS += -DCONFIG_NO_CTRL_IFACE | ||||||
|  else |  else | ||||||
| @@ -12,7 +12,7 @@ | |||||||
|  endif |  endif | ||||||
| --- a/hostapd/ctrl_iface.c | --- a/hostapd/ctrl_iface.c | ||||||
| +++ b/hostapd/ctrl_iface.c | +++ b/hostapd/ctrl_iface.c | ||||||
| @@ -1447,6 +1447,7 @@ static void hostapd_ctrl_iface_receive(i | @@ -1653,6 +1653,7 @@ static void hostapd_ctrl_iface_receive(i | ||||||
|  						      reply_size); |  						      reply_size); | ||||||
|  	} else if (os_strcmp(buf, "STATUS-DRIVER") == 0) { |  	} else if (os_strcmp(buf, "STATUS-DRIVER") == 0) { | ||||||
|  		reply_len = hostapd_drv_status(hapd, reply, reply_size); |  		reply_len = hostapd_drv_status(hapd, reply, reply_size); | ||||||
| @@ -20,7 +20,7 @@ | |||||||
|  	} else if (os_strcmp(buf, "MIB") == 0) { |  	} else if (os_strcmp(buf, "MIB") == 0) { | ||||||
|  		reply_len = ieee802_11_get_mib(hapd, reply, reply_size); |  		reply_len = ieee802_11_get_mib(hapd, reply, reply_size); | ||||||
|  		if (reply_len >= 0) { |  		if (reply_len >= 0) { | ||||||
| @@ -1488,6 +1489,7 @@ static void hostapd_ctrl_iface_receive(i | @@ -1694,6 +1695,7 @@ static void hostapd_ctrl_iface_receive(i | ||||||
|  	} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { |  	} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { | ||||||
|  		reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply, |  		reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply, | ||||||
|  							reply_size); |  							reply_size); | ||||||
| @@ -30,7 +30,7 @@ | |||||||
|  			reply_len = -1; |  			reply_len = -1; | ||||||
| --- a/wpa_supplicant/Makefile | --- a/wpa_supplicant/Makefile | ||||||
| +++ b/wpa_supplicant/Makefile | +++ b/wpa_supplicant/Makefile | ||||||
| @@ -805,6 +805,9 @@ ifdef CONFIG_WNM | @@ -809,6 +809,9 @@ ifdef CONFIG_WNM | ||||||
|  OBJS += ../src/ap/wnm_ap.o |  OBJS += ../src/ap/wnm_ap.o | ||||||
|  endif |  endif | ||||||
|  ifdef CONFIG_CTRL_IFACE |  ifdef CONFIG_CTRL_IFACE | ||||||
| @@ -42,7 +42,7 @@ | |||||||
|   |   | ||||||
| --- a/wpa_supplicant/ctrl_iface.c | --- a/wpa_supplicant/ctrl_iface.c | ||||||
| +++ b/wpa_supplicant/ctrl_iface.c | +++ b/wpa_supplicant/ctrl_iface.c | ||||||
| @@ -1602,7 +1602,7 @@ static int wpa_supplicant_ctrl_iface_sta | @@ -1628,7 +1628,7 @@ static int wpa_supplicant_ctrl_iface_sta | ||||||
|  			pos += ret; |  			pos += ret; | ||||||
|  		} |  		} | ||||||
|   |   | ||||||
| @@ -51,7 +51,7 @@ | |||||||
|  		if (wpa_s->ap_iface) { |  		if (wpa_s->ap_iface) { | ||||||
|  			pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos, |  			pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos, | ||||||
|  							    end - pos, |  							    end - pos, | ||||||
| @@ -6243,6 +6243,7 @@ char * wpa_supplicant_ctrl_iface_process | @@ -6720,6 +6720,7 @@ char * wpa_supplicant_ctrl_iface_process | ||||||
|  			reply_len = -1; |  			reply_len = -1; | ||||||
|  	} else if (os_strncmp(buf, "NOTE ", 5) == 0) { |  	} else if (os_strncmp(buf, "NOTE ", 5) == 0) { | ||||||
|  		wpa_printf(MSG_INFO, "NOTE: %s", buf + 5); |  		wpa_printf(MSG_INFO, "NOTE: %s", buf + 5); | ||||||
| @@ -59,7 +59,7 @@ | |||||||
|  	} else if (os_strcmp(buf, "MIB") == 0) { |  	} else if (os_strcmp(buf, "MIB") == 0) { | ||||||
|  		reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size); |  		reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size); | ||||||
|  		if (reply_len >= 0) { |  		if (reply_len >= 0) { | ||||||
| @@ -6254,6 +6255,7 @@ char * wpa_supplicant_ctrl_iface_process | @@ -6731,6 +6732,7 @@ char * wpa_supplicant_ctrl_iface_process | ||||||
|  			else |  			else | ||||||
|  				reply_len += res; |  				reply_len += res; | ||||||
|  		} |  		} | ||||||
| @@ -67,7 +67,7 @@ | |||||||
|  	} else if (os_strncmp(buf, "STATUS", 6) == 0) { |  	} else if (os_strncmp(buf, "STATUS", 6) == 0) { | ||||||
|  		reply_len = wpa_supplicant_ctrl_iface_status( |  		reply_len = wpa_supplicant_ctrl_iface_status( | ||||||
|  			wpa_s, buf + 6, reply, reply_size); |  			wpa_s, buf + 6, reply, reply_size); | ||||||
| @@ -6661,6 +6663,7 @@ char * wpa_supplicant_ctrl_iface_process | @@ -7140,6 +7142,7 @@ char * wpa_supplicant_ctrl_iface_process | ||||||
|  		reply_len = wpa_supplicant_ctrl_iface_bss( |  		reply_len = wpa_supplicant_ctrl_iface_bss( | ||||||
|  			wpa_s, buf + 4, reply, reply_size); |  			wpa_s, buf + 4, reply, reply_size); | ||||||
|  #ifdef CONFIG_AP |  #ifdef CONFIG_AP | ||||||
| @@ -75,7 +75,7 @@ | |||||||
|  	} else if (os_strcmp(buf, "STA-FIRST") == 0) { |  	} else if (os_strcmp(buf, "STA-FIRST") == 0) { | ||||||
|  		reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size); |  		reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size); | ||||||
|  	} else if (os_strncmp(buf, "STA ", 4) == 0) { |  	} else if (os_strncmp(buf, "STA ", 4) == 0) { | ||||||
| @@ -6669,12 +6672,15 @@ char * wpa_supplicant_ctrl_iface_process | @@ -7148,12 +7151,15 @@ char * wpa_supplicant_ctrl_iface_process | ||||||
|  	} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { |  	} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { | ||||||
|  		reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply, |  		reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply, | ||||||
|  						   reply_size); |  						   reply_size); | ||||||
| @@ -109,14 +109,14 @@ | |||||||
|   |   | ||||||
|  #ifdef CONFIG_P2P_MANAGER |  #ifdef CONFIG_P2P_MANAGER | ||||||
|  static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype, |  static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype, | ||||||
| @@ -526,3 +528,4 @@ int hostapd_parse_csa_settings(const cha | @@ -527,3 +529,4 @@ int hostapd_parse_csa_settings(const cha | ||||||
|   |   | ||||||
|  	return 0; |  	return 0; | ||||||
|  } |  } | ||||||
| + | + | ||||||
| --- a/src/ap/ieee802_1x.c | --- a/src/ap/ieee802_1x.c | ||||||
| +++ b/src/ap/ieee802_1x.c | +++ b/src/ap/ieee802_1x.c | ||||||
| @@ -2124,6 +2124,7 @@ static const char * bool_txt(Boolean boo | @@ -2237,6 +2237,7 @@ static const char * bool_txt(Boolean boo | ||||||
|  	return bool_val ? "TRUE" : "FALSE"; |  	return bool_val ? "TRUE" : "FALSE"; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -124,7 +124,7 @@ | |||||||
|   |   | ||||||
|  int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen) |  int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen) | ||||||
|  { |  { | ||||||
| @@ -2291,6 +2292,7 @@ int ieee802_1x_get_mib_sta(struct hostap | @@ -2404,6 +2405,7 @@ int ieee802_1x_get_mib_sta(struct hostap | ||||||
|  	return len; |  	return len; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -134,7 +134,7 @@ | |||||||
|  				struct sta_info *sta, int success, |  				struct sta_info *sta, int success, | ||||||
| --- a/src/ap/wpa_auth.c | --- a/src/ap/wpa_auth.c | ||||||
| +++ b/src/ap/wpa_auth.c | +++ b/src/ap/wpa_auth.c | ||||||
| @@ -2832,6 +2832,7 @@ static const char * wpa_bool_txt(int boo | @@ -2835,6 +2835,7 @@ static const char * wpa_bool_txt(int boo | ||||||
|  	return bool ? "TRUE" : "FALSE"; |  	return bool ? "TRUE" : "FALSE"; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -142,7 +142,7 @@ | |||||||
|   |   | ||||||
|  #define RSN_SUITE "%02x-%02x-%02x-%d" |  #define RSN_SUITE "%02x-%02x-%02x-%d" | ||||||
|  #define RSN_SUITE_ARG(s) \ |  #define RSN_SUITE_ARG(s) \ | ||||||
| @@ -2976,7 +2977,7 @@ int wpa_get_mib_sta(struct wpa_state_mac | @@ -2979,7 +2980,7 @@ int wpa_get_mib_sta(struct wpa_state_mac | ||||||
|   |   | ||||||
|  	return len; |  	return len; | ||||||
|  } |  } | ||||||
| @@ -153,7 +153,7 @@ | |||||||
|  { |  { | ||||||
| --- a/src/rsn_supp/wpa.c | --- a/src/rsn_supp/wpa.c | ||||||
| +++ b/src/rsn_supp/wpa.c | +++ b/src/rsn_supp/wpa.c | ||||||
| @@ -1911,6 +1911,8 @@ static u32 wpa_key_mgmt_suite(struct wpa | @@ -1928,6 +1928,8 @@ static u32 wpa_key_mgmt_suite(struct wpa | ||||||
|  } |  } | ||||||
|   |   | ||||||
|   |   | ||||||
| @@ -162,7 +162,7 @@ | |||||||
|  #define RSN_SUITE "%02x-%02x-%02x-%d" |  #define RSN_SUITE "%02x-%02x-%02x-%d" | ||||||
|  #define RSN_SUITE_ARG(s) \ |  #define RSN_SUITE_ARG(s) \ | ||||||
|  ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff |  ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff | ||||||
| @@ -1994,6 +1996,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch | @@ -2011,6 +2013,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch | ||||||
|   |   | ||||||
|  	return (int) len; |  	return (int) len; | ||||||
|  } |  } | ||||||
| @@ -172,7 +172,7 @@ | |||||||
|   |   | ||||||
| --- a/wpa_supplicant/ap.c | --- a/wpa_supplicant/ap.c | ||||||
| +++ b/wpa_supplicant/ap.c | +++ b/wpa_supplicant/ap.c | ||||||
| @@ -984,7 +984,7 @@ int wpas_ap_wps_nfc_report_handover(stru | @@ -975,7 +975,7 @@ int wpas_ap_wps_nfc_report_handover(stru | ||||||
|  #endif /* CONFIG_WPS */ |  #endif /* CONFIG_WPS */ | ||||||
|   |   | ||||||
|   |   | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| --- a/src/common/wpa_common.c | --- a/src/common/wpa_common.c | ||||||
| +++ b/src/common/wpa_common.c | +++ b/src/common/wpa_common.c | ||||||
| @@ -1002,6 +1002,31 @@ const char * wpa_key_mgmt_txt(int key_mg | @@ -1026,6 +1026,31 @@ u32 wpa_akm_to_suite(int akm) | ||||||
|  } |  } | ||||||
|   |   | ||||||
|   |   | ||||||
| @@ -32,7 +32,7 @@ | |||||||
|  int wpa_compare_rsn_ie(int ft_initial_assoc, |  int wpa_compare_rsn_ie(int ft_initial_assoc, | ||||||
|  		       const u8 *ie1, size_t ie1len, |  		       const u8 *ie1, size_t ie1len, | ||||||
|  		       const u8 *ie2, size_t ie2len) |  		       const u8 *ie2, size_t ie2len) | ||||||
| @@ -1009,8 +1034,19 @@ int wpa_compare_rsn_ie(int ft_initial_as | @@ -1033,8 +1058,19 @@ int wpa_compare_rsn_ie(int ft_initial_as | ||||||
|  	if (ie1 == NULL || ie2 == NULL) |  	if (ie1 == NULL || ie2 == NULL) | ||||||
|  		return -1; |  		return -1; | ||||||
|   |   | ||||||
|   | |||||||
| @@ -1,25 +0,0 @@ | |||||||
| --- a/src/drivers/driver_nl80211.c |  | ||||||
| +++ b/src/drivers/driver_nl80211.c |  | ||||||
| @@ -9070,12 +9070,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 " |  | ||||||
| @@ -9088,6 +9083,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: |  | ||||||
| @@ -64,7 +64,7 @@ | |||||||
|  #ifdef CONFIG_DEBUG_FILE |  #ifdef CONFIG_DEBUG_FILE | ||||||
|  static char *last_path = NULL; |  static char *last_path = NULL; | ||||||
|  #endif /* CONFIG_DEBUG_FILE */ |  #endif /* CONFIG_DEBUG_FILE */ | ||||||
| @@ -592,7 +566,7 @@ void wpa_msg_register_ifname_cb(wpa_msg_
 | @@ -594,7 +568,7 @@ void wpa_msg_register_ifname_cb(wpa_msg_
 | ||||||
|  } |  } | ||||||
|   |   | ||||||
|   |   | ||||||
| @@ -73,7 +73,7 @@ | |||||||
|  { |  { | ||||||
|  	va_list ap; |  	va_list ap; | ||||||
|  	char *buf; |  	char *buf; | ||||||
| @@ -630,7 +604,7 @@ void wpa_msg(void *ctx, int level, const
 | @@ -632,7 +606,7 @@ void wpa_msg(void *ctx, int level, const
 | ||||||
|  } |  } | ||||||
|   |   | ||||||
|   |   | ||||||
| @@ -183,7 +183,7 @@ | |||||||
|   |   | ||||||
|  /* |  /* | ||||||
|   * wpa_dbg() behaves like wpa_msg(), but it can be removed from build to reduce |   * wpa_dbg() behaves like wpa_msg(), but it can be removed from build to reduce | ||||||
| @@ -178,7 +219,12 @@ void wpa_hexdump_ascii_key(int level, co
 | @@ -179,7 +220,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. |   * Note: New line '\n' is added to the end of the text when printing to stdout. | ||||||
|   */ |   */ | ||||||
| @@ -197,7 +197,7 @@ | |||||||
|   |   | ||||||
|  /** |  /** | ||||||
|   * wpa_msg_ctrl - Conditional printf for ctrl_iface monitors |   * wpa_msg_ctrl - Conditional printf for ctrl_iface monitors | ||||||
| @@ -192,8 +238,13 @@ void wpa_msg(void *ctx, int level, const
 | @@ -193,8 +239,13 @@ void wpa_msg(void *ctx, int level, const
 | ||||||
|   * attached ctrl_iface monitors. In other words, it can be used for frequent |   * attached ctrl_iface monitors. In other words, it can be used for frequent | ||||||
|   * events that do not need to be sent to syslog. |   * events that do not need to be sent to syslog. | ||||||
|   */ |   */ | ||||||
| @@ -1,12 +0,0 @@ | |||||||
| --- a/hostapd/ctrl_iface.c |  | ||||||
| +++ b/hostapd/ctrl_iface.c |  | ||||||
| @@ -540,6 +540,9 @@ static int hostapd_ctrl_iface_wps_ap_pin |  | ||||||
|  	char *pos; |  | ||||||
|  	const char *pin_txt; |  | ||||||
|   |  | ||||||
| +	if (!hapd->wps) |  | ||||||
| +		return -1; |  | ||||||
| + |  | ||||||
|  	pos = os_strchr(txt, ' '); |  | ||||||
|  	if (pos) |  | ||||||
|  		*pos++ = '\0'; |  | ||||||
| @@ -8,7 +8,7 @@ | |||||||
|  #include "crypto/random.h" |  #include "crypto/random.h" | ||||||
|  #include "crypto/tls.h" |  #include "crypto/tls.h" | ||||||
|  #include "common/version.h" |  #include "common/version.h" | ||||||
| @@ -558,7 +559,7 @@ int main(int argc, char *argv[])
 | @@ -560,7 +561,7 @@ int main(int argc, char *argv[])
 | ||||||
|   |   | ||||||
|  	wpa_supplicant_event = hostapd_wpa_event; |  	wpa_supplicant_event = hostapd_wpa_event; | ||||||
|  	for (;;) { |  	for (;;) { | ||||||
| @@ -17,7 +17,7 @@ | |||||||
|  		if (c < 0) |  		if (c < 0) | ||||||
|  			break; |  			break; | ||||||
|  		switch (c) { |  		switch (c) { | ||||||
| @@ -595,6 +596,8 @@ int main(int argc, char *argv[])
 | @@ -597,6 +598,8 @@ int main(int argc, char *argv[])
 | ||||||
|  			break; |  			break; | ||||||
|  #endif /* CONFIG_DEBUG_LINUX_TRACING */ |  #endif /* CONFIG_DEBUG_LINUX_TRACING */ | ||||||
|  		case 'v': |  		case 'v': | ||||||
| @@ -32,7 +32,7 @@ | |||||||
|   |   | ||||||
|   |   | ||||||
|  static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc, |  static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc, | ||||||
| @@ -970,7 +966,6 @@ static struct hostapd_cli_cmd hostapd_cl
 | @@ -993,7 +989,6 @@ static struct hostapd_cli_cmd hostapd_cl
 | ||||||
|  #ifdef CONFIG_IEEE80211W |  #ifdef CONFIG_IEEE80211W | ||||||
|  	{ "sa_query", hostapd_cli_cmd_sa_query }, |  	{ "sa_query", hostapd_cli_cmd_sa_query }, | ||||||
|  #endif /* CONFIG_IEEE80211W */ |  #endif /* CONFIG_IEEE80211W */ | ||||||
| @@ -40,7 +40,7 @@ | |||||||
|  	{ "wps_pin", hostapd_cli_cmd_wps_pin }, |  	{ "wps_pin", hostapd_cli_cmd_wps_pin }, | ||||||
|  	{ "wps_check_pin", hostapd_cli_cmd_wps_check_pin }, |  	{ "wps_check_pin", hostapd_cli_cmd_wps_check_pin }, | ||||||
|  	{ "wps_pbc", hostapd_cli_cmd_wps_pbc }, |  	{ "wps_pbc", hostapd_cli_cmd_wps_pbc }, | ||||||
| @@ -984,7 +979,6 @@ static struct hostapd_cli_cmd hostapd_cl
 | @@ -1007,7 +1002,6 @@ static struct hostapd_cli_cmd hostapd_cl
 | ||||||
|  	{ "wps_ap_pin", hostapd_cli_cmd_wps_ap_pin }, |  	{ "wps_ap_pin", hostapd_cli_cmd_wps_ap_pin }, | ||||||
|  	{ "wps_config", hostapd_cli_cmd_wps_config }, |  	{ "wps_config", hostapd_cli_cmd_wps_config }, | ||||||
|  	{ "wps_get_status", hostapd_cli_cmd_wps_get_status }, |  	{ "wps_get_status", hostapd_cli_cmd_wps_get_status }, | ||||||
| @@ -1,6 +1,6 @@ | |||||||
| --- a/src/ap/beacon.c
 | --- a/src/ap/beacon.c
 | ||||||
| +++ b/src/ap/beacon.c
 | +++ b/src/ap/beacon.c
 | ||||||
| @@ -599,6 +599,10 @@ void handle_probe_req(struct hostapd_dat
 | @@ -614,6 +614,10 @@ void handle_probe_req(struct hostapd_dat
 | ||||||
|  		return; |  		return; | ||||||
|  	} |  	} | ||||||
|   |   | ||||||
| @@ -9,7 +9,7 @@ | |||||||
|   |   | ||||||
|   |   | ||||||
|  #ifndef CONFIG_NO_HOSTAPD_LOGGER |  #ifndef CONFIG_NO_HOSTAPD_LOGGER | ||||||
| @@ -141,6 +143,14 @@ static void hostapd_logger_cb(void *ctx,
 | @@ -142,6 +144,14 @@ static void hostapd_logger_cb(void *ctx,
 | ||||||
|  } |  } | ||||||
|  #endif /* CONFIG_NO_HOSTAPD_LOGGER */ |  #endif /* CONFIG_NO_HOSTAPD_LOGGER */ | ||||||
|   |   | ||||||
| @@ -24,7 +24,7 @@ | |||||||
|   |   | ||||||
|  /** |  /** | ||||||
|   * hostapd_driver_init - Preparate driver interface |   * hostapd_driver_init - Preparate driver interface | ||||||
| @@ -159,6 +169,8 @@ static int hostapd_driver_init(struct ho
 | @@ -160,6 +170,8 @@ static int hostapd_driver_init(struct ho
 | ||||||
|  		return -1; |  		return -1; | ||||||
|  	} |  	} | ||||||
|   |   | ||||||
| @@ -33,7 +33,7 @@ | |||||||
|  	/* Initialize the driver interface */ |  	/* Initialize the driver interface */ | ||||||
|  	if (!(b[0] | b[1] | b[2] | b[3] | b[4] | b[5])) |  	if (!(b[0] | b[1] | b[2] | b[3] | b[4] | b[5])) | ||||||
|  		b = NULL; |  		b = NULL; | ||||||
| @@ -372,8 +384,6 @@ static void hostapd_global_deinit(const
 | @@ -374,8 +386,6 @@ static void hostapd_global_deinit(const 
 | ||||||
|  #endif /* CONFIG_NATIVE_WINDOWS */ |  #endif /* CONFIG_NATIVE_WINDOWS */ | ||||||
|   |   | ||||||
|  	eap_server_unregister_methods(); |  	eap_server_unregister_methods(); | ||||||
| @@ -42,7 +42,7 @@ | |||||||
|  } |  } | ||||||
|   |   | ||||||
|   |   | ||||||
| @@ -399,11 +409,6 @@ static int hostapd_global_run(struct hap
 | @@ -401,11 +411,6 @@ static int hostapd_global_run(struct hap
 | ||||||
|  	} |  	} | ||||||
|  #endif /* EAP_SERVER_TNC */ |  #endif /* EAP_SERVER_TNC */ | ||||||
|   |   | ||||||
| @@ -54,7 +54,7 @@ | |||||||
|  	eloop_run(); |  	eloop_run(); | ||||||
|   |   | ||||||
|  	return 0; |  	return 0; | ||||||
| @@ -533,8 +538,7 @@ int main(int argc, char *argv[])
 | @@ -535,8 +540,7 @@ int main(int argc, char *argv[])
 | ||||||
|  	struct hapd_interfaces interfaces; |  	struct hapd_interfaces interfaces; | ||||||
|  	int ret = 1; |  	int ret = 1; | ||||||
|  	size_t i, j; |  	size_t i, j; | ||||||
| @@ -22,7 +22,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org> | |||||||
|  #include "common/defs.h" |  #include "common/defs.h" | ||||||
|  #include "utils/list.h" |  #include "utils/list.h" | ||||||
|   |   | ||||||
| @@ -414,6 +415,11 @@ struct wpa_driver_associate_params {
 | @@ -442,6 +443,11 @@ struct wpa_driver_associate_params {
 | ||||||
|  	 * responsible for selecting with which BSS to associate. */ |  	 * responsible for selecting with which BSS to associate. */ | ||||||
|  	const u8 *bssid; |  	const u8 *bssid; | ||||||
|   |   | ||||||
| @@ -44,7 +44,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org> | |||||||
|  #include "config.h" |  #include "config.h" | ||||||
|   |   | ||||||
|   |   | ||||||
| @@ -1527,6 +1528,97 @@ static char * wpa_config_write_psk_list(
 | @@ -1576,6 +1577,97 @@ static char * wpa_config_write_psk_list(
 | ||||||
|   |   | ||||||
|  #endif /* CONFIG_P2P */ |  #endif /* CONFIG_P2P */ | ||||||
|   |   | ||||||
| @@ -142,7 +142,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org> | |||||||
|  /* Helper macros for network block parser */ |  /* Helper macros for network block parser */ | ||||||
|   |   | ||||||
|  #ifdef OFFSET |  #ifdef OFFSET | ||||||
| @@ -1733,6 +1825,9 @@ static const struct parse_data ssid_fiel
 | @@ -1788,6 +1880,9 @@ static const struct parse_data ssid_fiel
 | ||||||
|  	{ INT(ap_max_inactivity) }, |  	{ INT(ap_max_inactivity) }, | ||||||
|  	{ INT(dtim_period) }, |  	{ INT(dtim_period) }, | ||||||
|  	{ INT(beacon_int) }, |  	{ INT(beacon_int) }, | ||||||
| @@ -162,7 +162,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org> | |||||||
|   |   | ||||||
|  #define MAX_SSID_LEN 32 |  #define MAX_SSID_LEN 32 | ||||||
|   |   | ||||||
| @@ -637,6 +638,10 @@ struct wpa_ssid {
 | @@ -640,6 +641,10 @@ struct wpa_ssid {
 | ||||||
|  	 */ |  	 */ | ||||||
|  	void *parent_cred; |  	void *parent_cred; | ||||||
|   |   | ||||||
| @@ -175,7 +175,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org> | |||||||
|  	 * macsec_policy - Determines the policy for MACsec secure session |  	 * macsec_policy - Determines the policy for MACsec secure session | ||||||
| --- a/wpa_supplicant/wpa_supplicant.c
 | --- a/wpa_supplicant/wpa_supplicant.c
 | ||||||
| +++ b/wpa_supplicant/wpa_supplicant.c
 | +++ b/wpa_supplicant/wpa_supplicant.c
 | ||||||
| @@ -1806,6 +1806,13 @@ static void wpas_start_assoc_cb(struct w
 | @@ -1949,6 +1949,13 @@ static void wpas_start_assoc_cb(struct w
 | ||||||
|  			params.beacon_int = ssid->beacon_int; |  			params.beacon_int = ssid->beacon_int; | ||||||
|  		else |  		else | ||||||
|  			params.beacon_int = wpa_s->conf->beacon_int; |  			params.beacon_int = wpa_s->conf->beacon_int; | ||||||
| @@ -10,7 +10,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org> | |||||||
| 
 | 
 | ||||||
| --- a/src/drivers/driver_nl80211.c
 | --- a/src/drivers/driver_nl80211.c
 | ||||||
| +++ b/src/drivers/driver_nl80211.c
 | +++ b/src/drivers/driver_nl80211.c
 | ||||||
| @@ -8581,7 +8581,7 @@ static int wpa_driver_nl80211_ibss(struc
 | @@ -9023,7 +9023,7 @@ static int wpa_driver_nl80211_ibss(struc
 | ||||||
|  				   struct wpa_driver_associate_params *params) |  				   struct wpa_driver_associate_params *params) | ||||||
|  { |  { | ||||||
|  	struct nl_msg *msg; |  	struct nl_msg *msg; | ||||||
| @@ -19,7 +19,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org> | |||||||
|  	int count = 0; |  	int count = 0; | ||||||
|   |   | ||||||
|  	wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex); |  	wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex); | ||||||
| @@ -8620,6 +8620,37 @@ retry:
 | @@ -9069,6 +9069,37 @@ retry:
 | ||||||
|  			    params->beacon_int); |  			    params->beacon_int); | ||||||
|  	} |  	} | ||||||
|   |   | ||||||
| @@ -16,7 +16,7 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org> | |||||||
| 
 | 
 | ||||||
| --- a/src/drivers/driver.h
 | --- a/src/drivers/driver.h
 | ||||||
| +++ b/src/drivers/driver.h
 | +++ b/src/drivers/driver.h
 | ||||||
| @@ -419,6 +419,8 @@ struct wpa_driver_associate_params {
 | @@ -447,6 +447,8 @@ struct wpa_driver_associate_params {
 | ||||||
|  	int fixed_freq; |  	int fixed_freq; | ||||||
|  	unsigned char rates[NL80211_MAX_SUPP_RATES]; |  	unsigned char rates[NL80211_MAX_SUPP_RATES]; | ||||||
|  	int mcast_rate; |  	int mcast_rate; | ||||||
| @@ -27,7 +27,7 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org> | |||||||
|  	 * bssid_hint - BSSID of a proposed AP |  	 * bssid_hint - BSSID of a proposed AP | ||||||
| --- a/src/drivers/driver_nl80211.c
 | --- a/src/drivers/driver_nl80211.c
 | ||||||
| +++ b/src/drivers/driver_nl80211.c
 | +++ b/src/drivers/driver_nl80211.c
 | ||||||
| @@ -8651,6 +8651,22 @@ retry:
 | @@ -9100,6 +9100,22 @@ retry:
 | ||||||
|  		NLA_PUT_U32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate); |  		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; |  		goto nla_put_failure; | ||||||
| --- a/wpa_supplicant/config.c
 | --- a/wpa_supplicant/config.c
 | ||||||
| +++ b/wpa_supplicant/config.c
 | +++ b/wpa_supplicant/config.c
 | ||||||
| @@ -1559,6 +1559,71 @@ static char * wpa_config_write_mcast_rat
 | @@ -1608,6 +1608,71 @@ static char * wpa_config_write_mcast_rat
 | ||||||
|  } |  } | ||||||
|  #endif /* NO_CONFIG_WRITE */ |  #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, |  static int wpa_config_parse_rates(const struct parse_data *data, | ||||||
|  				  struct wpa_ssid *ssid, int line, |  				  struct wpa_ssid *ssid, int line, | ||||||
|  				  const char *value) |  				  const char *value) | ||||||
| @@ -1828,6 +1893,7 @@ static const struct parse_data ssid_fiel
 | @@ -1883,6 +1948,7 @@ static const struct parse_data ssid_fiel
 | ||||||
|  	{ INT_RANGE(fixed_freq, 0, 1) }, |  	{ INT_RANGE(fixed_freq, 0, 1) }, | ||||||
|  	{ FUNC(rates) }, |  	{ FUNC(rates) }, | ||||||
|  	{ FUNC(mcast_rate) }, |  	{ FUNC(mcast_rate) }, | ||||||
| @@ -134,7 +134,7 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org> | |||||||
|  #endif /* CONFIG_MACSEC */ |  #endif /* CONFIG_MACSEC */ | ||||||
| --- a/wpa_supplicant/config_ssid.h
 | --- a/wpa_supplicant/config_ssid.h
 | ||||||
| +++ b/wpa_supplicant/config_ssid.h
 | +++ b/wpa_supplicant/config_ssid.h
 | ||||||
| @@ -641,6 +641,8 @@ struct wpa_ssid {
 | @@ -644,6 +644,8 @@ struct wpa_ssid {
 | ||||||
|  	int fixed_freq; |  	int fixed_freq; | ||||||
|  	unsigned char rates[NL80211_MAX_SUPP_RATES]; |  	unsigned char rates[NL80211_MAX_SUPP_RATES]; | ||||||
|  	double mcast_rate; |  	double mcast_rate; | ||||||
| @@ -145,7 +145,7 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org> | |||||||
|  	/** |  	/** | ||||||
| --- a/wpa_supplicant/wpa_supplicant.c
 | --- a/wpa_supplicant/wpa_supplicant.c
 | ||||||
| +++ b/wpa_supplicant/wpa_supplicant.c
 | +++ b/wpa_supplicant/wpa_supplicant.c
 | ||||||
| @@ -1813,6 +1813,8 @@ static void wpas_start_assoc_cb(struct w
 | @@ -1956,6 +1956,8 @@ static void wpas_start_assoc_cb(struct w
 | ||||||
|  			i++; |  			i++; | ||||||
|  		} |  		} | ||||||
|  		params.mcast_rate = ssid->mcast_rate; |  		params.mcast_rate = ssid->mcast_rate; | ||||||
| @@ -1,6 +1,6 @@ | |||||||
| --- a/hostapd/Makefile | --- a/hostapd/Makefile | ||||||
| +++ b/hostapd/Makefile | +++ b/hostapd/Makefile | ||||||
| @@ -116,6 +116,11 @@ OBJS += ../src/common/wpa_common.o | @@ -117,6 +117,11 @@ OBJS += ../src/common/wpa_common.o | ||||||
|   |   | ||||||
|  OBJS += ../src/eapol_auth/eapol_auth_sm.o |  OBJS += ../src/eapol_auth/eapol_auth_sm.o | ||||||
|   |   | ||||||
| @@ -22,7 +22,7 @@ | |||||||
|   |   | ||||||
|  struct wpa_ctrl_dst; |  struct wpa_ctrl_dst; | ||||||
|  struct radius_server_data; |  struct radius_server_data; | ||||||
| @@ -99,6 +100,7 @@ struct hostapd_data { | @@ -102,6 +103,7 @@ struct hostapd_data { | ||||||
|  	struct hostapd_iface *iface; |  	struct hostapd_iface *iface; | ||||||
|  	struct hostapd_config *iconf; |  	struct hostapd_config *iconf; | ||||||
|  	struct hostapd_bss_config *conf; |  	struct hostapd_bss_config *conf; | ||||||
| @@ -30,7 +30,7 @@ | |||||||
|  	int interface_added; /* virtual interface added for this BSS */ |  	int interface_added; /* virtual interface added for this BSS */ | ||||||
|  	unsigned int started:1; |  	unsigned int started:1; | ||||||
|   |   | ||||||
| @@ -254,6 +256,8 @@ struct hostapd_iface { | @@ -275,6 +277,8 @@ struct hostapd_iface { | ||||||
|  	struct hostapd_config *conf; |  	struct hostapd_config *conf; | ||||||
|  	char phy[16]; /* Name of the PHY (radio) */ |  	char phy[16]; /* Name of the PHY (radio) */ | ||||||
|   |   | ||||||
| @@ -533,7 +533,7 @@ | |||||||
| +#endif | +#endif | ||||||
| --- a/src/ap/hostapd.c | --- a/src/ap/hostapd.c | ||||||
| +++ b/src/ap/hostapd.c | +++ b/src/ap/hostapd.c | ||||||
| @@ -262,6 +262,7 @@ static void hostapd_free_hapd_data(struc | @@ -263,6 +263,7 @@ static void hostapd_free_hapd_data(struc | ||||||
|  	hapd->started = 0; |  	hapd->started = 0; | ||||||
|   |   | ||||||
|  	wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface); |  	wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface); | ||||||
| @@ -541,7 +541,7 @@ | |||||||
|  	iapp_deinit(hapd->iapp); |  	iapp_deinit(hapd->iapp); | ||||||
|  	hapd->iapp = NULL; |  	hapd->iapp = NULL; | ||||||
|  	accounting_deinit(hapd); |  	accounting_deinit(hapd); | ||||||
| @@ -890,6 +891,8 @@ static int hostapd_setup_bss(struct host | @@ -907,6 +908,8 @@ static int hostapd_setup_bss(struct host | ||||||
|  	if (hapd->driver && hapd->driver->set_operstate) |  	if (hapd->driver && hapd->driver->set_operstate) | ||||||
|  		hapd->driver->set_operstate(hapd->drv_priv, 1); |  		hapd->driver->set_operstate(hapd->drv_priv, 1); | ||||||
|   |   | ||||||
| @@ -550,7 +550,7 @@ | |||||||
|  	return 0; |  	return 0; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -1180,6 +1183,7 @@ int hostapd_setup_interface_complete(str | @@ -1192,6 +1195,7 @@ int hostapd_setup_interface_complete(str | ||||||
|  	if (err) |  	if (err) | ||||||
|  		goto fail; |  		goto fail; | ||||||
|   |   | ||||||
| @@ -558,7 +558,7 @@ | |||||||
|  	wpa_printf(MSG_DEBUG, "Completing interface initialization"); |  	wpa_printf(MSG_DEBUG, "Completing interface initialization"); | ||||||
|  	if (iface->conf->channel) { |  	if (iface->conf->channel) { | ||||||
|  #ifdef NEED_AP_MLME |  #ifdef NEED_AP_MLME | ||||||
| @@ -1297,6 +1301,7 @@ int hostapd_setup_interface_complete(str | @@ -1322,6 +1326,7 @@ int hostapd_setup_interface_complete(str | ||||||
|   |   | ||||||
|  fail: |  fail: | ||||||
|  	wpa_printf(MSG_ERROR, "Interface initialization failed"); |  	wpa_printf(MSG_ERROR, "Interface initialization failed"); | ||||||
| @@ -566,7 +566,7 @@ | |||||||
|  	hostapd_set_state(iface, HAPD_IFACE_DISABLED); |  	hostapd_set_state(iface, HAPD_IFACE_DISABLED); | ||||||
|  	wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); |  	wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); | ||||||
|  	if (iface->interfaces && iface->interfaces->terminate_on_error) |  	if (iface->interfaces && iface->interfaces->terminate_on_error) | ||||||
| @@ -1623,6 +1628,7 @@ void hostapd_interface_deinit_free(struc | @@ -1648,6 +1653,7 @@ void hostapd_interface_deinit_free(struc | ||||||
|  		   (unsigned int) iface->conf->num_bss); |  		   (unsigned int) iface->conf->num_bss); | ||||||
|  	driver = iface->bss[0]->driver; |  	driver = iface->bss[0]->driver; | ||||||
|  	drv_priv = iface->bss[0]->drv_priv; |  	drv_priv = iface->bss[0]->drv_priv; | ||||||
| @@ -576,7 +576,7 @@ | |||||||
|  		   __func__, driver, drv_priv); |  		   __func__, driver, drv_priv); | ||||||
| --- a/src/ap/ieee802_11.c | --- a/src/ap/ieee802_11.c | ||||||
| +++ b/src/ap/ieee802_11.c | +++ b/src/ap/ieee802_11.c | ||||||
| @@ -540,7 +540,8 @@ failed: | @@ -545,7 +545,8 @@ failed: | ||||||
|   |   | ||||||
|   |   | ||||||
|  static void handle_auth(struct hostapd_data *hapd, |  static void handle_auth(struct hostapd_data *hapd, | ||||||
| @@ -586,7 +586,7 @@ | |||||||
|  { |  { | ||||||
|  	u16 auth_alg, auth_transaction, status_code; |  	u16 auth_alg, auth_transaction, status_code; | ||||||
|  	u16 resp = WLAN_STATUS_SUCCESS; |  	u16 resp = WLAN_STATUS_SUCCESS; | ||||||
| @@ -555,6 +556,11 @@ static void handle_auth(struct hostapd_d | @@ -560,6 +561,11 @@ static void handle_auth(struct hostapd_d | ||||||
|  	size_t resp_ies_len = 0; |  	size_t resp_ies_len = 0; | ||||||
|  	char *identity = NULL; |  	char *identity = NULL; | ||||||
|  	char *radius_cui = NULL; |  	char *radius_cui = NULL; | ||||||
| @@ -598,7 +598,7 @@ | |||||||
|   |   | ||||||
|  	if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.auth)) { |  	if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.auth)) { | ||||||
|  		wpa_printf(MSG_INFO, "handle_auth - too short payload (len=%lu)", |  		wpa_printf(MSG_INFO, "handle_auth - too short payload (len=%lu)", | ||||||
| @@ -638,6 +644,14 @@ static void handle_auth(struct hostapd_d | @@ -643,6 +649,14 @@ static void handle_auth(struct hostapd_d | ||||||
|  		resp = WLAN_STATUS_UNSPECIFIED_FAILURE; |  		resp = WLAN_STATUS_UNSPECIFIED_FAILURE; | ||||||
|  		goto fail; |  		goto fail; | ||||||
|  	} |  	} | ||||||
| @@ -613,7 +613,7 @@ | |||||||
|  	if (res == HOSTAPD_ACL_PENDING) { |  	if (res == HOSTAPD_ACL_PENDING) { | ||||||
|  		wpa_printf(MSG_DEBUG, "Authentication frame from " MACSTR |  		wpa_printf(MSG_DEBUG, "Authentication frame from " MACSTR | ||||||
|  			   " waiting for an external authentication", |  			   " waiting for an external authentication", | ||||||
| @@ -1272,13 +1286,18 @@ static void send_assoc_resp(struct hosta | @@ -1289,13 +1303,18 @@ static void send_assoc_resp(struct hosta | ||||||
|   |   | ||||||
|  static void handle_assoc(struct hostapd_data *hapd, |  static void handle_assoc(struct hostapd_data *hapd, | ||||||
|  			 const struct ieee80211_mgmt *mgmt, size_t len, |  			 const struct ieee80211_mgmt *mgmt, size_t len, | ||||||
| @@ -633,7 +633,7 @@ | |||||||
|   |   | ||||||
|  	if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_req) : |  	if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_req) : | ||||||
|  				      sizeof(mgmt->u.assoc_req))) { |  				      sizeof(mgmt->u.assoc_req))) { | ||||||
| @@ -1377,6 +1396,13 @@ static void handle_assoc(struct hostapd_ | @@ -1394,6 +1413,13 @@ static void handle_assoc(struct hostapd_ | ||||||
|  		goto fail; |  		goto fail; | ||||||
|  	} |  	} | ||||||
|   |   | ||||||
| @@ -647,7 +647,7 @@ | |||||||
|  	sta->capability = capab_info; |  	sta->capability = capab_info; | ||||||
|  	sta->listen_interval = listen_interval; |  	sta->listen_interval = listen_interval; | ||||||
|   |   | ||||||
| @@ -1765,7 +1791,7 @@ int ieee802_11_mgmt(struct hostapd_data | @@ -1785,7 +1811,7 @@ int ieee802_11_mgmt(struct hostapd_data  | ||||||
|   |   | ||||||
|   |   | ||||||
|  	if (stype == WLAN_FC_STYPE_PROBE_REQ) { |  	if (stype == WLAN_FC_STYPE_PROBE_REQ) { | ||||||
| @@ -656,7 +656,7 @@ | |||||||
|  		return 1; |  		return 1; | ||||||
|  	} |  	} | ||||||
|   |   | ||||||
| @@ -1780,17 +1806,17 @@ int ieee802_11_mgmt(struct hostapd_data | @@ -1800,17 +1826,17 @@ int ieee802_11_mgmt(struct hostapd_data  | ||||||
|  	switch (stype) { |  	switch (stype) { | ||||||
|  	case WLAN_FC_STYPE_AUTH: |  	case WLAN_FC_STYPE_AUTH: | ||||||
|  		wpa_printf(MSG_DEBUG, "mgmt::auth"); |  		wpa_printf(MSG_DEBUG, "mgmt::auth"); | ||||||
| @@ -679,7 +679,7 @@ | |||||||
|  	case WLAN_FC_STYPE_DISASSOC: |  	case WLAN_FC_STYPE_DISASSOC: | ||||||
| --- a/src/ap/beacon.c | --- a/src/ap/beacon.c | ||||||
| +++ b/src/ap/beacon.c | +++ b/src/ap/beacon.c | ||||||
| @@ -498,7 +498,7 @@ static enum ssid_match_result ssid_match | @@ -513,7 +513,7 @@ static enum ssid_match_result ssid_match | ||||||
|   |   | ||||||
|  void handle_probe_req(struct hostapd_data *hapd, |  void handle_probe_req(struct hostapd_data *hapd, | ||||||
|  		      const struct ieee80211_mgmt *mgmt, size_t len, |  		      const struct ieee80211_mgmt *mgmt, size_t len, | ||||||
| @@ -688,7 +688,7 @@ | |||||||
|  { |  { | ||||||
|  	u8 *resp; |  	u8 *resp; | ||||||
|  	struct ieee802_11_elems elems; |  	struct ieee802_11_elems elems; | ||||||
| @@ -506,8 +506,14 @@ void handle_probe_req(struct hostapd_dat | @@ -521,8 +521,14 @@ void handle_probe_req(struct hostapd_dat | ||||||
|  	size_t ie_len; |  	size_t ie_len; | ||||||
|  	struct sta_info *sta = NULL; |  	struct sta_info *sta = NULL; | ||||||
|  	size_t i, resp_len; |  	size_t i, resp_len; | ||||||
| @@ -703,7 +703,7 @@ | |||||||
|   |   | ||||||
|  	ie = mgmt->u.probe_req.variable; |  	ie = mgmt->u.probe_req.variable; | ||||||
|  	if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.probe_req)) |  	if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.probe_req)) | ||||||
| @@ -645,6 +651,12 @@ void handle_probe_req(struct hostapd_dat | @@ -660,6 +666,12 @@ void handle_probe_req(struct hostapd_dat | ||||||
|  	} |  	} | ||||||
|  #endif /* CONFIG_P2P */ |  #endif /* CONFIG_P2P */ | ||||||
|   |   | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Felix Fietkau
					Felix Fietkau