svn commit: r297592 - head/sys/net80211

Andriy Voskoboinyk avos at FreeBSD.org
Tue Apr 5 21:29:13 UTC 2016


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 */
 


More information about the svn-src-all mailing list