hostapd: fix segfault when deinit mesh ifaces
authorJesus Fernandez Manzano <jesus.manzano@galgus.net>
Tue, 21 Sep 2021 10:49:30 +0000 (12:49 +0200)
committerDavid Bauer <mail@david-bauer.net>
Fri, 24 Sep 2021 10:32:19 +0000 (12:32 +0200)
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@galgus.net>
package/network/services/hostapd/src/src/ap/ubus.c

index 09b25a29e52be2137a30ca80af063ae697b175b6..367e1b652b138d090d904f3e22b73c47885df0c6 100644 (file)
@@ -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;