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/5c02e2574223
branches:  trunk
changeset: 487729:5c02e2574223
user:      veego <veego%NetBSD.org@localhost>
date:      Mon Jun 12 10:28:20 2000 +0000

description:
Resolve conflicts.

diffstat:

 sys/netinet/fil.c     |  18 ++++++++----------
 sys/netinet/ip_fil.c  |  19 ++++++++++++++++---
 sys/netinet/ip_fil.h  |  10 ++++------
 sys/netinet/ip_frag.c |  11 +++++++++--
 sys/netinet/ip_nat.c  |  32 ++++++++++++++++++++++----------
 sys/netinet/ip_nat.h  |  13 ++++++++-----
 sys/netinet/ipl.h     |   6 +++---
 7 files changed, 70 insertions(+), 39 deletions(-)

diffs (truncated from 329 to 300 lines):

diff -r b200d243755f -r 5c02e2574223 sys/netinet/fil.c
--- a/sys/netinet/fil.c Mon Jun 12 10:21:51 2000 +0000
+++ b/sys/netinet/fil.c Mon Jun 12 10:28:20 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fil.c,v 1.35 2000/05/23 06:07:42 veego Exp $   */
+/*     $NetBSD: fil.c,v 1.36 2000/06/12 10:28:20 veego Exp $   */
 
 /*
  * Copyright (C) 1993-2000 by Darren Reed.
@@ -9,10 +9,10 @@
  */
 #if !defined(lint)
 #if defined(__NetBSD__)
-static const char rcsid[] = "$NetBSD: fil.c,v 1.35 2000/05/23 06:07:42 veego Exp $";
+static const char rcsid[] = "$NetBSD: fil.c,v 1.36 2000/06/12 10:28:20 veego 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.35.2.8 2000/05/22 10:26:09 darrenr Exp";
+static const char rcsid[] = "@(#)Id: fil.c,v 2.35.2.10 2000/06/09 14:07:47 darrenr Exp";
 #endif
 #endif
 
@@ -121,10 +121,8 @@
 # if SOLARIS
 #  define      FR_NEWAUTH(m, fi, ip, qif)      fr_newauth((mb_t *)m, fi, \
                                                           ip, qif)
-#  define      SEND_RESET(ip, qif, if, fin)    send_reset(fin, ip, qif)
 # else /* SOLARIS */
 #  define      FR_NEWAUTH(m, fi, ip, qif)      fr_newauth((mb_t *)m, fi, ip)
-#  define      SEND_RESET(ip, qif, if, fin)    send_reset(fin, ip)
 # endif /* SOLARIS || __sgi */
 #endif /* _KERNEL */
 
