diff options
Diffstat (limited to 'package/network/services/hostapd/files/hostapd.sh')
-rw-r--r-- | package/network/services/hostapd/files/hostapd.sh | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 3c1504ca60..f03b98ff85 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -254,7 +254,7 @@ hostapd_set_bss_options() { wireless_vif_parse_encryption - local bss_conf + local bss_conf bss_md5sum local wep_rekey wpa_group_rekey wpa_pair_rekey wpa_master_rekey wpa_key_mgmt json_get_vars \ @@ -627,6 +627,9 @@ hostapd_set_bss_options() { } } + bss_md5sum=$(echo $bss_conf | md5sum | cut -d" " -f1) + append bss_conf "config_id=$bss_md5sum" "$N" + append "$var" "$bss_conf" "$N" return 0 } @@ -950,21 +953,19 @@ EOF } wpa_supplicant_run() { - local ifname="$1"; shift + local ifname="$1" + local hostapd_ctrl="$2" _wpa_supplicant_common "$ifname" - /usr/sbin/wpa_supplicant -B -s \ - ${network_bridge:+-b $network_bridge} \ - -P "/var/run/wpa_supplicant-${ifname}.pid" \ - -D ${_w_driver:-wext} \ - -i "$ifname" \ - -c "$_config" \ - -C "$_rpath" \ - "$@" + ubus call wpa_supplicant.$phy config_add "{ \ + \"driver\": \"${_w_driver:-wext}\", \"ctrl\": \"$_rpath\", \ + \"iface\": \"$ifname\", \"config\": \"$_config\" \ + ${network_bridge:+, \"bridge\": \"$network_bridge\"} \ + ${hostapd_ctrl:+, \"hostapd_ctrl\": \"$hostapd_ctrl\"} \ + }" ret="$?" - wireless_add_process "$(cat "/var/run/wpa_supplicant-${ifname}.pid")" /usr/sbin/wpa_supplicant 1 [ "$ret" != 0 ] && wireless_setup_vif_failed WPA_SUPPLICANT_FAILED @@ -972,5 +973,5 @@ wpa_supplicant_run() { } hostapd_common_cleanup() { - killall hostapd wpa_supplicant meshd-nl80211 + killall meshd-nl80211 } |