summaryrefslogtreecommitdiff
path: root/sys/net/bpf.c
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2015-04-20 22:08:11 +0000
committerMark Johnston <markj@FreeBSD.org>2015-04-20 22:08:11 +0000
commitb23cbbe6db8a4d434063144fa02829658549d8d6 (patch)
tree45adfbce8b69d4876838130fd5c5e298b714d7b2 /sys/net/bpf.c
parent8188e2e04e3dae45659fcc0efea28347ba300ebb (diff)
downloadsrc-test2-b23cbbe6db8a4d434063144fa02829658549d8d6.tar.gz
src-test2-b23cbbe6db8a4d434063144fa02829658549d8d6.zip
Notes
Diffstat (limited to 'sys/net/bpf.c')
-rw-r--r--sys/net/bpf.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index 49f7c4345cbf..9fc5e9f7433c 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -69,7 +69,6 @@ __FBSDID("$FreeBSD$");
#include <net/if.h>
#include <net/if_var.h>
-#define BPF_INTERNAL
#include <net/bpf.h>
#include <net/bpf_buffer.h>
#ifdef BPF_JITTER
@@ -90,6 +89,20 @@ __FBSDID("$FreeBSD$");
MALLOC_DEFINE(M_BPF, "BPF", "BPF data");
+struct bpf_if {
+#define bif_next bif_ext.bif_next
+#define bif_dlist bif_ext.bif_dlist
+ struct bpf_if_ext bif_ext; /* public members */
+ u_int bif_dlt; /* link layer type */
+ u_int bif_hdrlen; /* length of link header */
+ struct ifnet *bif_ifp; /* corresponding interface */
+ struct rwlock bif_lock; /* interface lock */
+ LIST_HEAD(, bpf_d) bif_wlist; /* writer-only list */
+ int bif_flags; /* Interface flags */
+};
+
+CTASSERT(offsetof(struct bpf_if, bif_ext) == 0);
+
#if defined(DEV_BPF) || defined(NETGRAPH_BPF)
#define PRINET 26 /* interruptible */
@@ -1892,7 +1905,7 @@ bpf_setif(struct bpf_d *d, struct ifreq *ifr)
/* Check if interface is not being detached from BPF */
BPFIF_RLOCK(bp);
- if (bp->flags & BPFIF_FLAG_DYING) {
+ if (bp->bif_flags & BPFIF_FLAG_DYING) {
BPFIF_RUNLOCK(bp);
return (ENXIO);
}
@@ -2561,7 +2574,7 @@ bpfdetach(struct ifnet *ifp)
* Mark bp as detached to restrict new consumers.
*/
BPFIF_WLOCK(bp);
- bp->flags |= BPFIF_FLAG_DYING;
+ bp->bif_flags |= BPFIF_FLAG_DYING;
BPFIF_WUNLOCK(bp);
CTR4(KTR_NET, "%s: sheduling free for encap %d (%p) for if %p",