Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet Resolve conflicts.



details:   https://anonhg.NetBSD.org/src/rev/149a7f1a24c3
branches:  trunk
changeset: 481544:149a7f1a24c3
user:      veego <veego%NetBSD.org@localhost>
date:      Tue Feb 01 21:29:15 2000 +0000

description:
Resolve conflicts.

diffstat:

 sys/netinet/fil.c           |  20 ++++++++++++---
 sys/netinet/ip_auth.c       |   8 +++---
 sys/netinet/ip_fil.c        |  44 ++++++++++++++++++----------------
 sys/netinet/ip_fil.h        |   7 +++--
 sys/netinet/ip_nat.c        |  19 +++++++++++---
 sys/netinet/ip_nat.h        |   5 ++-
 sys/netinet/ip_raudio_pxy.c |   2 +-
 sys/netinet/ip_state.c      |  57 ++++++++++++++++++++++++++++++---------------
 sys/netinet/ip_state.h      |   5 ++-
 sys/netinet/ipl.h           |   4 +-
 10 files changed, 109 insertions(+), 62 deletions(-)

diffs (truncated from 563 to 300 lines):

diff -r 812f8e7c8b9c -r 149a7f1a24c3 sys/netinet/fil.c
--- a/sys/netinet/fil.c Tue Feb 01 20:31:10 2000 +0000
+++ b/sys/netinet/fil.c Tue Feb 01 21:29:15 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fil.c,v 1.28 1999/12/12 11:11:15 veego Exp $   */
+/*     $NetBSD: fil.c,v 1.29 2000/02/01 21:29:15 veego Exp $   */
 
 /*
  * Copyright (C) 1993-1998 by Darren Reed.
@@ -9,10 +9,10 @@
  */
 #if !defined(lint)
 #if defined(__NetBSD__)
-static const char rcsid[] = "$NetBSD: fil.c,v 1.28 1999/12/12 11:11:15 veego Exp $";
+static const char rcsid[] = "$NetBSD: fil.c,v 1.29 2000/02/01 21:29:15 veego Exp $";
 #else
 static const char sccsid[] = "@(#)fil.c        1.36 6/5/96 (C) 1993-1996 Darren Reed";
-static const char rcsid[] = "@(#)Id: fil.c,v 2.3.2.14 1999/12/07 12:53:40 darrenr Exp";
+static const char rcsid[] = "@(#)Id: fil.c,v 2.3.2.16 2000/01/27 08:49:37 darrenr Exp";
 #endif
 #endif
 
@@ -247,6 +247,12 @@
                if (!off && (icmp->icmp_type == ICMP_ECHOREPLY ||
                     icmp->icmp_type == ICMP_ECHO))
                        minicmpsz = ICMP_MINLEN;
+               if (!off && (icmp->icmp_type == ICMP_TSTAMP ||
+                    icmp->icmp_type == ICMP_TSTAMPREPLY))
+                       minicmpsz = 20; /* type(1) + code(1) + cksum(2) + id(2) + seq(2) + 3*timestamp(3*4) */
+               if (!off && (icmp->icmp_type == ICMP_MASKREQ ||
+                    icmp->icmp_type == ICMP_MASKREPLY))
+                       minicmpsz = 12; /* type(1) + code(1) + cksum(2) + id(2) + seq(2) + mask(4) */
                if ((!(ip->ip_len >= hlen + minicmpsz) && !off) ||
                    (off && off < sizeof(struct icmp)))
                        fi->fi_fl |= FI_SHORT;
@@ -690,6 +696,9 @@
 
        READ_ENTER(&ipf_mutex);
 
+       if (fin->fin_fi.fi_fl & FI_SHORT)
+               ATOMIC_INC(frstats[out].fr_short);
+       
        /*
         * Check auth now.  This, combined with the check below to see if apass
         * is 0 is to ensure that we don't count the packet twice, which can
@@ -1180,7 +1189,7 @@
  * SUCH DAMAGE.
  *
  *     @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94
- * Id: fil.c,v 2.3.2.14 1999/12/07 12:53:40 darrenr Exp
+ * Id: fil.c,v 2.3.2.16 2000/01/27 08:49:37 darrenr Exp
  */
 /*
  * Copy data from an mbuf chain starting "off" bytes from the beginning,
@@ -1581,7 +1590,10 @@
 #  else
        for (ifp = ifnet; ifp; ifp = ifp->if_next)
 #  endif
+       {
                ip_natsync(ifp);
+               ip_statesync(ifp);
+       }
 # endif
 
        WRITE_ENTER(&ipf_mutex);
diff -r 812f8e7c8b9c -r 149a7f1a24c3 sys/netinet/ip_auth.c
--- a/sys/netinet/ip_auth.c     Tue Feb 01 20:31:10 2000 +0000
+++ b/sys/netinet/ip_auth.c     Tue Feb 01 21:29:15 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_auth.c,v 1.12 1999/12/12 11:11:15 veego Exp $       */
+/*     $NetBSD: ip_auth.c,v 1.13 2000/02/01 21:29:15 veego Exp $       */
 
 /*
  * Copyright (C) 1998 by Darren Reed & Guido van Rooij.
@@ -9,9 +9,9 @@
  */
 #if !defined(lint)
 #if defined(__NetBSD__)
