From 50a59b3a392aeb44c417ac3d7c2cdeea82ef2f15 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Wed, 18 Mar 2020 18:58:43 +0100 Subject: hostapd: fix segfault in wpa_supplicant ubus When introducing ubus reload support, ubus initialization was moved to the service level instead of being carried out when adding a BSS configuration. While this works when using wpa_supplicant in that way, it breaks the ability to run wpa_supplicant on the command line, eg. for debugging purposes. Fix that by re-introducing ubus context intialization when adding configuration. Reported-by: @PolynomialDivision https://github.com/openwrt/openwrt/pull/2417 Fixes: 60fb4c92b6 ("hostapd: add ubus reload") Signed-off-by: Daniel Golle --- package/network/services/hostapd/src/wpa_supplicant/ubus.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'package/network/services/hostapd/src') diff --git a/package/network/services/hostapd/src/wpa_supplicant/ubus.c b/package/network/services/hostapd/src/wpa_supplicant/ubus.c index 4a4e4697b9..5450b24476 100644 --- a/package/network/services/hostapd/src/wpa_supplicant/ubus.c +++ b/package/network/services/hostapd/src/wpa_supplicant/ubus.c @@ -181,6 +181,8 @@ void wpas_ubus_add_bss(struct wpa_supplicant *wpa_s) char *name; int ret; + if (!wpas_ubus_init()) + return; if (asprintf(&name, "wpa_supplicant.%s", wpa_s->ifname) < 0) return; -- cgit v1.2.3