From 3a051a234a63e1c61510e170a0bf0c89fdf1518c Mon Sep 17 00:00:00 2001 From: Jesus Fernandez Manzano Date: Tue, 21 Sep 2021 12:49:30 +0200 Subject: [PATCH] hostapd: fix segfault when deinit mesh ifaces In hostapd_ubus_add_bss(), ubus objects are not registered for mesh interfaces. This provokes a segfault when accessing the ubus object in mesh deinit. This commit adds the same condition to hostapd_ubus_free_bss() for discarding those mesh interfaces. Signed-off-by: Jesus Fernandez Manzano (cherry picked from commit 5269c47e8db549695ceaf6a19afdd0cb90074622) --- package/network/services/hostapd/src/src/ap/ubus.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c index d03b848f94..0575fe2572 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.c +++ b/package/network/services/hostapd/src/src/ap/ubus.c @@ -1351,6 +1351,11 @@ void hostapd_ubus_free_bss(struct hostapd_data *hapd) struct ubus_object *obj = &hapd->ubus.obj; char *name = (char *) obj->name; +#ifdef CONFIG_MESH + if (hapd->conf->mesh & MESH_ENABLED) + return; +#endif + if (!ctx) return; -- 2.30.2