[backfire] iwinfo: backport r29992
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 2 Feb 2012 14:06:59 +0000 (14:06 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 2 Feb 2012 14:06:59 +0000 (14:06 +0000)
SVN-Revision: 29993

package/iwinfo/Makefile
package/iwinfo/src/iwinfo_nl80211.c

index a946ef1eff67eb1ef993f9d77fdafb3e0120d528..51fbb828ccb8c5a71a1dbc86557854c30dcdc777 100644 (file)
@@ -7,7 +7,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libiwinfo
-PKG_RELEASE:=18.1
+PKG_RELEASE:=18.2
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
index 96f9e791169a6ba763871fd889b7b01e2c4fb924..66429a210d0c727a9485b590caccf5e7b76a0fa7 100644 (file)
@@ -387,10 +387,13 @@ static char * nl80211_wpactl_info(const char *ifname, const char *cmd,
                goto out;
 
 
-       send(sock, "ATTACH", 6, 0);
+       if (event)
+       {
+               send(sock, "ATTACH", 6, 0);
 
-       if (nl80211_wpactl_recv(sock, buffer, sizeof(buffer)) <= 0)
-               goto out;
+               if (nl80211_wpactl_recv(sock, buffer, sizeof(buffer)) <= 0)
+                       goto out;
+       }
 
 
        send(sock, cmd, strlen(cmd), 0);
@@ -405,7 +408,7 @@ static char * nl80211_wpactl_info(const char *ifname, const char *cmd,
                        break;
                }
 
-               if ((!event && buffer[0] != '<') || strstr(buffer, event))
+               if ((!event && buffer[0] != '<') || (event && strstr(buffer, event)))
                        break;
        }