From 263a6508a3c59d18121143dec2ddc00e38db5300 Mon Sep 17 00:00:00 2001 From: Cy Schubert Date: Mon, 12 Aug 2019 02:42:47 +0000 Subject: 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 --- sys/contrib/ipfilter/netinet/fil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/contrib/ipfilter/netinet') diff --git a/sys/contrib/ipfilter/netinet/fil.c b/sys/contrib/ipfilter/netinet/fil.c index 7ccaa1caaad5..415db0fcadcf 100644 --- a/sys/contrib/ipfilter/netinet/fil.c +++ b/sys/contrib/ipfilter/netinet/fil.c @@ -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); -- cgit v1.2.3