From owner-svn-src-all@freebsd.org Wed Apr 6 21:43:38 2016 Return-Path: Delivered-To: svn-src-all@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 99267B06826; Wed, 6 Apr 2016 21:43:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8313C1100; Wed, 6 Apr 2016 21:43:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u36Lhbk7007674 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 6 Apr 2016 14:43:37 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u36LhbZL007673; Wed, 6 Apr 2016 14:43:37 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 6 Apr 2016 14:43:37 -0700 From: Gleb Smirnoff To: Andriy Voskoboinyk Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297592 - head/sys/net80211 Message-ID: <20160406214337.GD1080@FreeBSD.org> References: <201604052129.u35LTBpR055481@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201604052129.u35LTBpR055481@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 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: Wed, 06 Apr 2016 21:43:38 -0000 On Tue, Apr 05, 2016 at 09:29:11PM +0000, Andriy Voskoboinyk wrote: A> Author: avos A> Date: Tue Apr 5 21:29:11 2016 A> New Revision: 297592 A> URL: https://svnweb.freebsd.org/changeset/base/297592 A> A> Log: A> net80211: copy MAC address into iv_myaddr[] instead of aliasing it. A> A> Since IF_LLADDR() returns a non-constant pointer to the MAC address A> preserve a copy of it in iv_myaddr. A> A> PR: 208505 This is actually a bug of ifnet layer, not of ieee80211. So this fix is a workaround. You are welcome to try to improve the situation with ifnet :) Meanwhile, can you please put a comment into 'struct ieee80211vap' declaration: /* * XXX: we copy the address, since address returned by IF_LLADDR() isn't * constant. See PR 208505. */ A> Modified: A> head/sys/net80211/ieee80211.c A> head/sys/net80211/ieee80211_var.h A> A> Modified: head/sys/net80211/ieee80211.c A> ============================================================================== A> --- head/sys/net80211/ieee80211.c Tue Apr 5 21:12:03 2016 (r297591) A> +++ head/sys/net80211/ieee80211.c Tue Apr 5 21:29:11 2016 (r297592) A> @@ -483,7 +483,7 @@ ieee80211_vap_setup(struct ieee80211com A> vap->iv_htextcaps = ic->ic_htextcaps; A> vap->iv_opmode = opmode; A> vap->iv_caps |= ieee80211_opcap[opmode]; A> - vap->iv_myaddr = ic->ic_macaddr; A> + IEEE80211_ADDR_COPY(vap->iv_myaddr, ic->ic_macaddr); A> switch (opmode) { A> case IEEE80211_M_WDS: A> /* A> @@ -603,7 +603,7 @@ ieee80211_vap_attach(struct ieee80211vap A> ifp->if_baudrate = IF_Mbps(maxrate); A> A> ether_ifattach(ifp, macaddr); A> - vap->iv_myaddr = IF_LLADDR(ifp); A> + IEEE80211_ADDR_COPY(vap->iv_myaddr, IF_LLADDR(ifp)); A> /* hook output method setup by ether_ifattach */ A> vap->iv_output = ifp->if_output; A> ifp->if_output = ieee80211_output; A> A> Modified: head/sys/net80211/ieee80211_var.h A> ============================================================================== A> --- head/sys/net80211/ieee80211_var.h Tue Apr 5 21:12:03 2016 (r297591) A> +++ head/sys/net80211/ieee80211_var.h Tue Apr 5 21:29:11 2016 (r297592) A> @@ -362,7 +362,8 @@ struct ieee80211vap { A> A> TAILQ_ENTRY(ieee80211vap) iv_next; /* list of vap instances */ A> struct ieee80211com *iv_ic; /* back ptr to common state */ A> - const uint8_t *iv_myaddr; /* MAC address: ifp or ic */ A> + /* MAC address: ifp or ic */ A> + uint8_t iv_myaddr[IEEE80211_ADDR_LEN]; A> uint32_t iv_debug; /* debug msg flags */ A> struct ieee80211_stats iv_stats; /* statistics */ A> A> _______________________________________________ A> svn-src-all@freebsd.org mailing list A> https://lists.freebsd.org/mailman/listinfo/svn-src-all A> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- Totus tuus, Glebius.