Date: Sun, 21 Oct 2018 12:39:00 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339532 - head/sys/net Message-ID: <201810211239.w9LCd04b008445@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Sun Oct 21 12:39:00 2018 New Revision: 339532 URL: https://svnweb.freebsd.org/changeset/base/339532 Log: Fix exiting an epoch(9) we never entered. May happen only with MAC. Modified: head/sys/net/if_gif.c head/sys/net/if_gre.c head/sys/net/if_me.c Modified: head/sys/net/if_gif.c ============================================================================== --- head/sys/net/if_gif.c Sun Oct 21 10:46:00 2018 (r339531) +++ head/sys/net/if_gif.c Sun Oct 21 12:39:00 2018 (r339532) @@ -272,6 +272,7 @@ gif_transmit(struct ifnet *ifp, struct mbuf *m) uint8_t proto, ecn; int error; + GIF_RLOCK(); #ifdef MAC error = mac_ifnet_check_transmit(ifp, m); if (error) { @@ -280,7 +281,6 @@ gif_transmit(struct ifnet *ifp, struct mbuf *m) } #endif error = ENETDOWN; - GIF_RLOCK(); sc = ifp->if_softc; if ((ifp->if_flags & IFF_MONITOR) != 0 || (ifp->if_flags & IFF_UP) == 0 || Modified: head/sys/net/if_gre.c ============================================================================== --- head/sys/net/if_gre.c Sun Oct 21 10:46:00 2018 (r339531) +++ head/sys/net/if_gre.c Sun Oct 21 12:39:00 2018 (r339532) @@ -550,6 +550,7 @@ gre_transmit(struct ifnet *ifp, struct mbuf *m) uint16_t proto; len = 0; + GRE_RLOCK(); #ifdef MAC error = mac_ifnet_check_transmit(ifp, m); if (error) { @@ -558,7 +559,6 @@ gre_transmit(struct ifnet *ifp, struct mbuf *m) } #endif error = ENETDOWN; - GRE_RLOCK(); sc = ifp->if_softc; if ((ifp->if_flags & IFF_MONITOR) != 0 || (ifp->if_flags & IFF_UP) == 0 || Modified: head/sys/net/if_me.c ============================================================================== --- head/sys/net/if_me.c Sun Oct 21 10:46:00 2018 (r339531) +++ head/sys/net/if_me.c Sun Oct 21 12:39:00 2018 (r339532) @@ -479,13 +479,13 @@ me_transmit(struct ifnet *ifp, struct mbuf *m) uint32_t af; int error, hlen, plen; + ME_RLOCK(); #ifdef MAC error = mac_ifnet_check_transmit(ifp, m); if (error != 0) goto drop; #endif error = ENETDOWN; - ME_RLOCK(); sc = ifp->if_softc; if (sc == NULL || !ME_READY(sc) || (ifp->if_flags & IFF_MONITOR) != 0 ||
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201810211239.w9LCd04b008445>