[PATCH v2 04/15] nl80211: Add support for MLD authentication
Andrei Otcheretianski
andrei.otcheretianski at intel.com
Wed Nov 30 05:09:28 PST 2022
From: Ilan Peer <ilan.peer at intel.com>
Set MLO attributes for NL80211_CMD_AUTHENTICATE and make sure that MLD
configuration is preserved between authentication retries.
Signed-off-by: Johannes Berg <johannes.berg at intel.com>
Signed-off-by: Ilan Peer <ilan.peer at intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
src/drivers/driver_nl80211.c | 24 ++++++++++++++++++++++++
src/drivers/driver_nl80211.h | 3 +++
2 files changed, 27 insertions(+)
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index c3e6594f30..9408e8207d 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -278,6 +278,10 @@ void nl80211_mark_disconnected(struct wpa_driver_nl80211_data *drv)
os_free(drv->pending_roam_data);
drv->pending_roam_data = NULL;
#endif /* CONFIG_DRIVER_NL80211_QCA */
+
+ drv->auth_mld = 0;
+ drv->auth_mld_link_id = -1;
+ os_memset(drv->auth_ap_mld_addr, 0, ETH_ALEN);
}
@@ -3782,6 +3786,12 @@ static void nl80211_copy_auth_params(struct wpa_driver_nl80211_data *drv,
}
}
+ if (params->mld) {
+ drv->auth_mld = params->mld;
+ drv->auth_mld_link_id = params->mld_link_id;
+ os_memcpy(drv->auth_ap_mld_addr, params->ap_mld_addr, ETH_ALEN);
+ }
+
os_free(drv->auth_data);
drv->auth_data = NULL;
drv->auth_data_len = 0;
@@ -3945,6 +3955,17 @@ retry:
goto fail;
}
+ if (params->mld && params->ap_mld_addr) {
+ wpa_printf(MSG_DEBUG, " * MLD: link_id=%u, MLD addr=" MACSTR,
+ params->mld_link_id, MAC2STR(params->ap_mld_addr));
+
+ if (nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID,
+ params->mld_link_id) ||
+ nla_put(msg, NL80211_ATTR_MLD_ADDR, ETH_ALEN,
+ params->ap_mld_addr))
+ goto fail;
+ }
+
ret = send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL);
msg = NULL;
if (ret) {
@@ -4048,6 +4069,9 @@ int wpa_driver_nl80211_authenticate_retry(struct wpa_driver_nl80211_data *drv)
params.ie_len = drv->auth_ie_len;
params.auth_data = drv->auth_data;
params.auth_data_len = drv->auth_data_len;
+ params.mld = drv->auth_mld;
+ params.mld_link_id = drv->auth_mld_link_id;
+ params.ap_mld_addr = drv->auth_ap_mld_addr;
for (i = 0; i < 4; i++) {
if (drv->auth_wep_key_len[i]) {
diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h
index 0740e064ab..dadaab4517 100644
--- a/src/drivers/driver_nl80211.h
+++ b/src/drivers/driver_nl80211.h
@@ -225,6 +225,9 @@ struct wpa_driver_nl80211_data {
int auth_wep_tx_keyidx;
int auth_local_state_change;
int auth_p2p;
+ bool auth_mld;
+ u8 auth_mld_link_id;
+ u8 auth_ap_mld_addr[ETH_ALEN];
/*
* Tells whether the last scan issued from wpa_supplicant was a normal
--
2.25.1
More information about the Hostap
mailing list