Source-Changes-HG archive

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

[src/netbsd-2-0]: src/sys/netinet Pull up revision 1.66 (requested by tron in...



details:   https://anonhg.NetBSD.org/src/rev/914636249ba4
branches:  netbsd-2-0
changeset: 561466:914636249ba4
user:      grant <grant%NetBSD.org@localhost>
date:      Fri Jun 18 10:09:54 2004 +0000

description:
Pull up revision 1.66 (requested by tron in ticket #502):

Correct two errors in fr_check():
1.) Make sure that "pass" is always initialized.
2.) Make sure the code doesn't use a stale mbuf pointer after fr_makefrip()
    has been called. This fixes PR kern/25868.

diffstat:

 sys/netinet/fil.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (54 lines):

diff -r cf3f62877d01 -r 914636249ba4 sys/netinet/fil.c
--- a/sys/netinet/fil.c Fri Jun 18 10:08:47 2004 +0000
+++ b/sys/netinet/fil.c Fri Jun 18 10:09:54 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fil.c,v 1.61.2.4 2004/05/30 11:26:27 tron Exp $        */
+/*     $NetBSD: fil.c,v 1.61.2.5 2004/06/18 10:09:54 grant Exp $       */
 
 /*
  * Copyright (C) 1993-2003 by Darren Reed.
@@ -135,7 +135,7 @@
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.61.2.4 2004/05/30 11:26:27 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.61.2.5 2004/06/18 10:09:54 grant 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 2.243.2.7 2004/03/23 12:06:56 darrenr Exp";
@@ -2067,7 +2067,7 @@
        int v = IP_V(ip), len, p;
        frentry_t *fr = NULL;
        mb_t *mc = NULL;
-       u_32_t pass;
+       u_32_t pass = fr_pass;
        mb_t *m;
 
        /*
@@ -2308,8 +2308,6 @@
                ATOMIC_INCL(frstats[out].fr_short);
        }
 
-       pass = fr_pass;
-
        READ_ENTER(&ipf_mutex);
 
        /*
@@ -2374,7 +2372,7 @@
         * to send the packet.
         */
        if ((fr != NULL) && (pass & FR_DUP)) {
-               mc = M_DUPLICATE(m);
+               mc = M_DUPLICATE(fin->fin_m);
        }
 
        if (pass & (FR_RETRST|FR_RETICMP)) {
@@ -2418,6 +2416,8 @@
 #if defined(USE_INET6) || (defined(__sgi) && defined(_KERNEL))
 filtered:
 #endif
+       m = fin->fin_m;
+
        if (FR_ISPASS(pass)) {
                ATOMIC_INCL(frstats[out].fr_pass);
        } else if (FR_ISBLOCK(pass)) {



Home | Main Index | Thread Index | Old Index