From owner-svn-src-all@freebsd.org Sun Oct 13 15:15:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 509FCFBEFC; Sun, 13 Oct 2019 15:15:10 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46rlcG158pz41cy; Sun, 13 Oct 2019 15:15:10 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 08B111EB63; Sun, 13 Oct 2019 15:15:10 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9DFF9OW040917; Sun, 13 Oct 2019 15:15:09 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9DFF9It040916; Sun, 13 Oct 2019 15:15:09 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201910131515.x9DFF9It040916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 13 Oct 2019 15:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353467 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 353467 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Oct 2019 15:15:10 -0000 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;