From 9f67f65b7ee43f0ed9f444d4792678bb874a7857 Mon Sep 17 00:00:00 2001 From: dlg Date: Wed, 2 Jun 2021 01:37:10 +0000 Subject: [PATCH] only read the if_bpf pointer once. --- sys/net/if_tpmr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/if_tpmr.c b/sys/net/if_tpmr.c index 50ac1ed91b4..f6eb99f347c 100644 --- a/sys/net/if_tpmr.c +++ b/sys/net/if_tpmr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tpmr.c,v 1.29 2021/06/02 01:36:10 dlg Exp $ */ +/* $OpenBSD: if_tpmr.c,v 1.30 2021/06/02 01:37:10 dlg Exp $ */ /* * Copyright (c) 2019 The University of Queensland @@ -368,7 +368,7 @@ tpmr_input(struct ifnet *ifp0, struct mbuf *m, uint64_t dst, void *brport) counters_pkt(ifp->if_counters, ifc_ipackets, ifc_ibytes, len); #if NBPFILTER > 0 - if_bpf = ifp->if_bpf; + if_bpf = READ_ONCE(ifp->if_bpf); if (if_bpf) { if (bpf_mtap(if_bpf, m, 0)) goto drop; -- 2.20.1