From: dlg Date: Wed, 2 Jun 2021 01:37:10 +0000 (+0000) Subject: only read the if_bpf pointer once. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9f67f65b7ee43f0ed9f444d4792678bb874a7857;p=openbsd only read the if_bpf pointer once. --- 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;