From d8252a98121d6a1b636afa293f53aa6774ed06a4 Mon Sep 17 00:00:00 2001 From: Markus Theil Date: Fri, 3 Jan 2020 16:17:42 +0100 Subject: [PATCH] nl80211: Report control port RX events This allows EAPOL frames to be received over the separate controlled port once rest of the driver interface is ready for this. By itself, this commit does not actually change behavior since cfg80211 will not be delivering these events without them being explicitly requested. Signed-off-by: Markus Theil --- src/drivers/driver_nl80211_event.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c index 6c6e5c185..22585fdb0 100644 --- a/src/drivers/driver_nl80211_event.c +++ b/src/drivers/driver_nl80211_event.c @@ -2448,6 +2448,18 @@ static void nl80211_sta_opmode_change_event(struct wpa_driver_nl80211_data *drv, } +static void nl80211_control_port_frame(struct wpa_driver_nl80211_data *drv, + struct nlattr **tb) +{ + if (!tb[NL80211_ATTR_MAC] || !tb[NL80211_ATTR_FRAME]) + return; + + drv_event_eapol_rx(drv->ctx, nla_data(tb[NL80211_ATTR_MAC]), + nla_data(tb[NL80211_ATTR_FRAME]), + nla_len(tb[NL80211_ATTR_FRAME])); +} + + static void do_process_drv_event(struct i802_bss *bss, int cmd, struct nlattr **tb) { @@ -2663,6 +2675,9 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd, case NL80211_CMD_UPDATE_OWE_INFO: mlme_event_dh_event(drv, bss, tb); break; + case NL80211_CMD_CONTROL_PORT_FRAME: + nl80211_control_port_frame(drv, tb); + break; default: wpa_dbg(drv->ctx, MSG_DEBUG, "nl80211: Ignored unknown event " "(cmd=%d)", cmd);