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>
This commit is contained in:
parent
213250b56b
commit
50a59b3a39
2 changed files with 3 additions and 1 deletions
|
@ -7,7 +7,7 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=hostapd
|
PKG_NAME:=hostapd
|
||||||
PKG_RELEASE:=7
|
PKG_RELEASE:=8
|
||||||
|
|
||||||
PKG_SOURCE_URL:=http://w1.fi/hostap.git
|
PKG_SOURCE_URL:=http://w1.fi/hostap.git
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
|
|
|
@ -181,6 +181,8 @@ void wpas_ubus_add_bss(struct wpa_supplicant *wpa_s)
|
||||||
char *name;
|
char *name;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
if (!wpas_ubus_init())
|
||||||
|
return;
|
||||||
|
|
||||||
if (asprintf(&name, "wpa_supplicant.%s", wpa_s->ifname) < 0)
|
if (asprintf(&name, "wpa_supplicant.%s", wpa_s->ifname) < 0)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue