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 and fix a compile error in ip_...



details:   https://anonhg.NetBSD.org/src/rev/87c66bb743d3
branches:  trunk
changeset: 486037:87c66bb743d3
user:      veego <veego%NetBSD.org@localhost>
date:      Thu May 11 19:46:05 2000 +0000

description:
Resolve conflicts and fix a compile error in ip_ftp_pxy.c.

diffstat:

 sys/netinet/fil.c           |   12 +-
 sys/netinet/ip_fil.c        |   48 ++-
 sys/netinet/ip_frag.c       |   26 +-
 sys/netinet/ip_ftp_pxy.c    |  626 ++++++++++++++++++++++++++-----------------
 sys/netinet/ip_nat.c        |   36 +-
 sys/netinet/ip_proxy.c      |   17 +-
 sys/netinet/ip_proxy.h      |   21 +-
 sys/netinet/ip_raudio_pxy.c |   15 +-
 sys/netinet/ip_rcmd_pxy.c   |   10 +-
 sys/netinet/ipl.h           |    6 +-
 10 files changed, 498 insertions(+), 319 deletions(-)

diffs (truncated from 1389 to 300 lines):

diff -r 15b5ffd47c25 -r 87c66bb743d3 sys/netinet/fil.c
--- a/sys/netinet/fil.c Thu May 11 19:35:03 2000 +0000
+++ b/sys/netinet/fil.c Thu May 11 19:46:05 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fil.c,v 1.32 2000/05/10 00:08:03 itojun Exp $  */
+/*     $NetBSD: fil.c,v 1.33 2000/05/11 19:46:05 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.32 2000/05/10 00:08:03 itojun Exp $";
+static const char rcsid[] = "$NetBSD: fil.c,v 1.33 2000/05/11 19:46:05 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.4 2000/04/28 15:38:32 darrenr Exp";
+static const char rcsid[] = "@(#)Id: fil.c,v 2.35.2.6 2000/05/09 22:42:40 darrenr Exp";
 #endif
 #endif
 
@@ -1074,6 +1074,10 @@
         * Once we're finished return to our caller, freeing the packet if
         * we are dropping it (* BSD ONLY *).
         */
+       if ((changed == -1) && (pass & FR_PASS)) {
+               pass &= ~FR_PASS;
+               pass |= FR_BLOCK;
+       }
 #if defined(_KERNEL)
 # if !SOLARIS
 #  if !defined(linux)
@@ -1337,7 +1341,7 @@
  * SUCH DAMAGE.
  *
  *     @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94
- * Id: fil.c,v 2.35.2.4 2000/04/28 15:38:32 darrenr Exp
+ * Id: fil.c,v 2.35.2.6 2000/05/09 22:42:40 darrenr Exp
  */
 /*
  * Copy data from an mbuf chain starting "off" bytes from the beginning,
diff -r 15b5ffd47c25 -r 87c66bb743d3 sys/netinet/ip_fil.c
--- a/sys/netinet/ip_fil.c      Thu May 11 19:35:03 2000 +0000
+++ b/sys/netinet/ip_fil.c      Thu May 11 19:46:05 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_fil.c,v 1.49 2000/05/03 11:12:06 veego Exp $        */
+/*     $NetBSD: ip_fil.c,v 1.50 2000/05/11 19:46:05 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.49 2000/05/03 11:12:06 veego Exp $";
+static const char rcsid[] = "$NetBSD: ip_fil.c,v 1.50 2000/05/11 19:46:05 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.2 2000/04/28 14:56:50 darrenr Exp";
+static const char rcsid[] = "@(#)Id: ip_fil.c,v 2.42.2.4 2000/05/09 22:43:31 darrenr Exp";
 #endif
 #endif
 
@@ -177,6 +177,10 @@
 #if (__FreeBSD_version >= 300000) && defined(_KERNEL)
 struct callout_handle ipfr_slowtimer_ch;
 #endif
+#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104230000)
+# include <sys/callout.h>
+struct callout ipfr_slowtimer_ch;
+#endif
 
 #if (_BSDI_VERSION >= 199510) && defined(_KERNEL)
 # include <sys/device.h>
@@ -326,13 +330,13 @@
 # else
                "disabled");
 # endif
-#ifdef _KERNEL
-# if (__FreeBSD_version >= 300000) && defined(_KERNEL)
-       ipfr_slowtimer_ch = timeout(ipfr_slowtimer, NULL, hz/2);
-# else
-#  if defined(__NetBSD__)
+#ifdef  _KERNEL
+# if defined(__NetBSD__) && (__NetBSD_Version__ >= 104230000)
        callout_init(&ipfr_slowtimer_ch);
        callout_reset(&ipfr_slowtimer_ch, hz / 2, ipfr_slowtimer, NULL);
+# else
+#  if (__FreeBSD_version >= 300000) && defined(_KERNEL)
+       ipfr_slowtimer_ch = timeout(ipfr_slowtimer, NULL, hz/2);
 #  else
        timeout(ipfr_slowtimer, NULL, hz/2);
 #  endif
@@ -357,20 +361,20 @@
        int error = 0;
 #endif
 
-#ifdef _KERNEL
-# if (__FreeBSD_version >= 300000)
+#ifdef  _KERNEL
+# if defined(__NetBSD__) && (__NetBSD_Version__ >= 104230000)
+       callout_stop(&ipfr_slowtimer_ch);
+# else
+#  if (__FreeBSD_version >= 300000)
        untimeout(ipfr_slowtimer, NULL, ipfr_slowtimer_ch);
-# else
+#  else
 #  ifdef __sgi
        untimeout(ipfr_slowtimer);
-#  else
-#   ifdef __NetBSD__
-       callout_stop(&ipfr_slowtimer_ch);
 #   else
        untimeout(ipfr_slowtimer, NULL);
 #   endif
-#  endif
-# endif
+#  endif /* FreeBSD */
+# endif /* NetBSD */
 #endif
        SPL_NET(s);
        if (!fr_running)
