Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Sep 2019 19:14:01 +0000 (UTC)
From:      Cy Schubert <cy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r351775 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet
Message-ID:  <201909031914.x83JE1xZ051100@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cy
Date: Tue Sep  3 19:14:00 2019
New Revision: 351775
URL: https://svnweb.freebsd.org/changeset/base/351775

Log:
  MFC r350882:
  
  Initialize the frentry (the control block that defines a rule) checksum
  to zero. Matching checksums save time and effort by mitigating the need
  for full rule compare.

Modified:
  stable/11/sys/contrib/ipfilter/netinet/fil.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/sys/contrib/ipfilter/netinet/fil.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c
==============================================================================
--- stable/11/sys/contrib/ipfilter/netinet/fil.c	Tue Sep  3 18:58:48 2019	(r351774)
+++ stable/11/sys/contrib/ipfilter/netinet/fil.c	Tue Sep  3 19:14:00 2019	(r351775)
@@ -4973,7 +4973,7 @@ frrequest(softc, unit, req, data, set, makecopy)
 	 * (this meaning no pointers are included).
 	 */
 	pp = (u_int *)(fp->fr_caddr + fp->fr_dsize);
-	for (p = (u_int *)fp->fr_data; p < pp; p++)
+	for (fp->fr_cksum = 0, p = (u_int *)fp->fr_data; p < pp; p++)
 		fp->fr_cksum += *p;
 
 	WRITE_ENTER(&softc->ipf_mutex);



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