aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesus Fernandez Manzano <jesus.manzano@galgus.net>2021-09-21 12:49:30 +0200
committerDavid Bauer <mail@david-bauer.net>2021-09-24 12:32:19 +0200
commit5269c47e8db549695ceaf6a19afdd0cb90074622 (patch)
tree64169138a2002b5c6e596ef565bcf4490bd3bc8e
parentb56f7407d999d29c200c8c5880655926ef9874b7 (diff)
downloadupstream-5269c47e8db549695ceaf6a19afdd0cb90074622.tar.gz
upstream-5269c47e8db549695ceaf6a19afdd0cb90074622.tar.bz2
upstream-5269c47e8db549695ceaf6a19afdd0cb90074622.zip
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@galgus.net>
-rw-r--r--package/network/services/hostapd/src/src/ap/ubus.c5
1 files changed, 5 insertions, 0 deletions
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;