@@ -1383,9 +1387,12 @@
         * If small enough for interface, can just send directly.
         */
        if (ip->ip_len <= ifp->if_mtu) {
-#  ifndef __NetBSD__
+# if   BSD >= 199306
+               int i = m->m_flags & M_EXT;
+# endif
+# ifndef __NetBSD__
                ip->ip_id = htons(ip->ip_id);
-#  endif
+# endif
                ip->ip_len = htons(ip->ip_len);
                ip->ip_off = htons(ip->ip_off);
                if (!ip->ip_sum)
@@ -1393,6 +1400,11 @@
 # if   BSD >= 199306
                error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst,
                                          ro->ro_rt);
+               if (i) {
+                       ip->ip_id = ntohs(ip->ip_id);
+                       ip->ip_len = ntohs(ip->ip_len);
+                       ip->ip_off = ntohs(ip->ip_off);
+               }
 # else
                error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst);
 # endif
diff -r 15b5ffd47c25 -r 87c66bb743d3 sys/netinet/ip_frag.c
--- a/sys/netinet/ip_frag.c     Thu May 11 19:35:03 2000 +0000
+++ b/sys/netinet/ip_frag.c     Thu May 11 19:46:05 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_frag.c,v 1.18 2000/05/03 11:12:07 veego Exp $       */
+/*     $NetBSD: ip_frag.c,v 1.19 2000/05/11 19:46:06 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_frag.c,v 1.18 2000/05/03 11:12:07 veego Exp $";
+static const char rcsid[] = "$NetBSD: ip_frag.c,v 1.19 2000/05/11 19:46:06 veego Exp $";
 #else
 static const char sccsid[] = "@(#)ip_frag.c    1.11 3/24/96 (C) 1993-2000 Darren Reed";
-static const char rcsid[] = "@(#)Id: ip_frag.c,v 2.10.2.1 2000/04/28 14:56:51 darrenr Exp";
+static const char rcsid[] = "@(#)Id: ip_frag.c,v 2.10.2.3 2000/05/05 15:10:23 darrenr Exp";
 #endif
 #endif
 
@@ -91,8 +91,8 @@
 extern struct callout_handle ipfr_slowtimer_ch;
 # endif
 #endif
-#if defined(__NetBSD__)
-#include <sys/callout.h>
+#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104230000)
+# include <sys/callout.h>
 extern struct callout ipfr_slowtimer_ch;
 #endif
 
@@ -535,10 +535,13 @@
        fr_timeoutstate();
        ip_natexpire();
        fr_authexpire();
-# if   SOLARIS
+# if    SOLARIS
        ipfr_timer_id = timeout(ipfr_slowtimer, NULL, drv_usectohz(500000));
+       RWLOCK_EXIT(&ipf_solaris);
 # else
-#  ifndef linux
+#  if defined(__NetBSD__) && (__NetBSD_Version__ >= 104240000)
+       callout_reset(&ipfr_slowtimer_ch, hz / 2, ipfr_slowtimer, NULL);
+#  else
 #   if (__FreeBSD_version >= 300000)
        ipfr_slowtimer_ch = timeout(ipfr_slowtimer, NULL, hz/2);
 #   else
@@ -548,11 +551,10 @@
        timeout(ipfr_slowtimer, NULL, hz/2);
 #    endif
 #   endif
-#  endif
-#  if (BSD < 199306) && !defined(__sgi)
+#   if (BSD < 199306) && !defined(__sgi)
        return 0;
-#  endif
-# endif
-       RWLOCK_EXIT(&ipf_solaris);
+#   endif /* FreeBSD */
+#  endif /* NetBSD */
+# endif /* SOLARIS */
 }
 #endif /* defined(_KERNEL) */
