Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Dec 2016 21:52:11 +0000 (UTC)
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r309563 - head/sys/netpfil/pf
Message-ID:  <201612052152.uB5LqBPm009524@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kp
Date: Mon Dec  5 21:52:10 2016
New Revision: 309563
URL: https://svnweb.freebsd.org/changeset/base/309563

Log:
  pflog: Correctly initialise subrulenr
  
  subrulenr is considered unset if it's set to -1, not if it's set to 1.
  See contrib/tcpdump/print-pflog.c pflog_print() for a user.
  
  This caused incorrect pflog output (tcpdump -n -e -ttt -i pflog0):
    rule 0..16777216(match)
  instead of the correct output of
    rule 0/0(match)
  
  PR:		214832
  Submitted by:	andywhite@gmail.com

Modified:
  head/sys/netpfil/pf/if_pflog.c

Modified: head/sys/netpfil/pf/if_pflog.c
==============================================================================
--- head/sys/netpfil/pf/if_pflog.c	Mon Dec  5 21:24:38 2016	(r309562)
+++ head/sys/netpfil/pf/if_pflog.c	Mon Dec  5 21:52:10 2016	(r309563)
@@ -221,7 +221,7 @@ pflog_packet(struct pfi_kif *kif, struct
 
 	if (am == NULL) {
 		hdr.rulenr = htonl(rm->nr);
-		hdr.subrulenr =  1;
+		hdr.subrulenr = -1;
 	} else {
 		hdr.rulenr = htonl(am->nr);
 		hdr.subrulenr = htonl(rm->nr);



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