From owner-svn-src-head@freebsd.org Tue Apr 5 21:29:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF010B04D3E; Tue, 5 Apr 2016 21:29:12 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92B9019E2; Tue, 5 Apr 2016 21:29:12 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u35LTBux055484; Tue, 5 Apr 2016 21:29:11 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u35LTBpR055481; Tue, 5 Apr 2016 21:29:11 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201604052129.u35LTBpR055481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 5 Apr 2016 21:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297592 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Apr 2016 21:29:13 -0000 Author: avos Date: Tue Apr 5 21:29:11 2016 New Revision: 297592 URL: https://svnweb.freebsd.org/changeset/base/297592 Log: net80211: copy MAC address into iv_myaddr[] instead of aliasing it. Since IF_LLADDR() returns a non-constant pointer to the MAC address preserve a copy of it in iv_myaddr. PR: 208505 Modified: head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Tue Apr 5 21:12:03 2016 (r297591) +++ head/sys/net80211/ieee80211.c Tue Apr 5 21:29:11 2016 (r297592) @@ -483,7 +483,7 @@ ieee80211_vap_setup(struct ieee80211com vap->iv_htextcaps = ic->ic_htextcaps; vap->iv_opmode = opmode; vap->iv_caps |= ieee80211_opcap[opmode]; - vap->iv_myaddr = ic->ic_macaddr; + IEEE80211_ADDR_COPY(vap->iv_myaddr, ic->ic_macaddr); switch (opmode) { case IEEE80211_M_WDS: /* @@ -603,7 +603,7 @@ ieee80211_vap_attach(struct ieee80211vap ifp->if_baudrate = IF_Mbps(maxrate); ether_ifattach(ifp, macaddr); - vap->iv_myaddr = IF_LLADDR(ifp); + IEEE80211_ADDR_COPY(vap->iv_myaddr, IF_LLADDR(ifp)); /* hook output method setup by ether_ifattach */ vap->iv_output = ifp->if_output; ifp->if_output = ieee80211_output; Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Tue Apr 5 21:12:03 2016 (r297591) +++ head/sys/net80211/ieee80211_var.h Tue Apr 5 21:29:11 2016 (r297592) @@ -362,7 +362,8 @@ struct ieee80211vap { TAILQ_ENTRY(ieee80211vap) iv_next; /* list of vap instances */ struct ieee80211com *iv_ic; /* back ptr to common state */ - const uint8_t *iv_myaddr; /* MAC address: ifp or ic */ + /* MAC address: ifp or ic */ + uint8_t iv_myaddr[IEEE80211_ADDR_LEN]; uint32_t iv_debug; /* debug msg flags */ struct ieee80211_stats iv_stats; /* statistics */