diff options
Diffstat (limited to 'applets/mb-applet-wireless.c')
-rw-r--r-- | applets/mb-applet-wireless.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/applets/mb-applet-wireless.c b/applets/mb-applet-wireless.c index ecd4f5b..45a852a 100644 --- a/applets/mb-applet-wireless.c +++ b/applets/mb-applet-wireless.c @@ -350,14 +350,27 @@ find_iwface(int Wfd, char *ifname, char *args[], int count) if (iw_get_basic_config(Wfd, ifname, &WInfo.b) < 0) return 0; - /* already found first one */ - if (Mwd.iface != NULL) - return 0; + /* dont stop check interfaces till we find one that supports stats + * works round odd issues on Z with host AP. + */ + if (Mwd.iface != NULL && WInfo.has_stats == 1) + return 0; + + if(iw_get_range_info(Wfd, Mwd.iface, &(WInfo.range)) >= 0) + WInfo.has_range = 1; + + if (iw_get_stats(Wfd, Mwd.iface, + &(WInfo.stats), + &(WInfo.range), WInfo.has_range) >= 0) + WInfo.has_stats = 1; - /* mark first found as one to monitor */ - Mwd.iface = strdup(ifname); + /* mark first found as one to monitor */ + if (Mwd.iface) + free(Mwd.iface); - return 0; + Mwd.iface = strdup(ifname); + + return 0; } |