Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/ipf/netinet Darren Reed: #550 filter rule l...



details:   https://anonhg.NetBSD.org/src/rev/70b6f3c9a306
branches:  trunk
changeset: 329990:70b6f3c9a306
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jun 16 12:38:32 2014 +0000

description:
Darren Reed: #550 filter rule list corrupted with inserted rules

diffstat:

 sys/external/bsd/ipf/netinet/fil.c |  18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diffs (62 lines):

diff -r 6a9c36b92979 -r 70b6f3c9a306 sys/external/bsd/ipf/netinet/fil.c
--- a/sys/external/bsd/ipf/netinet/fil.c        Mon Jun 16 12:37:58 2014 +0000
+++ b/sys/external/bsd/ipf/netinet/fil.c        Mon Jun 16 12:38:32 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fil.c,v 1.14 2014/03/20 20:43:12 christos Exp $        */
+/*     $NetBSD: fil.c,v 1.15 2014/06/16 12:38:32 christos Exp $        */
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -138,7 +138,7 @@
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.14 2014/03/20 20:43:12 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.15 2014/06/16 12:38:32 christos Exp $");
 #else
 static const char sccsid[] = "@(#)fil.c        1.36 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: fil.c,v 1.1.1.2 2012/07/22 13:45:07 darrenr Exp $";
@@ -3787,6 +3787,8 @@
        }
        return s;
 }
+
+
 /* ------------------------------------------------------------------------ */
 /* Function:    ipf_fixskip                                                 */
 /* Returns:     Nil                                                         */
@@ -4357,7 +4359,15 @@
 
                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 {
@@ -4860,7 +4870,9 @@
                                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 ||
@@ -4951,6 +4963,8 @@
                        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);



Home | Main Index | Thread Index | Old Index