]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP MLD: Assign link ID during BSS creation
authorAditya Kumar Singh <quic_adisi@quicinc.com>
Wed, 6 Mar 2024 06:37:52 +0000 (12:07 +0530)
committerJouni Malinen <j@w1.fi>
Wed, 27 Mar 2024 09:15:33 +0000 (11:15 +0200)
Link ID was assigned when BSS is going through setup and the driver
interface init. Later if interface is disabled and enabled again, setup
BSS is called which will give a new link ID to it. However, Link ID
should be same for a BSS affliated to an AP MLD for the full lifetime of
the BSS.

Hence, assign the link ID during BSS creation itself. And it will remain
until BSS entry is completely freed. Hence, link ID will not change as
part of disable/enable.

Also, since link ID would be decided now, it will help in creating link
level control sockets in a subsequent patch.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
hostapd/main.c
src/ap/hostapd.c

index a0619c76c28f7746b989e34eb68ba4b3ac210e14..1191857269f15d9d88374b3f31eea1afb88c8571 100644 (file)
@@ -212,7 +212,6 @@ static int hostapd_driver_init(struct hostapd_iface *iface)
                        os_memcpy(hapd->own_addr, b, ETH_ALEN);
                }
 
-               hapd->mld_link_id = hapd->mld->next_link_id++;
                hostapd_mld_add_link(hapd);
 
                goto setup_mld;
@@ -297,7 +296,6 @@ static int hostapd_driver_init(struct hostapd_iface *iface)
                else
                        os_memcpy(hapd->own_addr, b, ETH_ALEN);
 
-               hapd->mld_link_id = hapd->mld->next_link_id++;
                hostapd_mld_add_link(hapd);
        }
 
index cd78d1887be4ce73315961a818113cf86f0da697..07bf91e706ccd61fb4495693a48bc03841bcdc06 100644 (file)
@@ -2915,6 +2915,16 @@ struct hostapd_iface * hostapd_alloc_iface(void)
 }
 
 
+#ifdef CONFIG_IEEE80211BE
+static void hostapd_bss_alloc_link_id(struct hostapd_data *hapd)
+{
+       hapd->mld_link_id = hapd->mld->next_link_id++;
+       wpa_printf(MSG_DEBUG, "AP MLD: %s: Link ID %d assigned.",
+                  hapd->mld->name, hapd->mld_link_id);
+}
+#endif /* CONFIG_IEEE80211BE */
+
+
 static void hostapd_bss_setup_multi_link(struct hostapd_data *hapd,
                                         struct hapd_interfaces *interfaces)
 {
@@ -2936,6 +2946,7 @@ static void hostapd_bss_setup_multi_link(struct hostapd_data *hapd,
                        continue;
 
                hapd->mld = mld;
+               hostapd_bss_alloc_link_id(hapd);
                break;
        }
 
@@ -2952,6 +2963,7 @@ static void hostapd_bss_setup_multi_link(struct hostapd_data *hapd,
        wpa_printf(MSG_DEBUG, "AP MLD %s created", mld->name);
 
        hapd->mld = mld;
+       hostapd_bss_alloc_link_id(hapd);
 
        all_mld = os_realloc_array(interfaces->mld, interfaces->mld_count + 1,
                                   sizeof(struct hostapd_mld *));