Author: avos
Date: Mon May  2 20:46:05 2016
New Revision: 298941
URL: https://svnweb.freebsd.org/changeset/base/298941

Log:
  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

Modified:
  head/sys/net80211/ieee80211_ioctl.c

Modified: head/sys/net80211/ieee80211_ioctl.c
==============================================================================
--- head/sys/net80211/ieee80211_ioctl.c Mon May  2 20:16:29 2016        
(r298940)
+++ head/sys/net80211/ieee80211_ioctl.c Mon May  2 20:46:05 2016        
(r298941)
@@ -3382,8 +3382,18 @@ ieee80211_ioctl(struct ifnet *ifp, u_lon
                }
                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:
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to