Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dist/pf/net pflog_packet: use bpf_mtap2().



details:   https://anonhg.NetBSD.org/src/rev/40e5d5066a8e
branches:  trunk
changeset: 569860:40e5d5066a8e
user:      yamt <yamt%NetBSD.org@localhost>
date:      Fri Sep 10 08:48:32 2004 +0000

description:
pflog_packet: use bpf_mtap2().
(our bpf_mtap() is more "strict" about mbufs
than openbsd's one is.  eg. M_PKTHDR should be set properly.)

diffstat:

 sys/dist/pf/net/if_pflog.c |  10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diffs (40 lines):

diff -r 261415150d1b -r 40e5d5066a8e sys/dist/pf/net/if_pflog.c
--- a/sys/dist/pf/net/if_pflog.c        Fri Sep 10 07:11:26 2004 +0000
+++ b/sys/dist/pf/net/if_pflog.c        Fri Sep 10 08:48:32 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_pflog.c,v 1.3 2004/06/29 04:42:55 itojun Exp $      */
+/*     $NetBSD: if_pflog.c,v 1.4 2004/09/10 08:48:32 yamt Exp $        */
 /*     $OpenBSD: if_pflog.c,v 1.11 2003/12/31 11:18:25 cedric Exp $    */
 /*
  * The authors of this code are John Ioannidis (ji%tla.org@localhost),
@@ -210,7 +210,9 @@
 #if NBPFILTER > 0
        struct ifnet *ifn;
        struct pfloghdr hdr;
+#ifndef __NetBSD__
        struct mbuf m1;
+#endif
 
        if (kif == NULL || m == NULL || rm == NULL)
                return (-1);
@@ -246,14 +248,20 @@
        }
 #endif /* INET */
 
+#ifndef __NetBSD__
        m1.m_next = m;
        m1.m_len = PFLOG_HDRLEN;
        m1.m_data = (char *) &hdr;
+#endif
 
        ifn = &(pflogif[0].sc_if);
 
        if (ifn->if_bpf)
+#ifndef __NetBSD__
                bpf_mtap(ifn->if_bpf, &m1);
+#else
+               bpf_mtap2(ifn->if_bpf, &hdr, PFLOG_HDRLEN, m);
+#endif
 #endif
 
        return (0);



Home | Main Index | Thread Index | Old Index