[OpenWrt-Devel] [PATCH v2] mac80211: remove error from detect script

Felix Fietkau nbd at openwrt.org
Wed Oct 8 13:06:44 EDT 2014


On 2014-10-08 15:54, Michel Stam wrote:
> Signed-off-by: Michel Stam <m.stam at fugro.nl>
> ---
>  package/kernel/mac80211/files/lib/wifi/mac80211.sh | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
> index a3b2199..a1ed6f6 100644
> --- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh
> +++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
> @@ -19,9 +19,11 @@ lookup_phy() {
>  
>  	local macaddr="$(config_get "$device" macaddr | tr 'A-Z' 'a-z')"
>  	[ -n "$macaddr" ] && {
> -		for _phy in $(ls /sys/class/ieee80211 2>/dev/null); do
> -			[ "$macaddr" = "$(cat /sys/class/ieee80211/${_phy}/macaddress)" ] || continue
> -			phy="$_phy"
> +		for _phy in /sys/class/ieee80211/*; do
> +			[ -e "$_phy" ] || continue
> +
> +			phy="${_phy##*/}"
> +			[ "$macaddr" = "$(cat /sys/class/ieee80211/${phy}/macaddress)" ] || continue
This ends up setting $phy, even if the mac address does not match.

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list