mac80211: fix detecting existing interface
authorDaniel Golle <daniel@makrotopia.org>
Fri, 17 Apr 2020 10:33:40 +0000 (11:33 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Fri, 17 Apr 2020 10:36:35 +0000 (11:36 +0100)
Instead of using the actual interface name, a hard-coded 'wlan0' has
slipped into the script. Replace it.

Fixes: ccf2aa9d4b ("mac80211: detect existing interface before adding")
Reported-by: John Crispin <john@phrozen.org>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh

index f9a60792dcfda47bb9e84305a2d83b2ae1486884..501b1ad0de961aea45f4ec61d6b6c610f9309966 100644 (file)
@@ -455,7 +455,7 @@ mac80211_iw_interface_add() {
        [ "$rc" = 233 ] && {
                # Keep matching pre-existing interface
                [ -d "/sys/class/ieee80211/${phy}/device/net/${ifname}" ] && \
-               case "$(iw dev wlan0 info | grep "^\ttype" | cut -d' ' -f2- 2>/dev/null)" in
+               case "$(iw dev $ifname info | grep "^\ttype" | cut -d' ' -f2- 2>/dev/null)" in
                        "AP")
                                [ "$type" = "__ap" ] && rc=0
                                ;;