vlan_config() isn't always called in epoch context.

Reported by:	kp
This commit is contained in:
Gleb Smirnoff 2019-10-13 15:15:09 +00:00
parent 583b625ba8
commit 6dcec895d9

View File

@ -1346,12 +1346,11 @@ vlan_lladdr_fn(void *arg, int pending __unused)
static int
vlan_config(struct ifvlan *ifv, struct ifnet *p, uint16_t vid)
{
struct epoch_tracker et;
struct ifvlantrunk *trunk;
struct ifnet *ifp;
int error = 0;
NET_EPOCH_ASSERT();
/*
* We can handle non-ethernet hardware types as long as
* they handle the tagging and headers themselves.
@ -1452,7 +1451,9 @@ vlan_config(struct ifvlan *ifv, struct ifnet *p, uint16_t vid)
ifp->if_link_state = p->if_link_state;
NET_EPOCH_ENTER(et);
vlan_capabilities(ifv);
NET_EPOCH_EXIT(et);
/*
* Set up our interface address to reflect the underlying
@ -1794,8 +1795,6 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
struct vlanreq vlr;
int error = 0;
NET_EPOCH_ASSERT();
ifr = (struct ifreq *)data;
ifa = (struct ifaddr *) data;
ifv = ifp->if_softc;
@ -1972,8 +1971,13 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
VLAN_SLOCK();
ifv->ifv_capenable = ifr->ifr_reqcap;
trunk = TRUNK(ifv);
if (trunk != NULL)
if (trunk != NULL) {
struct epoch_tracker et;
NET_EPOCH_ENTER(et);
vlan_capabilities(ifv);
NET_EPOCH_EXIT(et);
}
VLAN_SUNLOCK();
break;