The startall variable should default to zero, otherwise the vap is restarted

everytime an ioctl happens.

While I am here, limit the locking scope to SIOCSIFFLAGS.
This commit is contained in:
Andrew Thompson 2008-12-06 21:19:26 +00:00
parent e0d315046b
commit 5622c31582

View File

@ -1544,11 +1544,11 @@ ural_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
struct ural_softc *sc = ifp->if_softc;
struct ieee80211com *ic = ifp->if_l2com;
struct ifreq *ifr = (struct ifreq *) data;
int error = 0, startall = 1;
int error = 0, startall = 0;
RAL_LOCK(sc);
switch (cmd) {
case SIOCSIFFLAGS:
RAL_LOCK(sc);
if (ifp->if_flags & IFF_UP) {
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
ural_init_locked(sc);
@ -1559,6 +1559,9 @@ ural_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
ural_stop(sc);
}
RAL_UNLOCK(sc);
if (startall)
ieee80211_start_all(ic);
break;
case SIOCGIFMEDIA:
case SIOCSIFMEDIA:
@ -1568,10 +1571,6 @@ ural_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
error = ether_ioctl(ifp, cmd, data);
break;
}
RAL_UNLOCK(sc);
if (startall)
ieee80211_start_all(ic);
return error;
}