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
This commit is contained in:
parent
91da76981b
commit
1d47c76c8c
@ -483,7 +483,7 @@ ieee80211_vap_setup(struct ieee80211com *ic, struct ieee80211vap *vap,
|
||||
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 *vap, ifm_change_cb_t media_change,
|
||||
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;
|
||||
|
@ -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 */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user