mac80211: add missing set_default to fix stray "radio0: sh: bad number" messages
[openwrt.git] / package / kernel / mac80211 / files / lib / netifd / wireless / mac80211.sh
index eefe1fe..12c256e 100644 (file)
@@ -28,7 +28,7 @@ drv_mac80211_init_device_config() {
 drv_mac80211_init_iface_config() {
        hostapd_common_add_bss_config
 
-       config_add_string macaddr
+       config_add_string macaddr ifname
 
        config_add_boolean wds powersave
        config_add_int maxassoc
@@ -85,6 +85,8 @@ mac80211_hostapd_setup_bss() {
        hostapd_set_bss_options hostapd_cfg "$vif" || return 1
        json_get_vars wds dtim_period max_listen_int
 
+       set_default wds 0
+
        [ "$wds" -gt 0 ] && append hostapd_cfg "wds_sta=1" "$N"
        [ "$staidx" -gt 0 ] && append hostapd_cfg "start_disabled=1" "$N"
 
@@ -271,8 +273,7 @@ mac80211_setup_adhoc() {
        mcval=
        [ -n "$mcast_rate" ] && hostapd_add_rate mcval "$mcast_rate"
 
-       iw dev "$ifname" ibss join "$ssid" $freq $htmode \
-               ${fixed:+fixed-freq} $bssid \
+       iw dev "$ifname" ibss join "$ssid" $freq $htmode fixed-freq $bssid \
                ${beacon_int:+beacon-interval $beacon_int} \
                ${brstr:+basic-rates $brstr} \
                ${mcval:+mcast-rate $mcval} \
@@ -309,7 +310,7 @@ mac80211_setup_vif() {
                ;;
                adhoc)
                        wireless_vif_parse_encryption
-                       if [ "$wpa" -gt 0 ]; then
+                       if [ "$wpa" -gt 0 -o "$auto_channel" -gt 0 ]; then
                                mac80211_setup_supplicant || failed=1
                        else
                                mac80211_setup_adhoc