include $(TOPDIR)/rules.mk
PKG_NAME:=hostapd
-PKG_VERSION:=2016-06-15
+PKG_VERSION:=2016-09-05
PKG_RELEASE:=1
-PKG_REV:=31d3692fe5d56c05753ed4a70c7943979e1d29e7
+PKG_REV:=fcd85d9a3f2d9d63d0fa57e93446ad467db75b23
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://w1.fi/hostap.git
+++ /dev/null
-From: Masashi Honma <masashi.honma@gmail.com>
-Date: Tue, 26 Jul 2016 11:45:40 +0900
-Subject: [PATCH] mesh: Set correct secondary channel offset if HT40 is
- disabled
-
-Previously, secondary channel offset could be non zero even though
-disable_ht40=1. This patch fixes it.
-
-Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
----
-
---- a/wpa_supplicant/wpa_supplicant.c
-+++ b/wpa_supplicant/wpa_supplicant.c
-@@ -1901,20 +1901,27 @@ void ibss_mesh_setup_freq(struct wpa_sup
- break;
- }
- }
-+#ifdef CONFIG_HT_OVERRIDES
-+ if (ssid->disable_ht40)
-+ ht40 = 0;
-+#endif /* CONFIG_HT_OVERRIDES */
-
-- /* Find secondary channel */
-- for (i = 0; i < mode->num_channels; i++) {
-- sec_chan = &mode->channels[i];
-- if (sec_chan->chan == channel + ht40 * 4)
-- break;
-- sec_chan = NULL;
-- }
-- if (!sec_chan)
-- return;
-+ if (ht40) {
-+ /* Find secondary channel */
-+ for (i = 0; i < mode->num_channels; i++) {
-+ sec_chan = &mode->channels[i];
-+ if (sec_chan->chan == channel + ht40 * 4)
-+ break;
-+ sec_chan = NULL;
-+ }
-+ if (!sec_chan)
-+ return;
-
-- /* Check secondary channel flags */
-- if (sec_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
-- return;
-+ /* Check secondary channel flags */
-+ if (sec_chan->flag &
-+ (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
-+ return;
-+ }
-
- freq->channel = pri_chan->chan;
-
-@@ -1930,6 +1937,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
- freq->sec_channel_offset = 1;
- break;
- default:
-+ freq->sec_channel_offset = 0;
- break;
- }
-
--- /dev/null
+--- a/src/utils/os_unix.c
++++ b/src/utils/os_unix.c
+@@ -10,6 +10,7 @@
+
+ #include <time.h>
+ #include <sys/wait.h>
++#include <fcntl.h>
+
+ #ifdef ANDROID
+ #include <sys/capability.h>
+@@ -179,59 +180,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__) */
+++ /dev/null
---- a/src/drivers/driver_nl80211.c
-+++ b/src/drivers/driver_nl80211.c
-@@ -2332,7 +2332,8 @@ wpa_driver_nl80211_finish_drv_init(struc
-
- if (drv->hostapd || bss->static_ap)
- nlmode = NL80211_IFTYPE_AP;
-- else if (bss->if_dynamic)
-+ else if (bss->if_dynamic ||
-+ nl80211_get_ifmode(bss) == NL80211_IFTYPE_MESH_POINT)
- nlmode = nl80211_get_ifmode(bss);
- else
- nlmode = NL80211_IFTYPE_STATION;
+++ /dev/null
---- a/hostapd/config_file.c
-+++ b/hostapd/config_file.c
-@@ -645,6 +645,7 @@ static int hostapd_parse_das_client(stru
- if (secret == NULL)
- return -1;
-
-+ *secret = 0;
- secret++;
-
- if (hostapd_parse_ip_addr(val, &bss->radius_das_client_addr))
--- /dev/null
+--- a/wpa_supplicant/wpa_supplicant.c
++++ b/wpa_supplicant/wpa_supplicant.c
+@@ -257,9 +257,10 @@ void wpa_supplicant_cancel_auth_timeout(
+ */
+ void wpa_supplicant_initiate_eapol(struct wpa_supplicant *wpa_s)
+ {
++ struct wpa_ssid *ssid = wpa_s->current_ssid;
++
+ #ifdef IEEE8021X_EAPOL
+ struct eapol_config eapol_conf;
+- struct wpa_ssid *ssid = wpa_s->current_ssid;
+
+ #ifdef CONFIG_IBSS_RSN
+ if (ssid->mode == WPAS_MODE_IBSS &&
+++ /dev/null
---- a/src/utils/os_unix.c
-+++ b/src/utils/os_unix.c
-@@ -10,6 +10,7 @@
-
- #include <time.h>
- #include <sys/wait.h>
-+#include <fcntl.h>
-
- #ifdef ANDROID
- #include <sys/capability.h>
-@@ -179,59 +180,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__) */
--- /dev/null
+--- a/src/l2_packet/l2_packet_linux.c
++++ b/src/l2_packet/l2_packet_linux.c
+@@ -337,8 +337,7 @@ struct l2_packet_data * l2_packet_init_b
+
+ l2 = l2_packet_init(br_ifname, own_addr, protocol, rx_callback,
+ rx_callback_ctx, l2_hdr);
+- if (!l2)
+- return NULL;
++ return l2;
+
+ #ifndef CONFIG_NO_LINUX_PACKET_SOCKET_WAR
+ /*
+++ /dev/null
---- a/wpa_supplicant/wpa_supplicant.c
-+++ b/wpa_supplicant/wpa_supplicant.c
-@@ -257,9 +257,10 @@ void wpa_supplicant_cancel_auth_timeout(
- */
- void wpa_supplicant_initiate_eapol(struct wpa_supplicant *wpa_s)
- {
-+ struct wpa_ssid *ssid = wpa_s->current_ssid;
-+
- #ifdef IEEE8021X_EAPOL
- struct eapol_config eapol_conf;
-- struct wpa_ssid *ssid = wpa_s->current_ssid;
-
- #ifdef CONFIG_IBSS_RSN
- if (ssid->mode == WPAS_MODE_IBSS &&
+++ /dev/null
---- a/src/l2_packet/l2_packet_linux.c
-+++ b/src/l2_packet/l2_packet_linux.c
-@@ -337,8 +337,7 @@ struct l2_packet_data * l2_packet_init_b
-
- l2 = l2_packet_init(br_ifname, own_addr, protocol, rx_callback,
- rx_callback_ctx, l2_hdr);
-- if (!l2)
-- return NULL;
-+ return l2;
-
- #ifndef CONFIG_NO_LINUX_PACKET_SOCKET_WAR
- /*
ifndef CONFIG_NO_GITVER
# Add VERSION_STR postfix for builds from a git repository
-@@ -190,7 +191,8 @@ endif
+@@ -193,7 +194,8 @@ endif
ifdef CONFIG_NO_VLAN
CFLAGS += -DCONFIG_NO_VLAN
OBJS += ../src/ap/vlan_init.o
OBJS += ../src/ap/vlan_ifconfig.o
OBJS += ../src/ap/vlan.o
-@@ -315,10 +317,14 @@ CFLAGS += -DCONFIG_MBO
+@@ -318,10 +320,14 @@ CFLAGS += -DCONFIG_MBO
OBJS += ../src/ap/mbo_ap.o
endif
LIBS += $(DRV_AP_LIBS)
ifdef CONFIG_L2_PACKET
-@@ -1051,6 +1057,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR)
+@@ -1054,6 +1060,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR)
BCHECK=../src/drivers/build.hostapd
hostapd: $(BCHECK) $(OBJS)
$(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
@$(E) " LD " $@
-@@ -1092,6 +1104,12 @@ HOBJS += ../src/crypto/aes-internal.o
+@@ -1095,6 +1107,12 @@ HOBJS += ../src/crypto/aes-internal.o
HOBJS += ../src/crypto/aes-internal-enc.o
endif
ifndef CONFIG_NO_GITVER
# Add VERSION_STR postfix for builds from a git repository
-@@ -312,7 +313,9 @@ endif
+@@ -313,7 +314,9 @@ endif
ifdef CONFIG_IBSS_RSN
NEED_RSN_AUTHENTICATOR=y
CFLAGS += -DCONFIG_IBSS_RSN
OBJS += ibss_rsn.o
endif
-@@ -803,6 +806,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
+@@ -804,6 +807,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
LIBS += -ldl -rdynamic
endif
endif
ifdef CONFIG_MACSEC
-@@ -823,9 +830,11 @@ NEED_EAP_COMMON=y
+@@ -824,9 +831,11 @@ NEED_EAP_COMMON=y
NEED_RSN_AUTHENTICATOR=y
CFLAGS += -DCONFIG_AP
OBJS += ap.o
OBJS += ../src/ap/hostapd.o
OBJS += ../src/ap/wpa_auth_glue.o
OBJS += ../src/ap/utils.o
-@@ -898,10 +907,18 @@ endif
+@@ -899,10 +908,18 @@ endif
ifdef CONFIG_HS20
OBJS += ../src/ap/hs20.o
endif
NEED_AES_WRAP=y
OBJS += ../src/ap/wpa_auth.o
OBJS += ../src/ap/wpa_auth_ie.o
-@@ -1680,6 +1697,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
+@@ -1685,6 +1702,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
$(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config
wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
@$(E) " LD " $@
-@@ -1782,6 +1805,12 @@ endif
+@@ -1787,6 +1810,12 @@ endif
-e 's|\@DBUS_INTERFACE\@|$(DBUS_INTERFACE)|g' $< >$@
@$(E) " sed" $<
wpa_cli.exe: wpa_cli
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
-@@ -4794,8 +4794,8 @@ union wpa_event_data {
+@@ -4870,8 +4870,8 @@ union wpa_event_data {
* Driver wrapper code should call this function whenever an event is received
* from the driver.
*/
/**
* wpa_supplicant_event_global - Report a driver event for wpa_supplicant
-@@ -4807,7 +4807,7 @@ void wpa_supplicant_event(void *ctx, enu
+@@ -4883,7 +4883,7 @@ void wpa_supplicant_event(void *ctx, enu
* Same as wpa_supplicant_event(), but we search for the interface in
* wpa_global.
*/
/*
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
-@@ -1157,8 +1157,8 @@ static void hostapd_event_dfs_cac_starte
+@@ -1164,8 +1164,8 @@ static void hostapd_event_dfs_cac_starte
#endif /* NEED_AP_MLME */
{
struct hostapd_data *hapd = ctx;
#ifndef CONFIG_NO_STDOUT_DEBUG
-@@ -1367,7 +1367,7 @@ void wpa_supplicant_event(void *ctx, enu
+@@ -1374,7 +1374,7 @@ void wpa_supplicant_event(void *ctx, enu
}
os_memset(&global, 0, sizeof(global));
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
-@@ -3384,8 +3384,8 @@ static void wpa_supplicant_event_assoc_a
+@@ -3398,8 +3398,8 @@ static void wpa_supplicant_event_assoc_a
}
{
struct wpa_supplicant *wpa_s = ctx;
int resched;
-@@ -4051,7 +4051,7 @@ void wpa_supplicant_event(void *ctx, enu
+@@ -4074,7 +4074,7 @@ void wpa_supplicant_event(void *ctx, enu
#endif /* CONFIG_AP */
break;
case EVENT_ACS_CHANNEL_SELECTED:
if (!wpa_s->ap_iface)
break;
hostapd_acs_channel_selected(wpa_s->ap_iface->bss[0],
-@@ -4065,7 +4065,7 @@ void wpa_supplicant_event(void *ctx, enu
+@@ -4096,7 +4096,7 @@ void wpa_supplicant_event(void *ctx, enu
}
struct wpa_supplicant *wpa_s;
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
-@@ -4990,7 +4990,6 @@ struct wpa_interface * wpa_supplicant_ma
+@@ -5094,7 +5094,6 @@ struct wpa_interface * wpa_supplicant_ma
return NULL;
}
/**
* wpa_supplicant_match_existing - Match existing interfaces
* @global: Pointer to global data from wpa_supplicant_init()
-@@ -5027,6 +5026,11 @@ static int wpa_supplicant_match_existing
+@@ -5131,6 +5130,11 @@ static int wpa_supplicant_match_existing
#endif /* CONFIG_MATCH_IFACE */
/**
* wpa_supplicant_add_iface - Add a new network interface
-@@ -5282,6 +5286,8 @@ struct wpa_global * wpa_supplicant_init(
+@@ -5386,6 +5390,8 @@ struct wpa_global * wpa_supplicant_init(
#ifndef CONFIG_NO_WPA_MSG
wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb);
#endif /* CONFIG_NO_WPA_MSG */
if (c < 0)
--- a/src/drivers/drivers.c
+++ b/src/drivers/drivers.c
-@@ -10,6 +10,11 @@
+@@ -10,6 +10,10 @@
#include "utils/common.h"
#include "driver.h"
+ union wpa_event_data *data);
+void (*wpa_supplicant_event_global)(void *ctx, enum wpa_event_type event,
+ union wpa_event_data *data);
-+
- #ifdef CONFIG_DRIVER_WEXT
- extern struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */
- #endif /* CONFIG_DRIVER_WEXT */
+
+ const struct wpa_driver_ops *const wpa_drivers[] =
+ {
--- a/wpa_supplicant/eapol_test.c
+++ b/wpa_supplicant/eapol_test.c
@@ -29,7 +29,12 @@
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
-@@ -2862,6 +2862,10 @@ static int hostapd_config_fill(struct ho
+@@ -2863,6 +2863,10 @@ static int hostapd_config_fill(struct ho
}
#endif /* CONFIG_IEEE80211W */
#ifdef CONFIG_IEEE80211N
} else if (os_strcmp(buf, "ht_capab") == 0) {
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
-@@ -655,6 +655,8 @@ struct hostapd_config {
+@@ -664,6 +664,8 @@ struct hostapd_config {
int ht_op_mode_fixed;
u16 ht_capab;
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
-@@ -3556,7 +3556,7 @@ wpa_supplicant_alloc(struct wpa_supplica
+@@ -3654,7 +3654,7 @@ wpa_supplicant_alloc(struct wpa_supplica
if (wpa_s == NULL)
return NULL;
wpa_s->scan_req = INITIAL_SCAN_REQ;
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -3795,7 +3795,7 @@ static int nl80211_set_channel(struct i8
+@@ -3864,7 +3864,7 @@ static int nl80211_set_channel(struct i8
freq->freq, freq->ht_enabled, freq->vht_enabled,
freq->bandwidth, freq->center_freq1, freq->center_freq2);
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -2394,13 +2394,18 @@ wpa_driver_nl80211_finish_drv_init(struc
+@@ -2398,13 +2398,18 @@ wpa_driver_nl80211_finish_drv_init(struc
}
return send_and_recv_msgs(drv, msg, NULL, NULL);
}
-@@ -2452,7 +2457,7 @@ static void wpa_driver_nl80211_deinit(st
+@@ -2456,7 +2461,7 @@ static void wpa_driver_nl80211_deinit(st
nl80211_remove_monitor_interface(drv);
if (is_ap_interface(drv->nlmode))
if (drv->eapol_sock >= 0) {
eloop_unregister_read_sock(drv->eapol_sock);
-@@ -4385,8 +4390,7 @@ static void nl80211_teardown_ap(struct i
+@@ -4462,8 +4467,7 @@ static void nl80211_teardown_ap(struct i
nl80211_remove_monitor_interface(drv);
else
nl80211_mgmt_unsubscribe(bss, "AP teardown");
}
-@@ -6387,8 +6391,6 @@ static int wpa_driver_nl80211_if_remove(
+@@ -6472,8 +6476,6 @@ static int wpa_driver_nl80211_if_remove(
} else {
wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context");
nl80211_teardown_ap(bss);
nl80211_destroy_bss(bss);
if (!bss->added_if)
i802_set_iface_flags(bss, 0);
-@@ -6750,8 +6752,7 @@ static int wpa_driver_nl80211_deinit_ap(
+@@ -6835,8 +6837,7 @@ static int wpa_driver_nl80211_deinit_ap(
struct wpa_driver_nl80211_data *drv = bss->drv;
if (!is_ap_interface(drv->nlmode))
return -1;
/*
* If the P2P GO interface was dynamically added, then it is
-@@ -6770,8 +6771,7 @@ static int wpa_driver_nl80211_stop_ap(vo
+@@ -6855,8 +6856,7 @@ static int wpa_driver_nl80211_stop_ap(vo
struct wpa_driver_nl80211_data *drv = bss->drv;
if (!is_ap_interface(drv->nlmode))
return -1;
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -54,6 +54,7 @@
+@@ -55,6 +55,7 @@
#include "fst/fst_ctrl_iface.h"
#include "config_file.h"
#include "ctrl_iface.h"
#define HOSTAPD_CLI_DUP_VALUE_MAX_LEN 256
-@@ -72,6 +73,7 @@ static void hostapd_ctrl_iface_send(stru
+@@ -73,6 +74,7 @@ static void hostapd_ctrl_iface_send(stru
enum wpa_msg_type type,
const char *buf, size_t len);
static int hostapd_ctrl_iface_attach(struct hostapd_data *hapd,
struct sockaddr_storage *from,
-@@ -123,6 +125,61 @@ static int hostapd_ctrl_iface_new_sta(st
+@@ -124,6 +126,61 @@ static int hostapd_ctrl_iface_new_sta(st
return 0;
}
#ifdef CONFIG_IEEE80211W
#ifdef NEED_AP_MLME
-@@ -2483,6 +2540,8 @@ static int hostapd_ctrl_iface_receive_pr
+@@ -2505,6 +2562,8 @@ static int hostapd_ctrl_iface_receive_pr
} else if (os_strncmp(buf, "VENDOR ", 7) == 0) {
reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply,
reply_size);
#ifdef RADIUS_SERVER
--- a/src/ap/ctrl_iface_ap.c
+++ b/src/ap/ctrl_iface_ap.c
-@@ -593,7 +593,13 @@ int hostapd_parse_csa_settings(const cha
+@@ -601,7 +601,13 @@ int hostapd_parse_csa_settings(const cha
int hostapd_ctrl_iface_stop_ap(struct hostapd_data *hapd)
{
-include .config
-include $(if $(MULTICALL),../hostapd/.config)
-@@ -113,6 +117,8 @@ OBJS_c += ../src/utils/wpa_debug.o
- OBJS_c += ../src/utils/common.o
+@@ -114,6 +118,8 @@ OBJS_c += ../src/utils/common.o
+ OBJS_c += ../src/common/cli.o
OBJS += wmm_ac.o
+OBJS += ../src/common/wpa_ctrl.o
wpa_s->new_connection = 1;
wpa_drv_set_operstate(wpa_s, 0);
#ifndef IEEE8021X_EAPOL
-@@ -4646,6 +4699,20 @@ static int wpa_supplicant_init_iface(str
+@@ -4748,6 +4801,20 @@ static int wpa_supplicant_init_iface(str
sizeof(wpa_s->bridge_ifname));
}
/* RSNA Supplicant Key Management - INITIALIZE */
eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE);
eapol_sm_notify_portValid(wpa_s->eapol, FALSE);
-@@ -4937,6 +5004,11 @@ static void wpa_supplicant_deinit_iface(
+@@ -5041,6 +5108,11 @@ static void wpa_supplicant_deinit_iface(
if (terminate)
wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING);
#include "common/ieee802_11_defs.h"
+#include "common/ieee802_11_common.h"
#include "drivers/driver.h"
+ #include "eap_peer/eap.h"
#include "wpa_supplicant_i.h"
- #include "config.h"
-@@ -287,6 +288,10 @@ static void calculate_update_time(const
+@@ -288,6 +289,10 @@ static void calculate_update_time(const
static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src,
struct os_reltime *fetch_time)
{
dst->flags = src->flags;
os_memcpy(dst->bssid, src->bssid, ETH_ALEN);
dst->freq = src->freq;
-@@ -299,6 +304,15 @@ static void wpa_bss_copy_res(struct wpa_
+@@ -300,6 +305,15 @@ static void wpa_bss_copy_res(struct wpa_
dst->est_throughput = src->est_throughput;
dst->snr = src->snr;
--- a/hostapd/Makefile
+++ b/hostapd/Makefile
-@@ -212,6 +212,9 @@ endif
+@@ -215,6 +215,9 @@ endif
ifdef CONFIG_NO_CTRL_IFACE
CFLAGS += -DCONFIG_NO_CTRL_IFACE
else
else
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
-@@ -2342,6 +2342,7 @@ static int hostapd_ctrl_iface_receive_pr
+@@ -2364,6 +2364,7 @@ static int hostapd_ctrl_iface_receive_pr
reply_size);
} else if (os_strcmp(buf, "STATUS-DRIVER") == 0) {
reply_len = hostapd_drv_status(hapd, reply, reply_size);
} else if (os_strcmp(buf, "MIB") == 0) {
reply_len = ieee802_11_get_mib(hapd, reply, reply_size);
if (reply_len >= 0) {
-@@ -2383,6 +2384,7 @@ static int hostapd_ctrl_iface_receive_pr
+@@ -2405,6 +2406,7 @@ static int hostapd_ctrl_iface_receive_pr
} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply,
reply_size);
reply_len = -1;
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
-@@ -874,6 +874,9 @@ ifdef CONFIG_MBO
+@@ -875,6 +875,9 @@ ifdef CONFIG_MBO
OBJS += ../src/ap/mbo_ap.o
endif
ifdef CONFIG_CTRL_IFACE
if (wpa_s->ap_iface) {
pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos,
end - pos,
-@@ -8687,6 +8687,7 @@ char * wpa_supplicant_ctrl_iface_process
+@@ -8684,6 +8684,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);
} else if (os_strcmp(buf, "MIB") == 0) {
reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size);
if (reply_len >= 0) {
-@@ -8694,6 +8695,7 @@ char * wpa_supplicant_ctrl_iface_process
+@@ -8691,6 +8692,7 @@ char * wpa_supplicant_ctrl_iface_process
reply + reply_len,
reply_size - reply_len);
}
} else if (os_strncmp(buf, "STATUS", 6) == 0) {
reply_len = wpa_supplicant_ctrl_iface_status(
wpa_s, buf + 6, reply, reply_size);
-@@ -9164,6 +9166,7 @@ char * wpa_supplicant_ctrl_iface_process
+@@ -9161,6 +9163,7 @@ char * wpa_supplicant_ctrl_iface_process
reply_len = wpa_supplicant_ctrl_iface_bss(
wpa_s, buf + 4, reply, reply_size);
#ifdef CONFIG_AP
} 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) {
-@@ -9172,12 +9175,15 @@ char * wpa_supplicant_ctrl_iface_process
+@@ -9169,12 +9172,15 @@ 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);
static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype,
--- a/src/ap/ieee802_1x.c
+++ b/src/ap/ieee802_1x.c
-@@ -2441,6 +2441,7 @@ static const char * bool_txt(Boolean val
+@@ -2442,6 +2442,7 @@ static const char * bool_txt(Boolean val
return val ? "TRUE" : "FALSE";
}
int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen)
{
-@@ -2616,6 +2617,7 @@ int ieee802_1x_get_mib_sta(struct hostap
+@@ -2617,6 +2618,7 @@ int ieee802_1x_get_mib_sta(struct hostap
return len;
}
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
-@@ -1114,7 +1114,7 @@ int wpas_ap_wps_nfc_report_handover(stru
+@@ -1119,7 +1119,7 @@ int wpas_ap_wps_nfc_report_handover(stru
#endif /* CONFIG_WPS */
--- a/src/common/wpa_common.c
+++ b/src/common/wpa_common.c
-@@ -1244,6 +1244,31 @@ u32 wpa_akm_to_suite(int akm)
+@@ -1246,6 +1246,31 @@ u32 wpa_akm_to_suite(int akm)
}
int wpa_compare_rsn_ie(int ft_initial_assoc,
const u8 *ie1, size_t ie1len,
const u8 *ie2, size_t ie2len)
-@@ -1251,8 +1276,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
+@@ -1253,8 +1278,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
if (ie1 == NULL || ie2 == NULL)
return -1;
--- a/src/ap/wps_hostapd.c
+++ b/src/ap/wps_hostapd.c
-@@ -352,8 +352,7 @@ static int hapd_wps_reconfig_in_memory(s
+@@ -346,8 +346,7 @@ static int hapd_wps_reconfig_in_memory(s
bss->wpa_pairwise |= WPA_CIPHER_GCMP;
else
bss->wpa_pairwise |= WPA_CIPHER_CCMP;
bss->wpa_pairwise |= WPA_CIPHER_TKIP;
bss->rsn_pairwise = bss->wpa_pairwise;
bss->wpa_group = wpa_select_ap_group_cipher(bss->wpa,
-@@ -1073,8 +1072,7 @@ int hostapd_init_wps(struct hostapd_data
+@@ -1067,8 +1066,7 @@ int hostapd_init_wps(struct hostapd_data
if (conf->rsn_pairwise & (WPA_CIPHER_CCMP | WPA_CIPHER_GCMP)) {
wps->encr_types |= WPS_ENCR_AES;
wps->encr_types_rsn |= WPS_ENCR_AES;
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
-@@ -69,7 +69,6 @@ static const char *const commands_help =
- #ifdef CONFIG_IEEE80211W
- " sa_query <addr> send SA Query to a station\n"
- #endif /* CONFIG_IEEE80211W */
--#ifdef CONFIG_WPS
- " 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"
-@@ -82,7 +81,6 @@ static const char *const 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"
-@@ -418,7 +416,6 @@ static int hostapd_cli_cmd_sa_query(stru
+@@ -382,7 +382,6 @@ static int hostapd_cli_cmd_sa_query(stru
#endif /* CONFIG_IEEE80211W */
static int hostapd_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc,
char *argv[])
{
-@@ -644,7 +641,6 @@ static int hostapd_cli_cmd_wps_config(st
+@@ -608,7 +607,6 @@ static int hostapd_cli_cmd_wps_config(st
ssid_hex, argv[1]);
return wpa_ctrl_command(ctrl, buf);
}
static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc,
-@@ -1236,7 +1232,6 @@ static const struct hostapd_cli_cmd host
- #ifdef CONFIG_IEEE80211W
- { "sa_query", hostapd_cli_cmd_sa_query },
+@@ -1275,7 +1273,6 @@ static const struct hostapd_cli_cmd host
+ { "sa_query", hostapd_cli_cmd_sa_query, NULL,
+ "<addr> = send SA Query to a station" },
#endif /* CONFIG_IEEE80211W */
-#ifdef CONFIG_WPS
- { "wps_pin", hostapd_cli_cmd_wps_pin },
- { "wps_check_pin", hostapd_cli_cmd_wps_check_pin },
- { "wps_pbc", hostapd_cli_cmd_wps_pbc },
-@@ -1250,7 +1245,6 @@ static const struct hostapd_cli_cmd host
- { "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 },
+ { "wps_pin", hostapd_cli_cmd_wps_pin, NULL,
+ "<uuid> <pin> [timeout] [addr] = add WPS Enrollee PIN" },
+ { "wps_check_pin", hostapd_cli_cmd_wps_check_pin, NULL,
+@@ -1300,7 +1297,6 @@ static const struct hostapd_cli_cmd host
+ "<SSID> <auth> <encr> <key> = configure AP" },
+ { "wps_get_status", hostapd_cli_cmd_wps_get_status, NULL,
+ "= show current WPS status" },
-#endif /* CONFIG_WPS */
- { "disassoc_imminent", hostapd_cli_cmd_disassoc_imminent },
- { "ess_disassoc", hostapd_cli_cmd_ess_disassoc },
- { "bss_tm_req", hostapd_cli_cmd_bss_tm_req },
+ { "disassoc_imminent", hostapd_cli_cmd_disassoc_imminent, NULL, NULL },
+ { "ess_disassoc", hostapd_cli_cmd_ess_disassoc, NULL, NULL },
+ { "bss_tm_req", hostapd_cli_cmd_bss_tm_req, NULL, NULL },
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
-@@ -25,6 +25,9 @@
+@@ -26,6 +26,9 @@
#include <cutils/properties.h>
#endif /* ANDROID */
/* Helper macros for network block parser */
#ifdef OFFSET
-@@ -2047,6 +2139,9 @@ static const struct parse_data ssid_fiel
+@@ -2048,6 +2140,9 @@ static const struct parse_data ssid_fiel
{ INT(ap_max_inactivity) },
{ INT(dtim_period) },
{ INT(beacon_int) },
#define DEFAULT_EAP_WORKAROUND ((unsigned int) -1)
-@@ -711,6 +713,9 @@ struct wpa_ssid {
+@@ -719,6 +721,9 @@ struct wpa_ssid {
*/
void *parent_cred;
* macsec_policy - Determines the policy for MACsec secure session
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
-@@ -2518,6 +2518,13 @@ static void wpas_start_assoc_cb(struct w
+@@ -2527,6 +2527,13 @@ static void wpas_start_assoc_cb(struct w
params.beacon_int = ssid->beacon_int;
else
params.beacon_int = wpa_s->conf->beacon_int;
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -4644,7 +4644,7 @@ static int wpa_driver_nl80211_ibss(struc
+@@ -4721,7 +4721,7 @@ static int wpa_driver_nl80211_ibss(struc
struct wpa_driver_associate_params *params)
{
struct nl_msg *msg;
int count = 0;
wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex);
-@@ -4671,6 +4671,37 @@ retry:
+@@ -4748,6 +4748,37 @@ retry:
nl80211_put_beacon_int(msg, params->beacon_int))
goto fail;
* bssid_hint - BSSID of a proposed AP
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
-@@ -4702,6 +4702,22 @@ retry:
+@@ -4779,6 +4779,22 @@ retry:
nla_put_u32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate);
}
static int wpa_config_parse_rates(const struct parse_data *data,
struct wpa_ssid *ssid, int line,
const char *value)
-@@ -2142,6 +2207,7 @@ static const struct parse_data ssid_fiel
+@@ -2143,6 +2208,7 @@ static const struct parse_data ssid_fiel
{ INT_RANGE(fixed_freq, 0, 1) },
{ FUNC(rates) },
{ FUNC(mcast_rate) },
#endif /* CONFIG_MACSEC */
--- a/wpa_supplicant/config_ssid.h
+++ b/wpa_supplicant/config_ssid.h
-@@ -715,6 +715,8 @@ struct wpa_ssid {
+@@ -723,6 +723,8 @@ struct wpa_ssid {
unsigned char rates[WLAN_SUPP_RATES_MAX];
double mcast_rate;
/**
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
-@@ -2525,6 +2525,8 @@ static void wpas_start_assoc_cb(struct w
+@@ -2534,6 +2534,8 @@ static void wpas_start_assoc_cb(struct w
i++;
}
params.mcast_rate = ssid->mcast_rate;
--- a/hostapd/Makefile
+++ b/hostapd/Makefile
-@@ -157,6 +157,11 @@ OBJS += ../src/common/hw_features_common
+@@ -160,6 +160,11 @@ OBJS += ../src/common/hw_features_common
OBJS += ../src/eapol_auth/eapol_auth_sm.o
iapp_deinit(hapd->iapp);
hapd->iapp = NULL;
accounting_deinit(hapd);
-@@ -1139,6 +1140,8 @@ static int hostapd_setup_bss(struct host
+@@ -1140,6 +1141,8 @@ static int hostapd_setup_bss(struct host
if (hapd->driver && hapd->driver->set_operstate)
hapd->driver->set_operstate(hapd->drv_priv, 1);
return 0;
}
-@@ -1664,6 +1667,7 @@ static int hostapd_setup_interface_compl
+@@ -1665,6 +1668,7 @@ static int hostapd_setup_interface_compl
if (err)
goto fail;
wpa_printf(MSG_DEBUG, "Completing interface initialization");
if (iface->conf->channel) {
#ifdef NEED_AP_MLME
-@@ -1844,6 +1848,7 @@ dfs_offload:
+@@ -1845,6 +1849,7 @@ dfs_offload:
fail:
wpa_printf(MSG_ERROR, "Interface initialization failed");
hostapd_set_state(iface, HAPD_IFACE_DISABLED);
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED);
#ifdef CONFIG_FST
-@@ -2277,6 +2282,7 @@ void hostapd_interface_deinit_free(struc
+@@ -2279,6 +2284,7 @@ void hostapd_interface_deinit_free(struc
(unsigned int) iface->conf->num_bss);
driver = iface->bss[0]->driver;
drv_priv = iface->bss[0]->drv_priv;
if (res == HOSTAPD_ACL_PENDING) {
wpa_printf(MSG_DEBUG, "Authentication frame from " MACSTR
" waiting for an external authentication",
-@@ -2033,13 +2047,18 @@ static u16 send_assoc_resp(struct hostap
+@@ -2052,13 +2066,18 @@ static u16 send_assoc_resp(struct hostap
static void handle_assoc(struct hostapd_data *hapd,
const struct ieee80211_mgmt *mgmt, size_t len,
if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_req) :
sizeof(mgmt->u.assoc_req))) {
-@@ -2159,6 +2178,13 @@ static void handle_assoc(struct hostapd_
+@@ -2178,6 +2197,13 @@ static void handle_assoc(struct hostapd_
}
#endif /* CONFIG_MBO */
/*
* sta->capability is used in check_assoc_ies() for RRM enabled
* capability element.
-@@ -2639,7 +2665,7 @@ int ieee802_11_mgmt(struct hostapd_data
+@@ -2654,7 +2680,7 @@ int ieee802_11_mgmt(struct hostapd_data
if (stype == WLAN_FC_STYPE_PROBE_REQ) {
return 1;
}
-@@ -2657,17 +2683,17 @@ int ieee802_11_mgmt(struct hostapd_data
+@@ -2672,17 +2698,17 @@ int ieee802_11_mgmt(struct hostapd_data
switch (stype) {
case WLAN_FC_STYPE_AUTH:
wpa_printf(MSG_DEBUG, "mgmt::auth");
if (addr == NULL) {
/*
-@@ -124,6 +128,12 @@ int hostapd_notif_assoc(struct hostapd_d
+@@ -131,6 +135,12 @@ int hostapd_notif_assoc(struct hostapd_d
goto fail;
}