mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-19 15:33:56 +00:00
Ensure that we are holding the lock when initialising the bridge interface. We
could initialise while unlocked if the bridge is not up when setting the inet address, ether_ioctl() would call bridge_init. Change it so bridge_init is always called unlocked and then locks before calling bstp_initialization(). Reported by: Michal Mertl Approved by: mlaier (mentor) MFC after: 3 days
This commit is contained in:
parent
d41a7ed490
commit
a1c0fd4dee
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=149064
@ -597,6 +597,7 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
* If interface is marked up and it is stopped, then
|
||||
* start it.
|
||||
*/
|
||||
BRIDGE_UNLOCK(sc);
|
||||
(*ifp->if_init)(sc);
|
||||
}
|
||||
break;
|
||||
@ -1214,8 +1215,10 @@ bridge_init(void *xsc)
|
||||
callout_reset(&sc->sc_brcallout, bridge_rtable_prune_period * hz,
|
||||
bridge_timer, sc);
|
||||
|
||||
BRIDGE_LOCK(sc);
|
||||
ifp->if_drv_flags |= IFF_DRV_RUNNING;
|
||||
bstp_initialization(sc);
|
||||
BRIDGE_UNLOCK(sc);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1229,6 +1232,8 @@ bridge_stop(struct ifnet *ifp, int disable)
|
||||
{
|
||||
struct bridge_softc *sc = ifp->if_softc;
|
||||
|
||||
BRIDGE_LOCK_ASSERT(sc);
|
||||
|
||||
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
|
||||
return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user