aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2014-10-05 03:41:47 +0000
committerCy Schubert <cy@FreeBSD.org>2014-10-05 03:41:47 +0000
commit7db9f2ba58c614492e20403af329a7aaaf707c53 (patch)
treea73d0ddf61ff0881a01fce379dd7321104edcac1 /sys/contrib
parent6e5254e0d70b8c7e4bbfaca0640b962937d2c41c (diff)
downloadsrc-7db9f2ba58c614492e20403af329a7aaaf707c53.tar.gz
src-7db9f2ba58c614492e20403af329a7aaaf707c53.zip
ipfiler bug #550 filter rule list corrupted with inserted rules
Obtained from: ipfilter CVS repo (r1.128); NetBSD CVS repo (r1.15)
Notes
Notes: svn path=/head/; revision=272551
Diffstat (limited to 'sys/contrib')
-rw-r--r--sys/contrib/ipfilter/netinet/fil.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/contrib/ipfilter/netinet/fil.c b/sys/contrib/ipfilter/netinet/fil.c
index 2adfe26bdd23..f600092d015d 100644
--- a/sys/contrib/ipfilter/netinet/fil.c
+++ b/sys/contrib/ipfilter/netinet/fil.c
@@ -4496,7 +4496,15 @@ frrequest(softc, unit, req, data, set, makecopy)
fp = f;
f = NULL;
+ fp->fr_next = NULL;
fp->fr_dnext = NULL;
+ fp->fr_pnext = NULL;
+ fp->fr_pdnext = NULL;
+ fp->fr_grp = NULL;
+ fp->fr_grphead = NULL;
+ fp->fr_icmpgrp = NULL;
+ fp->fr_isc = (void *)-1;
+ fp->fr_ptr = NULL;
fp->fr_ref = 0;
fp->fr_flags |= FR_COPIED;
} else {
@@ -5000,7 +5008,9 @@ frrequest(softc, unit, req, data, set, makecopy)
if (f->fr_collect > fp->fr_collect)
break;
ftail = &f->fr_next;
+ fprev = ftail;
}
+ ftail = fprev;
f = NULL;
ptr = NULL;
} else if (req == (ioctlcmd_t)SIOCINAFR ||
@@ -5091,6 +5101,8 @@ frrequest(softc, unit, req, data, set, makecopy)
fp->fr_ref = 1;
fp->fr_pnext = ftail;
fp->fr_next = *ftail;
+ if (fp->fr_next != NULL)
+ fp->fr_next->fr_pnext = &fp->fr_next;
*ftail = fp;
if (addrem == 0)
ipf_fixskip(ftail, fp, 1);