hostapd: fix frequency setting for IBSS/RSN
authorJohn Crispin <john@openwrt.org>
Sun, 12 Jan 2014 12:07:11 +0000 (12:07 +0000)
committerJohn Crispin <john@openwrt.org>
Sun, 12 Jan 2014 12:07:11 +0000 (12:07 +0000)
Introduced by ("netifd: add wireless configuration support and port mac80211 to
the new framework")

Reported-by: René van Weert <rene@sowifi.com>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
SVN-Revision: 39231

package/network/services/hostapd/files/netifd.sh

index dd2256578dccdf7502e508801b2aea06ac07f23e..b2c437d8243f9c8404e6885380687ed328ba2a47 100644 (file)
@@ -447,12 +447,14 @@ wpa_supplicant_add_network() {
 
        local wpa_key_mgmt="WPA-PSK"
        local scan_ssid="1"
+       local freq
 
        [[ "$_w_mode" = "adhoc" ]] && {
                append network_data "mode=1" "$N$T"
-               [ -n "$fixed_frequency" ] || {
+               [ -n "$channel" ] && {
+                       freq="$(get_freq "$phy" "$channel")"
                        append network_data "fixed_freq=1" "$N$T"
-                       append network_data "frequency=$fixed_frequency" "$N$T"
+                       append network_data "frequency=$freq" "$N$T"
                }
 
                scan_ssid=0