nl80211: Add support for MLD authentication

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@intel.com>
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
This commit is contained in:
Ilan Peer 2022-11-30 15:09:28 +02:00 committed by Jouni Malinen
parent e3e68668c1
commit a134b4dc5c
3 changed files with 46 additions and 0 deletions

View file

@ -720,6 +720,21 @@ struct wpa_driver_auth_params {
* auth_data_len - Length of auth_data buffer in octets
*/
size_t auth_data_len;
/**
* mld - Establish an MLD connection
*/
bool mld;
/**
* mld_link_id - The link ID of the MLD AP to which we are associating
*/
u8 mld_link_id;
/**
* The MLD AP address
*/
const u8 *ap_mld_addr;
};
/**

View file

@ -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 = false;
drv->auth_mld_link_id = -1;
os_memset(drv->auth_ap_mld_addr, 0, ETH_ALEN);
}
@ -3702,6 +3706,15 @@ static void nl80211_copy_auth_params(struct wpa_driver_nl80211_data *drv,
}
}
if (params->mld && params->ap_mld_addr) {
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);
} else {
drv->auth_mld = false;
drv->auth_mld_link_id = -1;
}
os_free(drv->auth_data);
drv->auth_data = NULL;
drv->auth_data_len = 0;
@ -3865,6 +3878,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) {
@ -3968,6 +3992,10 @@ 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;
if (drv->auth_mld)
params.ap_mld_addr = drv->auth_ap_mld_addr;
for (i = 0; i < 4; i++) {
if (drv->auth_wep_key_len[i]) {

View file

@ -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