summaryrefslogtreecommitdiffstats
path: root/tools/tools/net80211
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2009-02-05 23:15:39 +0000
committersam <sam@FreeBSD.org>2009-02-05 23:15:39 +0000
commit49edf8abc42ae29e39b660f356b4c4bd54f57761 (patch)
treeadef84304c979b6dad9aca885f2b1311ee05995d /tools/tools/net80211
parentfa654c58a4bfb22536c5568a23dbe93dc8ecdbc0 (diff)
downloadFreeBSD-src-49edf8abc42ae29e39b660f356b4c4bd54f57761.zip
FreeBSD-src-49edf8abc42ae29e39b660f356b4c4bd54f57761.tar.gz
for adhoc and ahdemo modes try to find the "bss node": use the bssid
unless it's not setup or zero's; this may not work as the bssid of the ibss isn't certain to the "right mac address" but for many cases it is
Diffstat (limited to 'tools/tools/net80211')
-rw-r--r--tools/tools/net80211/wlanstats/wlanstats.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/tools/net80211/wlanstats/wlanstats.c b/tools/tools/net80211/wlanstats/wlanstats.c
index f774384..dd8e106 100644
--- a/tools/tools/net80211/wlanstats/wlanstats.c
+++ b/tools/tools/net80211/wlanstats/wlanstats.c
@@ -437,15 +437,24 @@ getbssid(struct wlanstatfoo_p *wf)
static void
wlan_setstamac(struct wlanstatfoo *wf0, const uint8_t *mac)
{
+ static const uint8_t zeromac[IEEE80211_ADDR_LEN];
struct wlanstatfoo_p *wf = (struct wlanstatfoo_p *) wf0;
if (mac == NULL) {
switch (wlan_getopmode(wf0)) {
case IEEE80211_M_HOSTAP:
case IEEE80211_M_MONITOR:
+ getlladdr(wf);
+ break;
case IEEE80211_M_IBSS:
case IEEE80211_M_AHDEMO:
- getlladdr(wf);
+ /*
+ * NB: this may not work in which case the
+ * mac must be specified on the command line
+ */
+ if (getbssid(wf) < 0 ||
+ IEEE80211_ADDR_EQ(wf->mac, zeromac))
+ getlladdr(wf);
break;
case IEEE80211_M_STA:
if (getbssid(wf) < 0)
OpenPOWER on IntegriCloud