-static const char rcsid[] = "$NetBSD: ip_auth.c,v 1.12 1999/12/12 11:11:15 veego Exp $";
+static const char rcsid[] = "$NetBSD: ip_auth.c,v 1.13 2000/02/01 21:29:15 veego Exp $";
 #else
-static const char rcsid[] = "@(#)Id: ip_auth.c,v 2.1.2.1 1999/09/28 11:44:04 darrenr Exp ";
+static const char rcsid[] = "@(#)Id: ip_auth.c,v 2.1.2.2 2000/01/16 10:12:14 darrenr Exp";
 #endif
 #endif
 
@@ -402,7 +402,7 @@
 #  if SOLARIS
                        error = fr_qout(fr_auth[i].fra_q, m);
 #  else /* SOLARIS */
-#   if _BSDI_VERSION >= 199802
+#   if (_BSDI_VERSION >= 199802) || defined(__OpenBSD__)
                        error = ip_output(m, NULL, NULL, IP_FORWARDING, NULL,
                                          NULL);
 #   else
diff -r 812f8e7c8b9c -r 149a7f1a24c3 sys/netinet/ip_fil.c
--- a/sys/netinet/ip_fil.c      Tue Feb 01 20:31:10 2000 +0000
+++ b/sys/netinet/ip_fil.c      Tue Feb 01 21:29:15 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_fil.c,v 1.38 1999/12/12 11:11:16 veego Exp $        */
+/*     $NetBSD: ip_fil.c,v 1.39 2000/02/01 21:29:15 veego Exp $        */
 
 /*
  * Copyright (C) 1993-1998 by Darren Reed.
@@ -9,10 +9,10 @@
  */
 #if !defined(lint)
 #if defined(__NetBSD__)
-static const char rcsid[] = "$NetBSD: ip_fil.c,v 1.38 1999/12/12 11:11:16 veego Exp $";
+static const char rcsid[] = "$NetBSD: ip_fil.c,v 1.39 2000/02/01 21:29:15 veego Exp $";
 #else
 static const char sccsid[] = "@(#)ip_fil.c     2.41 6/5/96 (C) 1993-1995 Darren Reed";
-static const char rcsid[] = "@(#)Id: ip_fil.c,v 2.4.2.14 1999/12/11 05:31:08 darrenr Exp";
+static const char rcsid[] = "@(#)Id: ip_fil.c,v 2.4.2.16 2000/01/16 10:12:42 darrenr Exp";
 #endif
 #endif
 
@@ -136,7 +136,6 @@
 # endif
 #endif
 
-int    ipl_inited = 0;
 int    ipl_unreach = ICMP_UNREACH_FILTER;
 u_long ipl_frouteok[2] = {0, 0};
 
@@ -247,7 +246,7 @@
 # endif
 
        SPL_NET(s);
-       if (ipl_inited || (fr_checkp == fr_check)) {
+       if (fr_running || (fr_checkp == fr_check)) {
                printf("IP Filter: already initialized\n");
                SPL_X(s);
                return EBUSY;
@@ -275,7 +274,6 @@
        }
 # endif
 
-       ipl_inited = 1;
        bzero((char *)frcache, sizeof(frcache));
        fr_savep = fr_checkp;
        fr_checkp = fr_check;
@@ -303,6 +301,7 @@
        timeout(ipfr_slowtimer, NULL, hz/2);
 # endif
 #endif
+       fr_running = 1;
        return 0;
 }
 
@@ -331,7 +330,7 @@
 # endif
 #endif
        SPL_NET(s);
