mac80211: fix fallback to macaddr
authorblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 28 Jan 2015 12:07:08 +0000 (12:07 +0000)
committerblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 28 Jan 2015 12:07:08 +0000 (12:07 +0000)
commit39c251bdae7f757dbe9360494bbaa32144636f4d
treef8edf0524e982284f23a287aa61eee4f4663b921
parent204d837ad6d2b81b174c0fff6d3c97ac01e6a821
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 <nlhintz@hotmail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44172 3c298f89-4303-0410-b956-a3cf2f4a3e73
package/kernel/mac80211/files/lib/wifi/mac80211.sh