[6/7] nl80211: Handle port authorized event

Message ID 1517143537-7441-7-git-send-email-andrei.otcheretianski@intel.com
State Accepted
Headers show
Series
  • Add 4-way handshake offload support
Related show

Commit Message

Otcheretianski, Andrei Jan. 28, 2018, 12:45 p.m.
From: Avraham Stern <avraham.stern@intel.com>

Indicate that the connection is authorized when receiving a port
authorized event from the driver.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
---
 src/drivers/driver_nl80211_event.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

Patch

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);