summaryrefslogtreecommitdiffstats
path: root/sys/net/if_gif.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net/if_gif.c')
-rw-r--r--sys/net/if_gif.c30
1 files changed, 2 insertions, 28 deletions
diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c
index d77a5a5..6bf538f 100644
--- a/sys/net/if_gif.c
+++ b/sys/net/if_gif.c
@@ -349,21 +349,8 @@ gif_output(ifp, m, dst, rt)
}
if (ifp->if_bpf) {
- /*
- * 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).
- */
- struct mbuf m0;
u_int32_t af = dst->sa_family;
-
- m0.m_next = m;
- m0.m_len = 4;
- m0.m_data = (char *)⁡
-
- BPF_MTAP(ifp, &m0);
+ bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m);
}
ifp->if_opackets++;
ifp->if_obytes += m->m_pkthdr.len;
@@ -418,21 +405,8 @@ gif_input(m, af, ifp)
#endif
if (ifp->if_bpf) {
- /*
- * 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).
- */
- struct mbuf m0;
u_int32_t af1 = af;
-
- m0.m_next = m;
- m0.m_len = 4;
- m0.m_data = (char *)&af1;
-
- BPF_MTAP(ifp, &m0);
+ bpf_mtap2(ifp->if_bpf, &af1, sizeof(af1), m);
}
if (ng_gif_input_p != NULL) {
OpenPOWER on IntegriCloud