hostapd: fix no_reload logic
[openwrt/openwrt.git] / package / kernel / mac80211 / files / lib / netifd / wireless / mac80211.sh
index f59c4982159d5be5f11ce01b58cbad963399827f..7348db03544f6e361484332677147be85eaa873a 100644 (file)
@@ -954,8 +954,10 @@ drv_mac80211_setup() {
                        [ "${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
+                               if [ "$no_reload" != "0" ]; then
+                                       mac80211_vap_cleanup hostapd "${OLDAPLIST}"
+                                       [ -n "${NEWAPLIST}" ] && mac80211_iw_interface_add "$phy" "${NEWAPLIST%% *}" __ap || return
+                               fi
                        }
                fi
                if [ "$no_reload" != "0" ]; then