-       if (!ipl_inited)
+       if (!fr_running)
        {
                printf("IP Filter: not initialized\n");
                SPL_X(s);
@@ -340,7 +339,7 @@
 
        fr_checkp = fr_savep;
        i = frflush(IPL_LOGIPF, i);
-       ipl_inited = 0;
+       fr_running = 0;
 
 # ifdef NETBSD_PF
        pfil_remove_hook((void *)fr_check, PFIL_IN|PFIL_OUT);
@@ -433,11 +432,15 @@
        SPL_NET(s);
 
        if (unit == IPL_LOGNAT) {
+               if (!fr_running)
+                       return EIO;
                error = nat_ioctl(data, cmd, mode);
                SPL_X(s);
                return error;
        }
        if (unit == IPL_LOGSTATE) {
+               if (!fr_running)
+                       return EIO;
                error = fr_state_ioctl(data, cmd, mode);
                SPL_X(s);
                return error;
@@ -458,23 +461,16 @@
                        error = EPERM;
                else {
                        IRCOPY(data, (caddr_t)&enable, sizeof(enable));
-                       if (enable) {
+                       if (enable)
 # if defined(__NetBSD__)
                                error = ipl_enable();
+                       else
+                               error = ipl_disable();
 # else 
                                error = iplattach();
-# endif
-                               if (error == 0)
-                                       fr_running = 1;
-                       } else {
-# if defined(__NetBSD__)
-                               error = ipl_disable();
-# else 
+                       else
                                error = ipldetach();
 # endif
-                               if (error == 0)
-                                       fr_running = 0;
-                       }
                }
                break;
        }
@@ -731,13 +727,15 @@
        }
 
        if (!f) {
-               if (req != SIOCINAFR || req != SIOCINIFR)
+               if (req != SIOCINAFR && req != SIOCINIFR)
                        while ((f = *ftail))
                                ftail = &f->fr_next;
                else {
-                       if (fp->fr_hits)
+                       if (fp->fr_hits) {
+                               ftail = fprev;
                                while (--fp->fr_hits && (f = *ftail))
                                        ftail = &f->fr_next;
+                       }
                        f = NULL;
                }
        }
@@ -973,7 +971,11 @@
 #  if _BSDI_VERSION >= 199802
        return ip_output(m, (struct mbuf *)0, &ro, 0, 0, NULL);
 #  else
+#   if defined(__OpenBSD__)
+       return ip_output(m, (struct mbuf *)0, 0, 0, 0, NULL);
+#   else
        return ip_output(m, (struct mbuf *)0, 0, 0, 0);
+#   endif
 #  endif
 # endif
 }
diff -r 812f8e7c8b9c -r 149a7f1a24c3 sys/netinet/ip_fil.h
--- a/sys/netinet/ip_fil.h      Tue Feb 01 20:31:10 2000 +0000
+++ b/sys/netinet/ip_fil.h      Tue Feb 01 21:29:15 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_fil.h,v 1.33 1999/12/28 07:14:53 darrenr Exp $      */
+/*     $NetBSD: ip_fil.h,v 1.34 2000/02/01 21:29:15 veego Exp $        */
 
 /*
  * Copyright (C) 1993-1998 by Darren Reed.
@@ -8,7 +8,7 @@
  * to the original author and the contributors.
  *
  * @(#)ip_fil.h        1.35 6/5/96
- * Id: ip_fil.h,v 2.3.2.5 1999/12/04 02:07:00 darrenr Exp
+ * Id: ip_fil.h,v 2.3.2.7 2000/01/27 08:49:41 darrenr Exp
  */
 
 #ifndef _NETINET_IP_FIL_H_
@@ -278,6 +278,7 @@
        u_long  fr_pass;        /* packets allowed */
        u_long  fr_block;       /* packets denied */
        u_long  fr_nom;         /* packets which don't match any rule */
+       u_long  fr_short;       /* packets which are short */
        u_long  fr_ppkl;        /* packets allowed and logged */
        u_long  fr_bpkl;        /* packets denied and logged */
        u_long  fr_npkl;        /* packets unmatched and logged */
@@ -563,7 +564,7 @@
 extern int     fr_ifpaddr __P((void *, struct in_addr *));
 extern char    *memstr __P((char *, char *, int, int));
 extern int     ipl_unreach;
-extern int     ipl_inited;
+extern int     fr_running;
 extern u_long  ipl_frouteok[2];
 extern int     fr_pass;
 extern int     fr_flags;
diff -r 812f8e7c8b9c -r 149a7f1a24c3 sys/netinet/ip_nat.c
--- a/sys/netinet/ip_nat.c      Tue Feb 01 20:31:10 2000 +0000
+++ b/sys/netinet/ip_nat.c      Tue Feb 01 21:29:15 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_nat.c,v 1.27 1999/12/28 07:14:53 darrenr Exp $      */
+/*     $NetBSD: ip_nat.c,v 1.28 2000/02/01 21:29:15 veego Exp $        */
 
 /*
  * Copyright (C) 1995-1998 by Darren Reed.
@@ -11,10 +11,10 @@
  */
 #if !defined(lint)
 #if defined(__NetBSD__)
-static const char rcsid[] = "$NetBSD: ip_nat.c,v 1.27 1999/12/28 07:14:53 darrenr Exp $";
+static const char rcsid[] = "$NetBSD: ip_nat.c,v 1.28 2000/02/01 21:29:15 veego Exp $";
 #else
 static const char sccsid[] = "@(#)ip_nat.c     1.11 6/5/96 (C) 1995 Darren Reed";
-static const char rcsid[] = "@(#)Id: ip_nat.c,v 2.2.2.10 1999/12/07 12:53:42 darrenr Exp";
+static const char rcsid[] = "@(#)Id: ip_nat.c,v 2.2.2.12 2000/01/24 12:43:40 darrenr Exp";
 #endif
 #endif
 
@@ -728,12 +728,22 @@



Home | Main Index | Thread Index | Old Index