diff options
author | avos <avos@FreeBSD.org> | 2016-05-02 20:46:05 +0000 |
---|---|---|
committer | avos <avos@FreeBSD.org> | 2016-05-02 20:46:05 +0000 |
commit | 4bc772546d4686425007f7d1cc71dbb5544a2c0b (patch) | |
tree | 59175c37e4fc2953741d0fc71aa8da5100a2bb98 /sys/net80211/ieee80211_ioctl.c | |
parent | 8327dbfe4d5dbe83615076008f31eb5e01d4c01a (diff) | |
download | FreeBSD-src-4bc772546d4686425007f7d1cc71dbb5544a2c0b.zip FreeBSD-src-4bc772546d4686425007f7d1cc71dbb5544a2c0b.tar.gz |
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
Diffstat (limited to 'sys/net80211/ieee80211_ioctl.c')
-rw-r--r-- | sys/net80211/ieee80211_ioctl.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c index c3b02e8..823906b 100644 --- a/sys/net80211/ieee80211_ioctl.c +++ b/sys/net80211/ieee80211_ioctl.c @@ -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: |