[PATCH v2 38/44] AP: Specify the link ID for set_key() callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ilan Peer <ilan.peer@xxxxxxxxx>

If the AP is part of a MLD AP specify the link ID in the
set key parameters.

Signed-off-by: Ilan Peer <ilan.peer@xxxxxxxxx>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@xxxxxxxxx>
---
 src/ap/ap_drv_ops.c |  5 +++++
 src/ap/wpa_auth.c   | 24 ++++++------------------
 2 files changed, 11 insertions(+), 18 deletions(-)

diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
index cf4ff3ddd8..399ca7abc6 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
@@ -758,6 +758,11 @@ int hostapd_drv_set_key(const char *ifname, struct hostapd_data *hapd,
 	params.key_flag = key_flag;
 	params.link_id = -1;
 
+#ifdef CONFIG_IEEE80211BE
+	if (hapd->conf->mld_ap && !(key_flag & KEY_FLAG_PAIRWISE))
+		params.link_id = hapd->mld_link_id;
+#endif /* CONFIG_IEEE80211BE */
+
 	return hapd->driver->set_key(hapd->drv_priv, &params);
 }
 
diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
index 2ad5cf8a72..0003be1e4c 100644
--- a/src/ap/wpa_auth.c
+++ b/src/ap/wpa_auth.c
@@ -36,20 +36,6 @@
 #include "sta_info.h"
 
 
-static const u8 *wpa_auth_get_aa(struct wpa_state_machine *sm)
-{
-	return (sm && sm->mld_assoc_link_id >= 0) ?
-		sm->own_mld_addr : sm->wpa_auth->addr;
-}
-
-
-static const u8 *wpa_auth_get_spa(struct wpa_state_machine *sm)
-{
-	return sm->mld_assoc_link_id >= 0 ?
-		sm->peer_mld_addr : sm->addr;
-}
-
-
 #define STATE_MACHINE_DATA struct wpa_state_machine
 #define STATE_MACHINE_DEBUG_PREFIX "WPA"
 #define STATE_MACHINE_ADDR wpa_auth_get_spa(sm)
@@ -98,15 +84,17 @@ static const int dot11RSNAConfigPMKReauthThreshold = 70;
 static const int dot11RSNAConfigSATimeout = 60;
 
 
-static const u8 * wpa_auth_get_aa(const struct wpa_state_machine *sm)
+static const u8 * wpa_auth_get_aa(struct wpa_state_machine *sm)
 {
-	return sm->wpa_auth->addr;
+	return (sm && sm->mld_assoc_link_id >= 0) ?
+		sm->own_mld_addr : sm->wpa_auth->addr;
 }
 
 
-static const u8 * wpa_auth_get_spa(const struct wpa_state_machine *sm)
+static const u8 * wpa_auth_get_spa(struct wpa_state_machine *sm)
 {
-	return sm->addr;
+	return sm->mld_assoc_link_id >= 0 ?
+		sm->peer_mld_addr : sm->addr;
 }
 
 
-- 
2.38.1


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux