From owner-svn-src-all@FreeBSD.ORG Thu Feb 5 23:15:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 369F3106566C; Thu, 5 Feb 2009 23:15:40 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24D6B8FC1B; Thu, 5 Feb 2009 23:15:40 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n15NFeGe042236; Thu, 5 Feb 2009 23:15:40 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n15NFewu042235; Thu, 5 Feb 2009 23:15:40 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902052315.n15NFewu042235@svn.freebsd.org> From: Sam Leffler Date: Thu, 5 Feb 2009 23:15:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188210 - head/tools/tools/net80211/wlanstats X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2009 23:15:41 -0000 Author: sam Date: Thu Feb 5 23:15:39 2009 New Revision: 188210 URL: http://svn.freebsd.org/changeset/base/188210 Log: 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 Modified: head/tools/tools/net80211/wlanstats/wlanstats.c Modified: head/tools/tools/net80211/wlanstats/wlanstats.c ============================================================================== --- head/tools/tools/net80211/wlanstats/wlanstats.c Thu Feb 5 23:01:36 2009 (r188209) +++ head/tools/tools/net80211/wlanstats/wlanstats.c Thu Feb 5 23:15:39 2009 (r188210) @@ -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)