Author: glebius
Date: Sun Oct 13 15:15:09 2019
New Revision: 353467
URL: https://svnweb.freebsd.org/changeset/base/353467

Log:
  vlan_config() isn't always called in epoch context.
  
  Reported by:  kp

Modified:
  head/sys/net/if_vlan.c

Modified: head/sys/net/if_vlan.c
==============================================================================
--- head/sys/net/if_vlan.c      Sun Oct 13 09:35:03 2019        (r353466)
+++ head/sys/net/if_vlan.c      Sun Oct 13 15:15:09 2019        (r353467)
@@ -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, uint1
 
        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;
 
_______________________________________________
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