Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Aug 2019 02:42:48 +0000 (UTC)
From:      Cy Schubert <cy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r350882 - head/sys/contrib/ipfilter/netinet
Message-ID:  <201908120242.x7C2gmpg081122@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cy
Date: Mon Aug 12 02:42:47 2019
New Revision: 350882
URL: https://svnweb.freebsd.org/changeset/base/350882

Log:
  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.
  
  MFC after:	3 days

Modified:
  head/sys/contrib/ipfilter/netinet/fil.c

Modified: head/sys/contrib/ipfilter/netinet/fil.c
==============================================================================
--- head/sys/contrib/ipfilter/netinet/fil.c	Sun Aug 11 23:54:52 2019	(r350881)
+++ head/sys/contrib/ipfilter/netinet/fil.c	Mon Aug 12 02:42:47 2019	(r350882)
@@ -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?201908120242.x7C2gmpg081122>