Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Oct 2013 12:35:03 +0000 (UTC)
From:      Philip Paeps <philip@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r255987 - stable/9/sys/netpfil/ipfw
Message-ID:  <201310021235.r92CZ3Ge045448@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: philip
Date: Wed Oct  2 12:35:03 2013
New Revision: 255987
URL: http://svnweb.freebsd.org/changeset/base/255987

Log:
  MFC r255928:
   Use the correct EtherType for logging IPv6 packets.

Modified:
  stable/9/sys/netpfil/ipfw/ip_fw_log.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/netpfil/ipfw/ip_fw_log.c
==============================================================================
--- stable/9/sys/netpfil/ipfw/ip_fw_log.c	Wed Oct  2 06:00:34 2013	(r255986)
+++ stable/9/sys/netpfil/ipfw/ip_fw_log.c	Wed Oct  2 12:35:03 2013	(r255987)
@@ -173,11 +173,18 @@ ipfw_log(struct ip_fw *f, u_int hlen, st
 
 		if (args->eh) /* layer2, use orig hdr */
 			BPF_MTAP2(log_if, args->eh, ETHER_HDR_LEN, m);
-		else
+		else {
 			/* Add fake header. Later we will store
 			 * more info in the header.
 			 */
-			BPF_MTAP2(log_if, "DDDDDDSSSSSS\x08\x00", ETHER_HDR_LEN, m);
+			if (ip->ip_v == 4)
+				BPF_MTAP2(log_if, "DDDDDDSSSSSS\x08\x00", ETHER_HDR_LEN, m);
+			else if  (ip->ip_v == 6)
+				BPF_MTAP2(log_if, "DDDDDDSSSSSS\x86\xdd", ETHER_HDR_LEN, m);
+			else
+				/* Obviously bogus EtherType. */
+				BPF_MTAP2(log_if, "DDDDDDSSSSSS\xff\xff", 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?201310021235.r92CZ3Ge045448>