]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP MLD: Run authenticator state machine for all links
authorRameshkumar Sundaram <quic_ramess@quicinc.com>
Thu, 28 Mar 2024 18:16:47 +0000 (23:46 +0530)
committerJouni Malinen <j@w1.fi>
Sat, 20 Apr 2024 15:31:11 +0000 (18:31 +0300)
This is needed for MLO group rekeying.

Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Co-developed-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
Signed-off-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
src/ap/wpa_auth.c

index 9aeae89faad4db287221f8c388156ac8595bbb13..9b6e6430ab4a0e1eb676333eb0b2f5aae8437971 100644 (file)
@@ -5742,6 +5742,61 @@ static void wpa_group_sm_step(struct wpa_authenticator *wpa_auth,
 }
 
 
+static void wpa_clear_changed(struct wpa_state_machine *sm)
+{
+#ifdef CONFIG_IEEE80211BE
+       int link_id;
+#endif /* CONFIG_IEEE80211BE */
+
+       sm->changed = false;
+       sm->wpa_auth->group->changed = false;
+
+#ifdef CONFIG_IEEE80211BE
+       for_each_sm_auth(sm, link_id)
+               sm->mld_links[link_id].wpa_auth->group->changed = false;
+#endif /* CONFIG_IEEE80211BE */
+}
+
+
+static void wpa_group_sm_step_links(struct wpa_state_machine *sm)
+{
+#ifdef CONFIG_IEEE80211BE
+       int link_id;
+#endif /* CONFIG_IEEE80211BE */
+
+       if (!sm || !sm->wpa_auth)
+               return;
+       wpa_group_sm_step(sm->wpa_auth, sm->wpa_auth->group);
+
+#ifdef CONFIG_IEEE80211BE
+       for_each_sm_auth(sm, link_id) {
+               wpa_group_sm_step(sm->mld_links[link_id].wpa_auth,
+                                 sm->mld_links[link_id].wpa_auth->group);
+       }
+#endif /* CONFIG_IEEE80211BE */
+}
+
+
+static bool wpa_group_sm_changed(struct wpa_state_machine *sm)
+{
+#ifdef CONFIG_IEEE80211BE
+       int link_id;
+#endif /* CONFIG_IEEE80211BE */
+       bool changed;
+
+       if (!sm || !sm->wpa_auth)
+               return false;
+       changed = sm->wpa_auth->group->changed;
+
+#ifdef CONFIG_IEEE80211BE
+       for_each_sm_auth(sm, link_id)
+               changed |= sm->mld_links[link_id].wpa_auth->group->changed;
+#endif /* CONFIG_IEEE80211BE */
+
+       return changed;
+}
+
+
 static int wpa_sm_step(struct wpa_state_machine *sm)
 {
        if (!sm)
@@ -5760,8 +5815,7 @@ static int wpa_sm_step(struct wpa_state_machine *sm)
                if (sm->pending_deinit)
                        break;
 
-               sm->changed = false;
-               sm->wpa_auth->group->changed = false;
+               wpa_clear_changed(sm);
 
                SM_STEP_RUN(WPA_PTK);
                if (sm->pending_deinit)
@@ -5769,8 +5823,8 @@ static int wpa_sm_step(struct wpa_state_machine *sm)
                SM_STEP_RUN(WPA_PTK_GROUP);
                if (sm->pending_deinit)
                        break;
-               wpa_group_sm_step(sm->wpa_auth, sm->group);
-       } while (sm->changed || sm->wpa_auth->group->changed);
+               wpa_group_sm_step_links(sm);
+       } while (sm->changed || wpa_group_sm_changed(sm));
        sm->in_step_loop = 0;
 
        if (sm->pending_deinit) {