[PATCH 6/7] nl80211: Handle port authorized event
Andrei Otcheretianski
andrei.otcheretianski at intel.com
Sun Jan 28 04:45:36 PST 2018
From: Avraham Stern <avraham.stern at intel.com>
Indicate that the connection is authorized when receiving a port
authorized event from the driver.
Signed-off-by: Avraham Stern <avraham.stern at intel.com>
---
src/drivers/driver_nl80211_event.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
index 1b5be97..2a37979 100644
--- a/src/drivers/driver_nl80211_event.c
+++ b/src/drivers/driver_nl80211_event.c
@@ -2175,6 +2175,25 @@ static void nl80211_reg_change_event(struct wpa_driver_nl80211_data *drv,
}
+static void nl80211_port_authorized(struct wpa_driver_nl80211_data *drv,
+ struct nlattr **tb)
+{
+ if (!tb[NL80211_ATTR_MAC]) {
+ wpa_printf(MSG_DEBUG,
+ "nl80211: Ignore port authorized event without BSSID");
+ return;
+ }
+
+ if (os_memcmp(nla_data(tb[NL80211_ATTR_MAC]), drv->bssid, ETH_ALEN)) {
+ wpa_printf(MSG_DEBUG,
+ "nl80211: Ignore port authorized event not for the currently connected BSSID");
+ return;
+ }
+
+ wpa_supplicant_event(drv->ctx, EVENT_PORT_AUTHORIZED, NULL);
+}
+
+
static void do_process_drv_event(struct i802_bss *bss, int cmd,
struct nlattr **tb)
{
@@ -2373,6 +2392,9 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd,
case NL80211_CMD_NEW_PEER_CANDIDATE:
nl80211_new_peer_candidate(drv, tb);
break;
+ case NL80211_CMD_PORT_AUTHORIZED:
+ nl80211_port_authorized(drv, tb);
+ break;
default:
wpa_dbg(drv->ctx, MSG_DEBUG, "nl80211: Ignored unknown event "
"(cmd=%d)", cmd);
--
2.7.4
More information about the Hostap
mailing list