]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP MLD: Do not try to set hapd->mld multiple times
authorJouni Malinen <j@w1.fi>
Sun, 22 Dec 2024 08:49:27 +0000 (10:49 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 22 Dec 2024 08:49:27 +0000 (10:49 +0200)
Now that there is more than one path that could end up calling
hostapd_bss_setup_multi_link(), it looks like it was possible to end up
allocating the MLD context twice and that resulted in resource leaks.
Avoid this by explicitly checking that hapd->mld is not set before
trying to determine whether to set it to an existing context or create a
new one.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/hostapd.c

index 8e350f0871bdeba85275ba2ddf804fa9c2dd7ab8..58f93e28b0428227f48d37ca613767ed021b4211 100644 (file)
@@ -3108,6 +3108,9 @@ void hostapd_bss_setup_multi_link(struct hostapd_data *hapd,
        struct hostapd_bss_config *conf;
        size_t i;
 
+       if (hapd->mld)
+               return;
+
        conf = hapd->conf;
 
        if (!hapd->iconf || !hapd->iconf->ieee80211be || !conf->mld_ap ||