Author: glebius
Date: Thu Sep 16 15:07:12 2010
New Revision: 212737
URL: http://svn.freebsd.org/changeset/base/212737

Log:
  Although flexible BPF timestamping framework isn't yet merged to stable/8,
  merge from head r209797,r209845 that fix a possible problem.

Modified:
  stable/8/sys/netinet/ipfw/ip_fw_log.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/netinet/ipfw/ip_fw_log.c
==============================================================================
--- stable/8/sys/netinet/ipfw/ip_fw_log.c       Thu Sep 16 15:00:43 2010        
(r212736)
+++ stable/8/sys/netinet/ipfw/ip_fw_log.c       Thu Sep 16 15:07:12 2010        
(r212737)
@@ -152,22 +152,17 @@ ipfw_log(struct ip_fw *f, u_int hlen, st
 
        if (V_fw_verbose == 0) {
 #ifndef WITHOUT_BPF
-               struct m_hdr mh;
 
                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;
-               if (args->eh) { /* layer2, use orig hdr */
-                       mh.mh_data = (char *)args->eh;
-               } else {
-                       /* add fake header. Later we will store
-                        * more info in the header
+
+               if (args->eh) /* layer2, use orig hdr */
+                       BPF_MTAP2(log_if, args->eh, ETHER_HDR_LEN, m);
+               else
+                       /* Add fake header. Later we will store
+                        * more info in the header.
                         */
-                       mh.mh_data = "DDDDDDSSSSSS\x08\x00";
-               }
-               BPF_MTAP(log_if, (struct mbuf *)&mh);
+                       BPF_MTAP2(log_if, "DDDDDDSSSSSS\x08\x00", 
ETHER_HDR_LEN, m);
 #endif /* !WITHOUT_BPF */
                return;
        }
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to