diff -r 15b5ffd47c25 -r 87c66bb743d3 sys/netinet/ip_ftp_pxy.c
--- a/sys/netinet/ip_ftp_pxy.c  Thu May 11 19:35:03 2000 +0000
+++ b/sys/netinet/ip_ftp_pxy.c  Thu May 11 19:46:05 2000 +0000
@@ -1,10 +1,10 @@
-/*     $NetBSD: ip_ftp_pxy.c,v 1.14 2000/05/03 11:12:07 veego Exp $    */
+/*     $NetBSD: ip_ftp_pxy.c,v 1.15 2000/05/11 19:46:06 veego Exp $    */
 
 /*
  * Simple FTP transparent proxy for in-kernel use.  For use with the NAT
  * code.
  *
- * Id: ip_ftp_pxy.c,v 2.7.2.1 2000/04/30 05:13:05 darrenr Exp
+ * Id: ip_ftp_pxy.c,v 2.7.2.5 2000/05/09 11:41:46 darrenr Exp
  */
 #if SOLARIS && defined(_KERNEL)
 extern kmutex_t        ipf_rw;
@@ -22,15 +22,18 @@
 #define        IPF_FTPBUFSZ    96      /* This *MUST* be >= 53! */
 
 
+int ippr_ftp_client __P((fr_info_t *, ip_t *, nat_t *, ftpinfo_t *, int));
+int ippr_ftp_complete __P((char *, size_t));
+int ippr_ftp_in __P((fr_info_t *, ip_t *, ap_session_t *, nat_t *));
 int ippr_ftp_init __P((void));
 int ippr_ftp_new __P((fr_info_t *, ip_t *, ap_session_t *, nat_t *));
 int ippr_ftp_out __P((fr_info_t *, ip_t *, ap_session_t *, nat_t *));
-int ippr_ftp_in __P((fr_info_t *, ip_t *, ap_session_t *, nat_t *));
-int ippr_ftp_portmsg __P((fr_info_t *, ip_t *, nat_t *));
-int ippr_ftp_pasvmsg __P((fr_info_t *, ip_t *, nat_t *));
-int ippr_ftp_complete __P((char *, size_t));
-
-u_short ipf_ftp_atoi __P((char **));
+int ippr_ftp_pasv __P((fr_info_t *, ip_t *, nat_t *, ftpside_t *, int));
+int ippr_ftp_port __P((fr_info_t *, ip_t *, nat_t *, ftpside_t *, int));
+int ippr_ftp_process __P((fr_info_t *, ip_t *, nat_t *, ftpinfo_t *, int));
+int ippr_ftp_server __P((fr_info_t *, ip_t *, nat_t *, ftpinfo_t *, int));
+int ippr_ftp_valid __P((char *, size_t));
+u_short ippr_ftp_atoi __P((char **));
 
 static frentry_t       natfr;
 int    ippr_ftp_pasvonly = 0;
@@ -48,77 +51,6 @@
 }
 
 
-int ippr_ftp_complete(buf, len)
-char *buf;
-size_t len;
-{
-       register char *s, c;
-       register size_t i = len;
-
-nextmsg:
-       if (i < 5)
-               return 0;
-       s = buf;
-       c = *s++;
-       i--;
-
-       if (isdigit(c)) {
-               c = *s++;
-               i--;
-               if (isdigit(c)) {
-                       c = *s++;
-                       i--;
-                       if (isdigit(c)) {
-                               c = *s++;
-                               i--;
-                               if (c != '-' && c != ' ')
-                                       return 0;
-                       } else
-                               return 0;
-               } else
-                       return 0;
-       } else if (isupper(c)) {
-               c = *s++;
-               i--;
-               if (isupper(c)) {
-                       c = *s++;
-                       i--;
-                       if (isupper(c)) {
-                               c = *s++;
-                               i--;
-                               if (isupper(c)) {
-                                       c = *s++;



Home | Main Index | Thread Index | Old Index