In case of an AP MLD it is assumed that the multi link information
(hapd->mld) is already initialized by the time this function is called.
However, if the interface is added without bss_config parameter,
hostapd_bss_setup_multi_link() would bail out immediately as mld_ap
parameter isn't set yet. When the interface gets enabled later,
hapd->mld would be NULL resulting in NULL dereference.
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
}
#ifdef CONFIG_IEEE80211BE
- if (conf->mld_ap)
+ if (conf->mld_ap) {
+ if (!hapd->mld)
+ hostapd_bss_setup_multi_link(hapd, iface->interfaces);
h_hapd = hostapd_mld_get_first_bss(hapd);
+ }
if (h_hapd) {
hapd->drv_priv = h_hapd->drv_priv;
#endif /* CONFIG_IEEE80211BE */
-static void hostapd_bss_setup_multi_link(struct hostapd_data *hapd,
- struct hapd_interfaces *interfaces)
+void hostapd_bss_setup_multi_link(struct hostapd_data *hapd,
+ struct hapd_interfaces *interfaces)
{
#ifdef CONFIG_IEEE80211BE
struct hostapd_mld *mld, **all_mld;
struct hostapd_iface *
hostapd_interface_init_bss(struct hapd_interfaces *interfaces, const char *phy,
const char *config_fname, int debug);
+void hostapd_bss_setup_multi_link(struct hostapd_data *hapd,
+ struct hapd_interfaces *interfaces);
void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
int reassoc);
void hostapd_interface_deinit_free(struct hostapd_iface *iface);