immortalwrt/package/kernel
Bob Cantor 5f9a9e1906 mac80211: fix no_reload logic (FS#3902)
If drv_mac80211_setup is called twice with the same wifi configuration,
then the second call returns early with error HOSTAPD_START_FAILED.
(wifi works nevertheless, despite the fact that setup is incomplete.  But
"ubus call network.wireless status" erroneously reports that radio0 is down.)

The relevant part of drv_mac80211_setup is,

if [ "$no_reload" != "0" ]; then
        add_ap=1
        ubus wait_for hostapd
        local hostapd_res="$(ubus call hostapd config_add "{\"iface\":\"$primary_ap\", \"config\":\"${hostapd_conf_file}\"}")"
        ret="$?"
        [ "$ret" != 0 -o -z "$hostapd_res" ] && {
                wireless_setup_failed HOSTAPD_START_FAILED
                return
        }
        wireless_add_process "$(jsonfilter -s "$hostapd_res" -l 1 -e @.pid)" "/usr/sbin/hostapd" 1 1
fi

This commit sets no_reload = 0 during the second call of drv_mac80211_setup.

It is perhaps worth providing a way to reproduce the situation
where drv_mac80211_setup is called twice.

When /sbin/wifi is used to turn on wifi,
   uci set wireless.@wifi-iface[0].disabled=0
   uci set wireless.@wifi-device[0].disabled=0
   uci commit
   wifi

/sbin/wifi makes the following ubus calls,
   ubus call network reload
   ubus call network.wireless down
   ubus call network.wireless up

The first and third ubus calls both call drv_mac80211_setup,
while the second ubus call triggers wireless_device_setup_cancel.
So the call sequence becomes,

   drv_mac80211_setup
   wireless_device_setup_cancel
   drv_mac80211_setup

In contrast, when LuCI is used to turn on wifi only a single call
is made to drv_mac80211_setup.

branches affected: trunk, 21.02

Signed-off-by: Bob Cantor <coxede6557@w3boats.com>
2021-06-29 23:51:39 +08:00
..
acx-mac80211 Merge Mainline 2021-02-10 12:28:03 +08:00
ar7-atm
ath10k-ct Merge Mainline 2021-06-26 16:49:16 +08:00
avila-wdt
bcm27xx-gpu-fw bcm27xx-gpu-fw: update to latest version 2021-05-05 01:18:01 +08:00
bcm63xx-cfe bcm63xx-cfe: update to the latest master 2021-06-23 23:10:44 +08:00
broadcom-wl Merge Mainline 2021-02-10 12:28:03 +08:00
button-hotplug
cryptodev-linux cryptodev-linux: bump to 1.12 2021-02-18 00:47:18 +08:00
dtc/patches
exfat Merge Mainline 2021-06-15 23:45:52 +08:00
fast-classifier package lean: move to LuCI feeds 2021-05-14 23:12:28 +08:00
fullconenat Merge Mainline 2021-05-15 02:09:05 +08:00
gpio-button-hotplug
gpio-nct5104d
gpio-nxp-74hc153 packages: kernel: add gpio-nxp-74hc153 2021-03-23 11:26:20 +08:00
hwmon-gsc
lantiq lantiq: kernel 5.10: disable ltq-deu 2021-04-13 23:29:10 +08:00
linux Merge Mainline 2021-06-26 16:49:16 +08:00
mac80211 mac80211: fix no_reload logic (FS#3902) 2021-06-29 23:51:39 +08:00
mt76 Merge Mainline 2021-06-15 23:45:52 +08:00
mt7601u-ap treewide: move kernel pacakges from ctcgfw to kernel 2021-03-23 17:46:58 +08:00
mt-drivers mtwifi: mt7612: fix build error 2021-06-15 23:16:38 +08:00
mtk-eip93 Merge Mainline 2021-03-23 18:11:53 +08:00
mwlwifi Merge Mainline 2021-03-26 20:28:03 +08:00
nat46 nat46: fix memory leak 2021-05-24 23:35:58 +08:00
om-watchdog
r8125 r8125: allow build against with kernel 5.10 2021-06-16 17:36:51 +08:00
r8152 r8152: allow build against kernel 5.10 2021-06-12 01:35:41 +08:00
r8168 r8168: add LED configuration from OF 2021-04-29 00:05:09 +08:00
rtc-rv5c386a
rtl88x2bu Merge Mainline 2021-03-23 18:11:53 +08:00
rtl8188eu Merge Mainline 2021-03-23 18:11:53 +08:00
rtl8189es rtl8189es: update to latest git HEAD 2021-04-28 23:50:30 +08:00
rtl8192du Merge Mainline 2021-03-30 03:37:03 +08:00
rtl8812au-ac Merge Mainline 2021-06-21 20:49:40 +08:00
rtl8821cu Merge Mainline 2021-03-23 18:11:53 +08:00
shortcut-fe package lean: move to LuCI feeds 2021-05-14 23:12:28 +08:00
trelay