mac80211: fix typo in ifname setup, suppress error messages of interface enumeration...
authorFelix Fietkau <nbd@openwrt.org>
Fri, 2 Oct 2009 19:16:16 +0000 (19:16 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Fri, 2 Oct 2009 19:16:16 +0000 (19:16 +0000)
SVN-Revision: 17824

package/mac80211/files/lib/wifi/mac80211.sh

index 703131cc4f684639103e5ab28a244d8f70047cdf..3acb3dc1ccfbd457ea0573b6becb87c8ac0c2f19 100644 (file)
@@ -7,7 +7,7 @@ find_mac80211_phy() {
        local macaddr="$(config_get "$device" macaddr | tr 'A-Z' 'a-z')"
        config_get phy "$device" phy
        [ -z "$phy" -a -n "$macaddr" ] && {
-               for phy in $(ls /sys/class/ieee80211); do
+               for phy in $(ls /sys/class/ieee80211 2>/dev/null); do
                        [ "$macaddr" = "$(cat /sys/class/ieee80211/${phy}/macaddress)" ] || continue
                        config_set "$device" phy "$phy"
                        break
@@ -58,7 +58,7 @@ disable_mac80211() (
        done
 
        include /lib/network
-       for wdev in $(ls /sys/class/ieee80211/${phy}/device/net); do
+       for wdev in $(ls /sys/class/ieee80211/${phy}/device/net 2>/dev/null); do
                ifconfig "$wdev" down 2>/dev/null
                unbridge "$dev"
                iw dev "$wdev" del
@@ -86,7 +86,7 @@ enable_mac80211() {
                [ -n "$ifname" ] || {
                        ifname="wlan$i"
                }
-               config_set ifname "$vif" ifname
+               config_set "$vif" ifname "$ifname"
 
                config_get enc "$vif" encryption
                config_get mode "$vif" mode