[openwrt/openwrt] hostapd: fix segfault when deinit mesh ifaces

LEDE Commits lede-commits at lists.infradead.org
Fri Sep 24 03:33:03 PDT 2021


blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/5269c47e8db549695ceaf6a19afdd0cb90074622

commit 5269c47e8db549695ceaf6a19afdd0cb90074622
Author: Jesus Fernandez Manzano <jesus.manzano at galgus.net>
AuthorDate: Tue Sep 21 12:49:30 2021 +0200

    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 <jesus.manzano at galgus.net>
---
 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 09b25a29e5..367e1b652b 100644
--- a/package/network/services/hostapd/src/src/ap/ubus.c
+++ b/package/network/services/hostapd/src/src/ap/ubus.c
@@ -1498,6 +1498,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;
 



More information about the lede-commits mailing list