From 576433f81918e999d238d312ba1c6e5b71d36280 Mon Sep 17 00:00:00 2001 From: YASUOKA Masahiko Date: Sat, 14 Apr 2012 09:39:48 +0000 Subject: 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 --- sys/net/bpf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys/net/bpf.c') 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)⁡ + afh = htonl(af); + mh.mh_data = (caddr_t)&afh; bpf_mtap(arg, (struct mbuf *) &mh, direction); m->m_flags |= mh.mh_flags & M_FILDROP; -- cgit v1.2.3