aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2020-03-18 18:58:43 +0100
committerDaniel Golle <daniel@makrotopia.org>2020-03-18 19:05:22 +0100
commit50a59b3a392aeb44c417ac3d7c2cdeea82ef2f15 (patch)
treea998cc5b2aff3151b22f0d89d36617de4fd1bd2d
parent213250b56bb4a3043dcb5a48e2f849b9e45967d7 (diff)
downloadupstream-50a59b3a392aeb44c417ac3d7c2cdeea82ef2f15.tar.gz
upstream-50a59b3a392aeb44c417ac3d7c2cdeea82ef2f15.tar.bz2
upstream-50a59b3a392aeb44c417ac3d7c2cdeea82ef2f15.zip
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 <daniel@makrotopia.org>
-rw-r--r--package/network/services/hostapd/Makefile2
-rw-r--r--package/network/services/hostapd/src/wpa_supplicant/ubus.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile
index 1deab44058..f6e089ddb3 100644
--- a/package/network/services/hostapd/Makefile
+++ b/package/network/services/hostapd/Makefile
@@ -7,7 +7,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=hostapd
-PKG_RELEASE:=7
+PKG_RELEASE:=8
PKG_SOURCE_URL:=http://w1.fi/hostap.git
PKG_SOURCE_PROTO:=git
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;