iwinfo: continue scanning even if temporary mac cannot be changed
authorJo-Philipp Wich <jow@openwrt.org>
Fri, 25 Jul 2014 14:11:50 +0000 (14:11 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Fri, 25 Jul 2014 14:11:50 +0000 (14:11 +0000)
So far iwinfo aborted a wifi scan attempt if the mac of the spawned
interface could not be changed. Change the code to try anyway - this
should fix wifi scanning on RaLink devices.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
SVN-Revision: 41826

package/network/utils/iwinfo/Makefile
package/network/utils/iwinfo/src/iwinfo_nl80211.c
package/network/utils/iwinfo/src/iwinfo_utils.c

index 9efb9c974c39d9d9dce5083d05411b96d8094e21..e4ee73a1124690c80e82f38a2ef4941acbb0eca8 100644 (file)
@@ -7,7 +7,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libiwinfo
-PKG_RELEASE:=49
+PKG_RELEASE:=50
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 PKG_CONFIG_DEPENDS := \
index 4a52d5ca8dfa72ae15e777d874df44046cb73934..c8b167b32ab0b57c05020cc616cca3588d93564d 100644 (file)
@@ -2003,8 +2003,7 @@ static int nl80211_get_scanlist(const char *ifname, char *buf, int *len)
                        if (!(res = nl80211_ifadd(ifname)))
                                goto out;
 
-                       if (!iwinfo_ifmac(res))
-                               goto out;
+                       iwinfo_ifmac(res);
 
                        /* if we can take the new interface up, the driver supports an
                         * additional interface and there's no need to tear down the ap */
index dd49303f8aa38ae738cf3cc3a9fd8dd8a3863b49..1702ce88f6d18fdfdb3a447f70a14f002d03cb7d 100644 (file)
@@ -113,6 +113,7 @@ int iwinfo_ifmac(const char *ifname)
        if (iwinfo_ioctl(SIOCGIFHWADDR, &ifr))
                return 0;
 
+       ifr.ifr_hwaddr.sa_data[0] |= 0x02;
        ifr.ifr_hwaddr.sa_data[1]++;
        ifr.ifr_hwaddr.sa_data[2]++;