diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-04-28 20:51:45 -0400 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-04-28 20:51:45 -0400 |
commit | 753c36ef1560f0e41c6bdaf901c3098d1a5a235b (patch) | |
tree | c8d6472185b4bd7bbd3f3dc769ab052ace154659 | |
parent | if_wg: write data header directly (diff) | |
download | wireguard-freebsd-753c36ef1560f0e41c6bdaf901c3098d1a5a235b.tar.xz wireguard-freebsd-753c36ef1560f0e41c6bdaf901c3098d1a5a235b.zip |
if_wg: enter net epoch for isr dispatch
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | src/if_wg.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/if_wg.c b/src/if_wg.c index 13a6b66..8eb142e 100644 --- a/src/if_wg.c +++ b/src/if_wg.c @@ -1701,6 +1701,7 @@ wg_deliver_in(struct wg_peer *peer) struct ifnet *ifp = sc->sc_ifp; struct wg_packet *pkt; struct mbuf *m; + struct epoch_tracker et; bool data_recv = false; while ((pkt = wg_queue_dequeue_serial(&peer->p_decrypt_serial)) != NULL) { @@ -1733,6 +1734,7 @@ wg_deliver_in(struct wg_peer *peer) m->m_pkthdr.rcvif = ifp; + NET_EPOCH_ENTER(et); BPF_MTAP2_AF(ifp, m, pkt->p_af); CURVNET_SET(ifp->if_vnet); @@ -1742,6 +1744,7 @@ wg_deliver_in(struct wg_peer *peer) if (pkt->p_af == AF_INET6) netisr_dispatch(NETISR_IPV6, m); CURVNET_RESTORE(); + NET_EPOCH_EXIT(et); done: wg_packet_free(pkt); |