aboutsummaryrefslogtreecommitdiff
path: root/sys/net/if_loop.c
diff options
context:
space:
mode:
authorSam Leffler <sam@FreeBSD.org>2003-12-28 03:56:00 +0000
committerSam Leffler <sam@FreeBSD.org>2003-12-28 03:56:00 +0000
commit437ffe182391fbcd9826ce327abbd175515b687d (patch)
treef663da0db11fcecb5ff2d3e93732492fb4d7bd29 /sys/net/if_loop.c
parentbd80d26f3b2fc205d7351ec17e029625f915a687 (diff)
Notes
Diffstat (limited to 'sys/net/if_loop.c')
-rw-r--r--sys/net/if_loop.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c
index 9a54af471f4d..38aae4ebeb5d 100644
--- a/sys/net/if_loop.c
+++ b/sys/net/if_loop.c
@@ -252,22 +252,14 @@ if_simloop(ifp, m, af, hlen)
/* Let BPF see incoming packet */
if (ifp->if_bpf) {
- struct mbuf m0, *n = m;
-
if (ifp->if_bpf->bif_dlt == DLT_NULL) {
+ u_int32_t af1 = af; /* XXX beware sizeof(af) != 4 */
/*
- * We need to prepend the address family as
- * a four byte field. Cons up a dummy header
- * to pacify bpf. This is safe because bpf
- * will only read from the mbuf (i.e., it won't
- * try to free it or keep a pointer a to it).
+ * We need to prepend the address family.
*/
- m0.m_next = m;
- m0.m_len = 4;
- m0.m_data = (char *)&af;
- n = &m0;
- }
- BPF_MTAP(ifp, n);
+ bpf_mtap2(ifp->if_bpf, &af1, sizeof(af1), m);
+ } else
+ bpf_mtap(ifp->if_bpf, m);
}
/* Strip away media header */