summaryrefslogtreecommitdiff
path: root/package/iwinfo/src/iwinfo_nl80211.c
diff options
context:
space:
mode:
Diffstat (limited to 'package/iwinfo/src/iwinfo_nl80211.c')
-rw-r--r--package/iwinfo/src/iwinfo_nl80211.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/package/iwinfo/src/iwinfo_nl80211.c b/package/iwinfo/src/iwinfo_nl80211.c
index 4f3390f..e8cfb90 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;
}