summaryrefslogtreecommitdiff
path: root/sys/net/bpf.c
diff options
context:
space:
mode:
authorYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2012-04-14 09:39:48 +0000
committerYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2012-04-14 09:39:48 +0000
commit576433f81918e999d238d312ba1c6e5b71d36280 (patch)
tree23eae77aa3449ca9b39615863b93a77f6b54982c /sys/net/bpf.c
parent852a7ed231a6296007177e8f5df9ec3978d4dab8 (diff)
Use DLT_LOOP for all tunneling interfaces.
Byte order adjustment for bpf was hidden behind bpf_mtap_af() and sizeof(u_int32_t) is used for length of the bpf header. tested by sebastia and mxb at alumni.chalmers.se. ok claudio
Diffstat (limited to 'sys/net/bpf.c')
-rw-r--r--sys/net/bpf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index 93eddc654a9..0626359bb1e 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bpf.c,v 1.79 2012/01/16 03:34:58 guenther Exp $ */
+/* $OpenBSD: bpf.c,v 1.80 2012/04/14 09:39:46 yasuoka Exp $ */
/* $NetBSD: bpf.c,v 1.33 1997/02/21 23:59:35 thorpej Exp $ */
/*
@@ -1247,11 +1247,13 @@ void
bpf_mtap_af(caddr_t arg, u_int32_t af, struct mbuf *m, u_int direction)
{
struct m_hdr mh;
+ u_int32_t afh;
mh.mh_flags = 0;
mh.mh_next = m;
mh.mh_len = 4;
- mh.mh_data = (caddr_t)&af;
+ afh = htonl(af);
+ mh.mh_data = (caddr_t)&afh;
bpf_mtap(arg, (struct mbuf *) &mh, direction);
m->m_flags |= mh.mh_flags & M_FILDROP;