Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Sep 2010 15:07:12 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r212737 - stable/8/sys/netinet/ipfw
Message-ID:  <201009161507.o8GF7ClL095058@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009161507.o8GF7ClL095058>