The branch stable/12 has been updated by kp:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=2d1773f323195f2ff4910b1ce0f66207dcae79f3

commit 2d1773f323195f2ff4910b1ce0f66207dcae79f3
Author:     Kristof Provost <[email protected]>
AuthorDate: 2021-02-21 20:18:46 +0000
Commit:     Kristof Provost <[email protected]>
CommitDate: 2021-03-02 13:03:06 +0000

    bridge/stp: Ensure we enter NET_EPOCH whenever we can send traffic
    
    Reviewed by:    donner@
    MFC after:      1 week
    Sponsored by:   Orange Business Services
    Differential Revision:  https://reviews.freebsd.org/D28858
    
    (cherry picked from commit 89fa9c34d76bbf85cd7cda60c1868f5e3dba4ec7)
---
 sys/net/bridgestp.c | 2 ++
 sys/net/if_bridge.c | 8 +++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c
index ed83a2d646f5..d0259c37bf84 100644
--- a/sys/net/bridgestp.c
+++ b/sys/net/bridgestp.c
@@ -1871,6 +1871,7 @@ bstp_tick(void *arg)
        if (bs->bs_running == 0)
                return;
 
+       NET_EPOCH_ENTER();
        CURVNET_SET(bs->bs_vnet);
 
        /* poll link events on interfaces that do not support linkstate */
@@ -1909,6 +1910,7 @@ bstp_tick(void *arg)
        }
 
        CURVNET_RESTORE();
+       NET_EPOCH_EXIT();
 
        callout_reset(&bs->bs_bstpcallout, hz, bstp_tick, bs);
 }
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index 4e5c9ada12d1..8b25c28eb554 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -1408,11 +1408,15 @@ bridge_ioctl_sifflags(struct bridge_softc *sc, void 
*arg)
                /* SPAN is readonly */
                return (EINVAL);
 
+       NET_EPOCH_ENTER();
+
        if (req->ifbr_ifsflags & IFBIF_STP) {
                if ((bif->bif_flags & IFBIF_STP) == 0) {
                        error = bstp_enable(&bif->bif_stp);
-                       if (error)
+                       if (error) {
+                               NET_EPOCH_EXIT();
                                return (error);
+                       }
                }
        } else {
                if ((bif->bif_flags & IFBIF_STP) != 0)
@@ -1428,6 +1432,8 @@ bridge_ioctl_sifflags(struct bridge_softc *sc, void *arg)
        /* Save the bits relating to the bridge */
        bif->bif_flags = req->ifbr_ifsflags & IFBIFMASK;
 
+       NET_EPOCH_EXIT();
+
        return (0);
 }
 
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to