@@ -981,10 +979,10 @@
        if (out && (pass & FR_PASS)) {
 #ifdef USE_INET6
                if (v == 6)
-                       list = ipacct6[0][fr_active];
+                       list = ipacct6[1][fr_active];
                else
 #endif
-                       list = ipacct[0][fr_active];
+                       list = ipacct[1][fr_active];
                if ((fin->fin_fr = list) &&
                    (fr_scanlist(FR_NOMATCH, ip, fin, m) & FR_ACCOUNT)) {
                        ATOMIC_INCL(frstats[1].fr_acct);
@@ -1129,11 +1127,11 @@
 
                if (((pass & FR_FASTROUTE) && !out) ||
                    (fdp->fd_ifp && fdp->fd_ifp != (struct ifnet *)-1)) {
-                       if (ipfr_fastroute(qif, ip, m, mp, fin, fdp) == 0)
+                       if (ipfr_fastroute(ip, m, mp, fin, fdp) == 0)
                                m = *mp = NULL;
                }
                if (mc)
-                       ipfr_fastroute(qif, ip, mc, mp, fin, &fr->fr_dif);
+                       ipfr_fastroute(ip, mc, mp, fin, &fr->fr_dif);
        }
 # endif /* !SOLARIS */
        return (pass & FR_PASS) ? 0 : error;
@@ -1365,7 +1363,7 @@
  * SUCH DAMAGE.
  *
  *     @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94
- * Id: fil.c,v 2.35.2.8 2000/05/22 10:26:09 darrenr Exp
+ * Id: fil.c,v 2.35.2.10 2000/06/09 14:07:47 darrenr Exp
  */
 /*
  * Copy data from an mbuf chain starting "off" bytes from the beginning,
diff -r b200d243755f -r 5c02e2574223 sys/netinet/ip_fil.c
--- a/sys/netinet/ip_fil.c      Mon Jun 12 10:21:51 2000 +0000
+++ b/sys/netinet/ip_fil.c      Mon Jun 12 10:28:20 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_fil.c,v 1.53 2000/05/23 06:07:43 veego Exp $        */
+/*     $NetBSD: ip_fil.c,v 1.54 2000/06/12 10:28:21 veego Exp $        */
 
 /*
  * Copyright (C) 1993-2000 by Darren Reed.
@@ -9,10 +9,10 @@
  */
 #if !defined(lint)
 #if defined(__NetBSD__)
-static const char rcsid[] = "$NetBSD: ip_fil.c,v 1.53 2000/05/23 06:07:43 veego Exp $";
+static const char rcsid[] = "$NetBSD: ip_fil.c,v 1.54 2000/06/12 10:28:21 veego Exp $";
 #else
 static const char sccsid[] = "@(#)ip_fil.c     2.41 6/5/96 (C) 1993-2000 Darren Reed";
-static const char rcsid[] = "@(#)Id: ip_fil.c,v 2.42.2.9 2000/05/22 12:48:28 darrenr Exp";
+static const char rcsid[] = "@(#)Id: ip_fil.c,v 2.42.2.10 2000/05/25 20:16:44 darrenr Exp";
 #endif
 #endif
 
@@ -1115,6 +1115,19 @@
        m = NULL;
        ifp = fin->fin_ifp;
        if (fin->fin_v == 4) {
+               if ((oip->ip_p == IPPROTO_ICMP) &&
+                   !(fin->fin_fi.fi_fl & FI_SHORT))
+                       switch (ntohs(fin->fin_data[0]) >> 8)
+                       {
+                       case ICMP_ECHO :
+                       case ICMP_TSTAMP :
+                       case ICMP_IREQ :
+                       case ICMP_MASKREQ :
+                               break;
+                       default :
+                               return 0;
+                       }
+
 # if   (BSD < 199306) || defined(__sgi)
                avail = MLEN;
                m = m_get(M_DONTWAIT, MT_HEADER);
diff -r b200d243755f -r 5c02e2574223 sys/netinet/ip_fil.h
--- a/sys/netinet/ip_fil.h      Mon Jun 12 10:21:51 2000 +0000
+++ b/sys/netinet/ip_fil.h      Mon Jun 12 10:28:20 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_fil.h,v 1.36 2000/05/23 06:07:43 veego Exp $        */
+/*     $NetBSD: ip_fil.h,v 1.37 2000/06/12 10:28:21 veego Exp $        */
 
 /*
  * Copyright (C) 1993-2000 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.29.2.2 2000/05/22 10:26:13 darrenr Exp
+ * Id: ip_fil.h,v 2.29.2.3 2000/06/05 13:12:42 darrenr Exp
  */
 
 #ifndef _NETINET_IP_FIL_H_
@@ -523,8 +523,8 @@
 extern int     iplopen __P((dev_t *, int, int, cred_t *));
 extern int     iplclose __P((dev_t, int, int, cred_t *));
 extern int     ipfsync __P((void));
-extern int     ipfr_fastroute __P((qif_t *, ip_t *, mblk_t *, mblk_t **,
-                                  fr_info_t *, frdest_t *));
+extern int     ipfr_fastroute __P((ip_t *, mblk_t *, mblk_t **,
+                                   fr_info_t *, frdest_t *));
 extern void    copyin_mblk __P((mblk_t *, size_t, size_t, char *));
 extern void    copyout_mblk __P((mblk_t *, size_t, size_t, char *));
 extern int     fr_qin __P((queue_t *, mblk_t *));
@@ -533,8 +533,6 @@
 # else /* SOLARIS */
 extern int     fr_check __P((ip_t *, int, void *, int, mb_t **));
 extern int     (*fr_checkp) __P((ip_t *, int, void *, int, mb_t **));
-extern int     send_reset __P((struct ip *, fr_info_t *));
-extern int     send_icmp_err __P((ip_t *, int, fr_info_t *, int));
 extern int     ipfr_fastroute __P((mb_t *, fr_info_t *, frdest_t *));
 extern size_t  mbufchainlen __P((mb_t *));
 #  ifdef       __sgi
diff -r b200d243755f -r 5c02e2574223 sys/netinet/ip_frag.c
--- a/sys/netinet/ip_frag.c     Mon Jun 12 10:21:51 2000 +0000
+++ b/sys/netinet/ip_frag.c     Mon Jun 12 10:28:20 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_frag.c,v 1.19 2000/05/11 19:46:06 veego Exp $       */
+/*     $NetBSD: ip_frag.c,v 1.20 2000/06/12 10:28:21 veego Exp $       */
 
 /*
  * Copyright (C) 1993-2000 by Darren Reed.
@@ -9,11 +9,15 @@
  */
 #if !defined(lint)
 #if defined(__NetBSD__)
-static const char rcsid[] = "$NetBSD: ip_frag.c,v 1.19 2000/05/11 19:46:06 veego Exp $";
+static const char rcsid[] = "$NetBSD: ip_frag.c,v 1.20 2000/06/12 10:28:21 veego Exp $";
 #else
 static const char sccsid[] = "@(#)ip_frag.c    1.11 3/24/96 (C) 1993-2000 Darren Reed";
+<<<<<<< ip_frag.c
 static const char rcsid[] = "@(#)Id: ip_frag.c,v 2.10.2.3 2000/05/05 15:10:23 darrenr Exp";
 #endif
+=======
+static const char rcsid[] = "@(#)Id: ip_frag.c,v 2.10.2.4 2000/06/06 15:49:15 darrenr Exp";
+>>>>>>> 1.1.1.15
 #endif
 
 #if defined(__FreeBSD__) && defined(KERNEL) && !defined(_KERNEL)
@@ -150,6 +154,9 @@
        ipfr_t  **fp, *fra, frag;
        u_int   idx;
 
+       if (ipfr_inuse >= IPFT_SIZE)
+               return NULL;
+
        frag.ipfr_p = ip->ip_p;
        idx = ip->ip_p;
        frag.ipfr_id = ip->ip_id;
diff -r b200d243755f -r 5c02e2574223 sys/netinet/ip_nat.c
--- a/sys/netinet/ip_nat.c      Mon Jun 12 10:21:51 2000 +0000
+++ b/sys/netinet/ip_nat.c      Mon Jun 12 10:28:20 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_nat.c,v 1.33 2000/05/21 18:45:54 veego Exp $        */
+/*     $NetBSD: ip_nat.c,v 1.34 2000/06/12 10:28:21 veego Exp $        */
 
 /*
  * Copyright (C) 1995-2000 by Darren Reed.
@@ -11,10 +11,10 @@
  */
 #if !defined(lint)
 #if defined(__NetBSD__)
-static const char rcsid[] = "$NetBSD: ip_nat.c,v 1.33 2000/05/21 18:45:54 veego Exp $";
+static const char rcsid[] = "$NetBSD: ip_nat.c,v 1.34 2000/06/12 10:28:21 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.37.2.10 2000/05/19 15:54:44 darrenr Exp";
+static const char rcsid[] = "@(#)Id: ip_nat.c,v 2.37.2.13 2000/06/10 15:52:22 darrenr Exp";
 #endif
 #endif
 
@@ -475,10 +475,14 @@
                n->in_next = NULL;
                *np = n;
 
-               if (n->in_redir & NAT_REDIRECT)
+               if (n->in_redir & NAT_REDIRECT) {
+                       n->in_flags &= ~IPN_NOTDST;
                        nat_addrdr(n);
-               if (n->in_redir & (NAT_MAP|NAT_MAPBLK))
+               }
+               if (n->in_redir & (NAT_MAP|NAT_MAPBLK)) {
+                       n->in_flags &= ~IPN_NOTSRC;
                        nat_addnat(n);
+               }
 
                n->in_use = 0;
                if (n->in_redir & NAT_MAPBLK)
@@ -1716,14 +1720,22 @@
        if (np->in_p && ip->ip_p != np->in_p)
                return 0;
        if (fin->fin_out) {
-               if (!(np->in_redir && (NAT_MAP|NAT_MAPBLK)))
+               if (!(np->in_redir & (NAT_MAP|NAT_MAPBLK)))
                        return 0;
-               if ((fin->fin_fi.fi_saddr & np->in_inmsk) != np->in_inip)
+               if (((fin->fin_fi.fi_saddr & np->in_inmsk) != np->in_inip)
+                   ^ ((np->in_flags & IPN_NOTSRC) != 0))
                        return 0;
-               if ((fin->fin_fi.fi_daddr & np->in_srcmsk) != np->in_srcip)
+               if (((fin->fin_fi.fi_daddr & np->in_srcmsk) != np->in_srcip)
+                   ^ ((np->in_flags & IPN_NOTDST) != 0))
                        return 0;
        } else {
-               if (!(np->in_redir && NAT_REDIRECT))
+               if (!(np->in_redir & NAT_REDIRECT))
+                       return 0;
+               if (((fin->fin_fi.fi_saddr & np->in_srcmsk) != np->in_srcip)
+                   ^ ((np->in_flags & IPN_NOTSRC) != 0))
+                       return 0;
+               if (((fin->fin_fi.fi_daddr & np->in_outmsk) != np->in_outip)
+                   ^ ((np->in_flags & IPN_NOTDST) != 0))
                        return 0;
        }
 
@@ -2026,7 +2038,7 @@
                        } else if ((in.s_addr & np->in_outmsk) != np->in_outip)
                                continue;
                        if ((np->in_redir & NAT_REDIRECT) &&
-                           (!np->in_pmin ||
+                           (!np->in_pmin || (np->in_flags & IPN_FILTER) ||
                             ((ntohs(np->in_pmax) >= ntohs(dport)) &&
                              (ntohs(dport) >= ntohs(np->in_pmin)))))
                                if ((nat = nat_new(np, ip, fin, nflags,
diff -r b200d243755f -r 5c02e2574223 sys/netinet/ip_nat.h
--- a/sys/netinet/ip_nat.h      Mon Jun 12 10:21:51 2000 +0000
+++ b/sys/netinet/ip_nat.h      Mon Jun 12 10:28:20 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_nat.h,v 1.19 2000/05/21 18:45:55 veego Exp $        */
+/*     $NetBSD: ip_nat.h,v 1.20 2000/06/12 10:28:22 veego Exp $        */
 
 /*
  * Copyright (C) 1995-2000 by Darren Reed.
@@ -8,7 +8,7 @@
  * to the original author and the contributors.
  *
  * @(#)ip_nat.h        1.5 2/4/96
- * Id: ip_nat.h,v 2.17.2.1 2000/05/15 06:50:14 darrenr Exp
+ * Id: ip_nat.h,v 2.17.2.3 2000/06/10 15:52:25 darrenr Exp
  */
 
 #ifndef _NETINET_IP_NAT_H_
@@ -107,8 +107,9 @@
        u_short in_pnext;
        u_short in_ppip;        /* ports per IP */
        u_short in_ippip;       /* IP #'s per IP# */
-       u_short in_flags;       /* From here to in_dport must be reflected */
        u_short in_port[2];     /* correctly in IPN_CMPSIZ */
+       u_short in_spare;
+       u_32_t  in_flags;       /* From here to in_dport must be reflected */
        struct  in_addr in_in[2];
        struct  in_addr in_out[2];
        struct  in_addr in_src[2];
@@ -214,11 +215,13 @@
 #define        IPN_RF          (IPN_TCPUDP|IPN_DELETE|IPN_ICMPERR)
 #define        IPN_AUTOPORTMAP 0x010
 #define        IPN_IPRANGE     0x020
-#define        IPN_USERFLAGS   (IPN_TCPUDP|IPN_AUTOPORTMAP|IPN_IPRANGE|\
-                        IPN_SPLIT|IPN_ROUNDR|IPN_FILTER)
+#define        IPN_USERFLAGS   (IPN_TCPUDP|IPN_AUTOPORTMAP|IPN_IPRANGE|IPN_SPLIT|\
+                        IPN_ROUNDR|IPN_FILTER|IPN_NOTSRC|IPN_NOTDST)
 #define        IPN_FILTER      0x040
 #define        IPN_SPLIT       0x080
 #define        IPN_ROUNDR      0x100



Home | Main Index | Thread Index | Old Index