]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP MLD: Fix crash during config reload from non-ML to ML
authorAjith C <quic_ajithc@quicinc.com>
Tue, 3 Sep 2024 05:09:05 +0000 (10:39 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 29 Nov 2024 20:24:41 +0000 (22:24 +0200)
When an AP switches from a non-ML to an ML configuration, hostapd
crashes. The crash occurs because the memory allocation for the 'mld'
structure happens only during the AP’s startup if the 'mld_ap' option is
enabled. Consequently, when hostapd transitions from a non-ML to an ML
configuration, the MLD structure’s memory remains unallocated, leading
to a crash when accessed.

Fix this by initiating hostapd_init() whenever the AP transitions
between ML and non-ML configurations to ensure proper memory allocation
for the MLD structure.

Signed-off-by: Ajith C <quic_ajithc@quicinc.com>
src/ap/hostapd.c

index dc50ad1bcc9a66a50c5eddc86cba62ba756adc3f..b3eb6049918627bf44fd186a18361741cbfe065e 100644 (file)
@@ -242,6 +242,10 @@ static int hostapd_iface_conf_changed(struct hostapd_config *newconf,
                if (os_strcmp(newconf->bss[i]->iface,
                              oldconf->bss[i]->iface) != 0)
                        return 1;
+#ifdef CONFIG_IEEE80211BE
+               if (newconf->bss[i]->mld_ap != oldconf->bss[i]->mld_ap)
+                       return 1;
+#endif /* CONFIG_IEEE80211BE */
        }
 
        return 0;