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.45 (requested by christo...



details:   https://anonhg.NetBSD.org/src/rev/bec503a19ba2
branches:  netbsd-2-0
changeset: 561205:bec503a19ba2
user:      tron <tron%NetBSD.org@localhost>
date:      Sun May 30 11:24:15 2004 +0000

description:
Pull up revision 1.45 (requested by christos in ticket #416):
PR/24969: Arto Selonen: /usr/sbin/ipfs from ipfilter 4.1.1 does not work
patch applied.

diffstat:

 sys/netinet/ip_state.c |  33 +++++++++++++++++++--------------
 1 files changed, 19 insertions(+), 14 deletions(-)

diffs (72 lines):

diff -r 05c326333ab9 -r bec503a19ba2 sys/netinet/ip_state.c
--- a/sys/netinet/ip_state.c    Sun May 30 11:23:29 2004 +0000
+++ b/sys/netinet/ip_state.c    Sun May 30 11:24:15 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_state.c,v 1.44 2004/03/28 09:00:57 martti Exp $     */
+/*     $NetBSD: ip_state.c,v 1.44.2.1 2004/05/30 11:24:15 tron Exp $   */
 
 /*
  * Copyright (C) 1995-2003 by Darren Reed.
@@ -110,7 +110,7 @@
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_state.c,v 1.44 2004/03/28 09:00:57 martti Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_state.c,v 1.44.2.1 2004/05/30 11:24:15 tron Exp $");
 #else
 static const char sccsid[] = "@(#)ip_state.c   1.8 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_state.c,v 2.186.2.4 2004/03/22 12:24:12 darrenr Exp";
@@ -545,7 +545,8 @@
        }
        ips.ips_next = isn->is_next;
        bcopy((char *)isn, (char *)&ips.ips_is, sizeof(ips.ips_is));
-       if (isn->is_rule)
+       ips.ips_rule = isn->is_rule;
+       if (isn->is_rule != NULL)
                bcopy((char *)isn->is_rule, (char *)&ips.ips_fr,
                      sizeof(ips.ips_fr));
        error = fr_outobj(data, &ips, IPFOBJ_STATESAVE);
@@ -583,9 +584,13 @@
                return ENOMEM;
 
        bcopy((char *)&ips.ips_is, (char *)isn, sizeof(*isn));
-       MUTEX_NUKE(&isn->is_lock);
+       bzero((char *)isn, offsetof(struct ipstate, is_pkts));
+       isn->is_sti.tqe_pnext = NULL;
+       isn->is_sti.tqe_next = NULL;
+       isn->is_sti.tqe_ifq = NULL;
+       isn->is_sti.tqe_parent = isn;
        isn->is_sync = NULL;
-       fr = isn->is_rule;
+       fr = ips.ips_rule;
        if (fr == NULL) {
                fr_stinsert(isn, 0);
                return 0;
@@ -2395,18 +2400,18 @@
 
 matched:
        fr = is->is_rule;
-       if ((fin->fin_out == 0) && (fr->fr_nattag.ipt_num[0] != 0)) {
-               if (fin->fin_nattag == NULL)
-                       return NULL;
-               if (fr_matchtag(&fr->fr_nattag, fin->fin_nattag) != 0)
-                       return NULL;
+       if (fr != NULL) {
+               if ((fin->fin_out == 0) && (fr->fr_nattag.ipt_num[0] != 0)) {
+                       if (fin->fin_nattag == NULL)
+                               return NULL;
+                       if (fr_matchtag(&fr->fr_nattag, fin->fin_nattag) != 0)
+                               return NULL;
+               }
+               (void) strncpy(fin->fin_group, fr->fr_group, FR_GROUPLEN);
+               fin->fin_icode = fr->fr_icode;
        }
 
        fin->fin_rule = is->is_rulen;
-       if (fr != NULL) {
-               (void) strncpy(fin->fin_group, fr->fr_group, FR_GROUPLEN);
-               fin->fin_icode = fr->fr_icode;
-       }
        pass = is->is_pass;
        fr_updatestate(fin, is, ifq);
        if (fin->fin_out == 1)



Home | Main Index | Thread Index | Old Index