diff options
author | John Crispin <john@phrozen.org> | 2020-02-25 17:03:44 +0100 |
---|---|---|
committer | John Crispin <john@phrozen.org> | 2020-02-25 17:03:44 +0100 |
commit | a1dd7732729a7b54890095187cd1766a773051d1 (patch) | |
tree | dabc9417ee577d0718d2efde820570b934b60251 /package | |
parent | d3b7838ebed98ae5cf064a3890b0fd3f16b9a664 (diff) | |
download | upstream-a1dd7732729a7b54890095187cd1766a773051d1.tar.gz upstream-a1dd7732729a7b54890095187cd1766a773051d1.tar.bz2 upstream-a1dd7732729a7b54890095187cd1766a773051d1.zip |
mac80211: enhance wifi reload
If the reconf call fails force a full restart of the radio.
Signed-off-by: John Crispin <john@phrozen.org>
Diffstat (limited to 'package')
-rw-r--r-- | package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index ac9984ef22..f22730c9fc 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -329,6 +329,8 @@ $base_cfg EOF json_select .. + radio_md5sum=$(md5sum $hostapd_conf_file | cut -d" " -f1) + echo "radio_config_id=${radio_md5sum}" >> $hostapd_conf_file } mac80211_hostapd_setup_bss() { @@ -943,11 +945,16 @@ drv_mac80211_setup() { local add_ap=0 local primary_ap=${NEWAPLIST%% *} [ -n "$hostapd_ctrl" ] && { + local no_reload=1 if [ -n "$(ubus list | grep hostapd.$primary_ap)" ]; then [ "${NEW_MD5}" = "${OLD_MD5}" ] || { ubus call hostapd.$primary_ap reload + no_reload=$? + mac80211_vap_cleanup hostapd "${OLDAPLIST}" + [ -n "${NEWAPLIST}" ] && mac80211_iw_interface_add "$phy" "${NEWAPLIST%% *}" __ap || return } - else + fi + if [ "$no_reload" != "0" ]; then add_ap=1 ubus wait_for hostapd.$phy ubus call hostapd.${phy} config_add "{\"iface\":\"$primary_ap\", \"config\":\"${hostapd_conf_file}\"}" |