From 1a67d1a4b1d0e5d6e371747a8a02ad452f2d6833 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 2 Feb 2012 14:06:59 +0000 Subject: [PATCH] [backfire] iwinfo: backport r29992 SVN-Revision: 29993 --- package/iwinfo/Makefile | 2 +- package/iwinfo/src/iwinfo_nl80211.c | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/package/iwinfo/Makefile b/package/iwinfo/Makefile index a946ef1eff..51fbb828cc 100644 --- a/package/iwinfo/Makefile +++ b/package/iwinfo/Makefile @@ -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) diff --git a/package/iwinfo/src/iwinfo_nl80211.c b/package/iwinfo/src/iwinfo_nl80211.c index 96f9e79116..66429a210d 100644 --- a/package/iwinfo/src/iwinfo_nl80211.c +++ b/package/iwinfo/src/iwinfo_nl80211.c @@ -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; } -- 2.30.2