diff options
| author | 2012-04-14 09:39:46 +0000 | |
|---|---|---|
| committer | 2012-04-14 09:39:46 +0000 | |
| commit | c3dd9049d3817634fd6b78fe28674b79f10a4100 (patch) | |
| tree | b345b850afd67201744c593ad371327ed106cd37 /sys/net/bpf.c | |
| parent | Import asr, an experimental async resolver implementation. (diff) | |
| download | wireguard-openbsd-c3dd9049d3817634fd6b78fe28674b79f10a4100.tar.xz wireguard-openbsd-c3dd9049d3817634fd6b78fe28674b79f10a4100.zip | |
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.c | 6 |
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)⁡ + afh = htonl(af); + mh.mh_data = (caddr_t)&afh; bpf_mtap(arg, (struct mbuf *) &mh, direction); m->m_flags |= mh.mh_flags & M_FILDROP; |
