From 53dfabf00b92ae9dbb5e35331203ebc28850fe32 Mon Sep 17 00:00:00 2001 From: glebius Date: Wed, 15 Jan 2020 06:18:32 +0000 Subject: [PATCH] gif_transmit() must always be called in the network epoch. --- sys/net/if_gif.c | 3 +-- sys/net/if_gif.h | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c index af911d09c945..5985eba63a0d 100644 --- a/sys/net/if_gif.c +++ b/sys/net/if_gif.c @@ -272,7 +272,7 @@ gif_transmit(struct ifnet *ifp, struct mbuf *m) uint8_t proto, ecn; int error; - GIF_RLOCK(); + NET_EPOCH_ASSERT(); #ifdef MAC error = mac_ifnet_check_transmit(ifp, m); if (error) { @@ -370,7 +370,6 @@ gif_transmit(struct ifnet *ifp, struct mbuf *m) err: if (error) if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - GIF_RUNLOCK(); return (error); } diff --git a/sys/net/if_gif.h b/sys/net/if_gif.h index 264fe7b3ddd5..2e61fcc166e1 100644 --- a/sys/net/if_gif.h +++ b/sys/net/if_gif.h @@ -97,8 +97,6 @@ struct etherip_header { /* mbuf adjust factor to force 32-bit alignment of IP header */ #define ETHERIP_ALIGN 2 -#define GIF_RLOCK() struct epoch_tracker gif_et; epoch_enter_preempt(net_epoch_preempt, &gif_et) -#define GIF_RUNLOCK() epoch_exit_preempt(net_epoch_preempt, &gif_et) #define GIF_WAIT() epoch_wait_preempt(net_epoch_preempt) /* Prototypes */