Author: blogic Date: 2015-01-28 13:07:08 +0100 (Wed, 28 Jan 2015) New Revision: 44172
Modified: trunk/package/kernel/mac80211/files/lib/wifi/mac80211.sh Log: mac80211: fix fallback to macaddr If '/sys/class/ieee80211/phyN' is not a symlink, the call to readlink produces either an empty path (if /sys/class/ieee80211/phyN/device doesn't exist) or a path that begins with '/sys/class/ieee80211' (which does not work with the subsequent line to strip '/sys/devices' from the beginning of the path). Modify the checks to detect these conditions, and fallback to using the macaddr. Signed-off-by: Nathan Hintz <[email protected]> Modified: trunk/package/kernel/mac80211/files/lib/wifi/mac80211.sh =================================================================== --- trunk/package/kernel/mac80211/files/lib/wifi/mac80211.sh 2015-01-28 12:06:59 UTC (rev 44171) +++ trunk/package/kernel/mac80211/files/lib/wifi/mac80211.sh 2015-01-28 12:07:08 UTC (rev 44172) @@ -94,8 +94,12 @@ [ -n $htmode ] && append ht_capab " option htmode $htmode" "$N" - if [ -x /usr/bin/readlink ]; then + if [ -x /usr/bin/readlink -a -h /sys/class/ieee80211/${dev} ]; then path="$(readlink -f /sys/class/ieee80211/${dev}/device)" + else + path="" + fi + if [ -n "$path" ]; then path="${path##/sys/devices/}" dev_id=" option path '$path'" else _______________________________________________ openwrt-commits mailing list [email protected] https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits
