net80211: fix MAC address change via SIOCSIFLLADDR ioctl.

Recheck MAC address on SIOCSIFFLAGS; as a result,
'ifconfig wlan0 ether <addr>' can be used after interface startup.

PR:		208933
This commit is contained in:
Andriy Voskoboinyk 2016-05-02 20:46:05 +00:00
parent 763df3ec55
commit c6a35ee46c

View File

@ -3382,8 +3382,18 @@ ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
}
IEEE80211_UNLOCK(ic);
/* Wait for parent ioctl handler if it was queued */
if (wait)
if (wait) {
ieee80211_waitfor_parent(ic);
/*
* Check if the MAC address was changed
* via SIOCSIFLLADDR ioctl.
*/
if ((ifp->if_flags & IFF_UP) == 0 &&
!IEEE80211_ADDR_EQ(vap->iv_myaddr, IF_LLADDR(ifp)))
IEEE80211_ADDR_COPY(vap->iv_myaddr,
IF_LLADDR(ifp));
}
break;
case SIOCADDMULTI:
case SIOCDELMULTI: