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
This commit is contained in:
Cy Schubert 2019-08-12 02:42:47 +00:00
parent fa99b3234a
commit 263a6508a3

View File

@ -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);