svn commit: r188211 - in projects/vap7/tools/tools/net80211: . wlanstats

Sam Leffler sam at FreeBSD.org
Thu Feb 5 15:16:53 PST 2009


Author: sam
Date: Thu Feb  5 23:16:33 2009
New Revision: 188211
URL: http://svn.freebsd.org/changeset/base/188211

Log:
  merge 188210: guess bss node address for adhoc+ahdemo modes

Modified:
  projects/vap7/tools/tools/net80211/   (props changed)
  projects/vap7/tools/tools/net80211/wlanstats/wlanstats.c

Modified: projects/vap7/tools/tools/net80211/wlanstats/wlanstats.c
==============================================================================
--- projects/vap7/tools/tools/net80211/wlanstats/wlanstats.c	Thu Feb  5 23:15:39 2009	(r188210)
+++ projects/vap7/tools/tools/net80211/wlanstats/wlanstats.c	Thu Feb  5 23:16:33 2009	(r188211)
@@ -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)


More information about the svn-src-projects mailing list