diff options
author | Andrew Thompson <thompsa@FreeBSD.org> | 2006-06-27 01:53:12 +0000 |
---|---|---|
committer | Andrew Thompson <thompsa@FreeBSD.org> | 2006-06-27 01:53:12 +0000 |
commit | f0ac1eedd5f09e3b3f9daf8aa23752a76e188d35 (patch) | |
tree | 430438506c42aa5202fee958c074b56ddf4627ad /sys/net/if_enc.c | |
parent | a04de8fa959fc816e632ba0348aaf09af34a4d6e (diff) | |
download | src-f0ac1eedd5f09e3b3f9daf8aa23752a76e188d35.tar.gz src-f0ac1eedd5f09e3b3f9daf8aa23752a76e188d35.zip |
Simplify ipsec_bpf by using bpf_mtap2().
Notes
Notes:
svn path=/head/; revision=159969
Diffstat (limited to 'sys/net/if_enc.c')
-rw-r--r-- | sys/net/if_enc.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/sys/net/if_enc.c b/sys/net/if_enc.c index 0aaf4aa35e09..361a0ca36294 100644 --- a/sys/net/if_enc.c +++ b/sys/net/if_enc.c @@ -63,7 +63,6 @@ #include <netipsec/ipsec.h> #define ENCMTU (1024+512) -#define ENC_HDRLEN 12 /* XXX this define must have the same value as in OpenBSD */ #define M_CONF 0x0400 /* payload was encrypted (ESP-transport) */ @@ -132,7 +131,7 @@ enc_clone_create(struct if_clone *ifc, int unit) ifp->if_snd.ifq_maxlen = ifqmaxlen; ifp->if_softc = sc; if_attach(ifp); - bpfattach(ifp, DLT_ENC, ENC_HDRLEN); + bpfattach(ifp, DLT_ENC, sizeof(struct enchdr)); mtx_lock(&enc_mtx); encif = ifp; @@ -284,7 +283,6 @@ ipsec_bpf(struct mbuf *m, struct secasvar *sav, int af) { int flags; struct enchdr hdr; - struct mbuf m1; KASSERT(sav != NULL, ("%s: sav is null", __func__)); @@ -312,12 +310,7 @@ ipsec_bpf(struct mbuf *m, struct secasvar *sav, int af) hdr.spi = sav->spi; hdr.flags = flags; - m1.m_flags = 0; - m1.m_next = m; - m1.m_len = ENC_HDRLEN; - m1.m_data = (char *) &hdr; - - bpf_mtap(encif->if_bpf, &m1); + bpf_mtap2(encif->if_bpf, &hdr, sizeof(hdr), m); } mtx_unlock(&enc_mtx); } |