]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_supplicant: Make valid_links u16
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>
Wed, 30 Nov 2022 13:09:30 +0000 (15:09 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 3 Dec 2022 15:20:13 +0000 (17:20 +0200)
MAX_NUM_MLD_LINKS is 15, thus u8 isn't enough for the bitmap. Fix it.
While at it, clean MLO information better.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
wpa_supplicant/events.c
wpa_supplicant/wpa_supplicant_i.h

index 769663c5d3bed212bd8db21cf730cee38dc2990e..dddf35315c1c3060030e908a562be20cfcd9151c 100644 (file)
@@ -310,14 +310,13 @@ void wpa_supplicant_stop_countermeasures(void *eloop_ctx, void *sock_ctx)
 
 static void wpas_reset_mlo_info(struct wpa_supplicant *wpa_s)
 {
-       int i;
-
        if (!wpa_s->valid_links)
                return;
 
        wpa_s->valid_links = 0;
-       for (i = 0; i < MAX_NUM_MLD_LINKS; i++)
-               wpa_s->links[i].bss = NULL;
+       wpa_s->mlo_assoc_link_id = 0;
+       os_memset(wpa_s->ap_mld_addr, 0, ETH_ALEN);
+       os_memset(wpa_s->links, 0, sizeof(wpa_s->links));
 }
 
 
index f5c44115c5e0b10e4746d7f7469b63ed2d3ec3c6..aaa84f6037f367e33a1f2c18fb0c5a754ac047a5 100644 (file)
@@ -687,8 +687,8 @@ struct wpa_supplicant {
        unsigned int assoc_freq;
        u8 ap_mld_addr[ETH_ALEN];
        u8 mlo_assoc_link_id;
-       u8 valid_links; /* bitmap of valid MLO link IDs */
-       struct {
+       u16 valid_links; /* bitmap of valid MLO link IDs */
+       struct ml_sta_link_info {
                u8 addr[ETH_ALEN];
                u8 bssid[ETH_ALEN];
                unsigned int freq;