Author: glebius
Date: Thu Jul  8 13:07:40 2010
New Revision: 209797
URL: http://svn.freebsd.org/changeset/base/209797

Log:
  Since r209216 bpf(4) searches for mbuf_tags(9) and thus will not work with
  a stub m_hdr instead of a full mbuf.
  
  PR:           kern/148050

Modified:
  head/sys/netinet/ipfw/ip_fw_log.c

Modified: head/sys/netinet/ipfw/ip_fw_log.c
==============================================================================
--- head/sys/netinet/ipfw/ip_fw_log.c   Thu Jul  8 12:21:25 2010        
(r209796)
+++ head/sys/netinet/ipfw/ip_fw_log.c   Thu Jul  8 13:07:40 2010        
(r209797)
@@ -152,22 +152,24 @@ ipfw_log(struct ip_fw *f, u_int hlen, st
 
        if (V_fw_verbose == 0) {
 #ifndef WITHOUT_BPF
-               struct m_hdr mh;
+               struct mbuf m0;
 
                if (log_if == NULL || log_if->if_bpf == NULL)
                        return;
+
                /* BPF treats the "mbuf" as read-only */
-               mh.mh_next = m;
-               mh.mh_len = ETHER_HDR_LEN;
+               bzero(&m0, sizeof(struct mbuf));
+               m0.m_hdr.mh_next = m;
+               m0.m_hdr.mh_len = ETHER_HDR_LEN;
                if (args->eh) { /* layer2, use orig hdr */
-                       mh.mh_data = (char *)args->eh;
+                       m0.m_hdr.mh_data = (char *)args->eh;
                } else {
                        /* add fake header. Later we will store
                         * more info in the header
                         */
-                       mh.mh_data = "DDDDDDSSSSSS\x08\x00";
+                       m0.m_hdr.mh_data = "DDDDDDSSSSSS\x08\x00";
                }
-               BPF_MTAP(log_if, (struct mbuf *)&mh);
+               BPF_MTAP(log_if, &m0);
 #endif /* !WITHOUT_BPF */
                return;
        }
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to