From: Ajith C Date: Tue, 3 Sep 2024 05:09:05 +0000 (+0530) Subject: AP MLD: Fix crash during config reload from non-ML to ML X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=93f623f7454a687f7192a267fc114724bf77ca35;p=thirdparty%2Fhostap.git AP MLD: Fix crash during config reload from non-ML to ML 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 --- diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index dc50ad1bc..b3eb60499 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -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;