summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/netinet/fil.c18
-rw-r--r--sys/netinet/ip_auth.c44
-rw-r--r--sys/netinet/ip_fil.c12
-rw-r--r--sys/netinet/ip_fil.h14
-rw-r--r--sys/netinet/ip_fil_compat.h10
-rw-r--r--sys/netinet/ip_ftp_pxy.c15
-rw-r--r--sys/netinet/ip_log.c54
-rw-r--r--sys/netinet/ip_nat.c12
-rw-r--r--sys/netinet/ip_nat.h5
-rw-r--r--sys/netinet/ip_raudio_pxy.c12
-rw-r--r--sys/netinet/ipl.h8
11 files changed, 91 insertions, 113 deletions
diff --git a/sys/netinet/fil.c b/sys/netinet/fil.c
index 6509da46d9e..8bd963cdbee 100644
--- a/sys/netinet/fil.c
+++ b/sys/netinet/fil.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fil.c,v 1.28 2001/01/30 04:23:55 kjell Exp $ */
+/* $OpenBSD: fil.c,v 1.29 2001/05/08 19:58:01 fgsch Exp $ */
/*
* Copyright (C) 1993-2000 by Darren Reed.
@@ -9,7 +9,7 @@
*/
#if !defined(lint)
static const char sccsid[] = "@(#)fil.c 1.36 6/5/96 (C) 1993-2000 Darren Reed";
-static const char rcsid[] = "@(#)$IPFilter: fil.c,v 2.35.2.30 2000/12/17 05:49:22 darrenr Exp $";
+static const char rcsid[] = "@(#)$IPFilter: fil.c,v 2.35.2.31 2001/04/03 15:46:41 dar renr Exp $";
#endif
#include <sys/errno.h>
@@ -260,7 +260,7 @@ fr_info_t *fin;
fin->fin_id = (u_short)(ip6->ip6_flow & 0xffff);
fi->fi_tos = 0;
fi->fi_fl = 0;
- plen = ntohs(ip6->ip6_plen);
+ plen = ntohs(ip6->ip6_plen) + sizeof(*ip6);
fin->fin_dlen = plen;
}
#endif
@@ -789,7 +789,7 @@ int out;
mb_t *mc = NULL;
# if !defined(__SVR4) && !defined(__svr4__)
# ifdef __sgi
- char hbuf[(0xf << 2) + sizeof(struct icmp) + sizeof(ip_t) + 8];
+ char hbuf[128];
# endif
int up;
@@ -814,6 +814,9 @@ int out;
# ifdef USE_INET6
if (v == 6) {
len = ntohs(((ip6_t*)ip)->ip6_plen);
+ if (!len)
+ return -1; /* potential jumbo gram */
+ len += sizeof(ip6_t);
p = ((ip6_t *)ip)->ip6_nxt;
} else
# endif
@@ -822,7 +825,8 @@ int out;
len = ip->ip_len;
}
- if ((p == IPPROTO_TCP || p == IPPROTO_UDP || p == IPPROTO_ICMP
+ if ((p == IPPROTO_TCP || p == IPPROTO_UDP ||
+ (v == 4 && p == IPPROTO_ICMP)
# ifdef USE_INET6
|| (v == 6 && p == IPPROTO_ICMPV6)
# endif
@@ -1231,7 +1235,7 @@ logit:
ipfr_fastroute(ip, mc, mp, fin, &fr->fr_dif);
}
# endif /* !SOLARIS */
- return (pass & FR_PASS) ? 0 : error;
+ return (pass & (FR_PASS|FR_AUTH)) ? 0 : error;
#else /* _KERNEL */
if (pass & FR_NOMATCH)
return 1;
@@ -1460,7 +1464,7 @@ nodata:
* SUCH DAMAGE.
*
* @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94
- * $IPFilter: fil.c,v 2.35.2.30 2000/12/17 05:49:22 darrenr Exp $
+ * $IPFilter: fil.c,v 2.35.2.31 2001/04/03 15:46:41 darrenr Exp $
*/
/*
* Copy data from an mbuf chain starting "off" bytes from the beginning,
diff --git a/sys/netinet/ip_auth.c b/sys/netinet/ip_auth.c
index 17046ab8283..72dc2799324 100644
--- a/sys/netinet/ip_auth.c
+++ b/sys/netinet/ip_auth.c
@@ -1,14 +1,14 @@
-/* $OpenBSD: ip_auth.c,v 1.17 2001/01/30 04:23:55 kjell Exp $ */
+/* $OpenBSD: ip_auth.c,v 1.18 2001/05/08 19:58:01 fgsch Exp $ */
/*
- * Copyright (C) 1998-2000 by Darren Reed & Guido van Rooij.
+ * Copyright (C) 1998-2001 by Darren Reed & Guido van Rooij.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and due credit is given
* to the original author and the contributors.
*/
#if !defined(lint)
-static const char rcsid[] = "@(#)$IPFilter: ip_auth.c,v 2.11.2.5 2001/01/10 06:18:35 darrenr Exp $";
+static const char rcsid[] = "@(#)$IPFilter: ip_auth.c,v 2.11.2.8 2001/04/03 15:48:12 darrenr Exp $";
#endif
#include <sys/errno.h>
@@ -238,40 +238,29 @@ ip_t *ip;
fr_auth[i].fra_pass = 0;
fr_auth[i].fra_age = fr_defaultauthage;
bcopy((char *)fin, (char *)&fr_auth[i].fra_info, sizeof(*fin));
-#if !defined(sparc) && !defined(m68k)
+#if SOLARIS && defined(_KERNEL)
+# if !defined(sparc)
/*
* No need to copyback here as we want to undo the changes, not keep
* them.
*/
-# if SOLARIS && defined(_KERNEL)
if ((ip == (ip_t *)m->b_rptr) && (ip->ip_v == 4))
-# endif
{
register u_short bo;
bo = ip->ip_len;
ip->ip_len = htons(bo);
-# if !SOLARIS && !defined(__NetBSD__)
- /* 4.4BSD converts this ip_input.c, but I don't in solaris.c */
- bo = ip->ip_id;
- ip->ip_id = htons(bo);
-# endif
bo = ip->ip_off;
ip->ip_off = htons(bo);
}
-#endif
-#if SOLARIS && defined(_KERNEL)
+# endif
m->b_rptr -= qif->qf_off;
fr_authpkts[i] = *(mblk_t **)fin->fin_mp;
fr_auth[i].fra_q = qif->qf_q;
cv_signal(&ipfauthwait);
#else
fr_authpkts[i] = m;
-# if defined(linux) && defined(_KERNEL)
- wake_up_interruptible(&ipfauthwait);
-# else
WAKEUP(&fr_authnext);
-# endif
#endif
return 1;
}
@@ -315,7 +304,9 @@ frentry_t *fr, **frptr;
else
faep = &fae->fae_next;
if (cmd == SIOCRMAFR) {
- if (!fae)
+ if (!fr || !frptr)
+ error = EINVAL;
+ else if (!fae)
error = ESRCH;
else {
WRITE_ENTER(&ipf_auth);
@@ -324,7 +315,7 @@ frentry_t *fr, **frptr;
RWLOCK_EXIT(&ipf_auth);
KFREE(fae);
}
- } else {
+ } else if (fr && frptr) {
KMALLOC(fae, frauthent_t *);
if (fae != NULL) {
bcopy((char *)fr, (char *)&fae->fae_fr,
@@ -340,7 +331,8 @@ frentry_t *fr, **frptr;
RWLOCK_EXIT(&ipf_auth);
} else
error = ENOMEM;
- }
+ } else
+ error = EINVAL;
break;
case SIOCATHST:
READ_ENTER(&ipf_auth);
@@ -409,12 +401,18 @@ fr_authioctlloop:
# if SOLARIS
error = fr_qout(fr_auth[i].fra_q, m);
# else /* SOLARIS */
-# if (_BSDI_VERSION >= 199802) || defined(__OpenBSD__)
- error = ip_output(m, NULL, NULL, IP_FORWARDING, NULL,
+ struct route ro;
+
+ bzero((char *)&ro, sizeof(ro));
+# if ((_BSDI_VERSION >= 199802) && (_BSDI_VERSION < 200005)) || \
+ defined(__OpenBSD__)
+ error = ip_output(m, NULL, &ro, IP_FORWARDING, NULL,
NULL);
# else
- error = ip_output(m, NULL, NULL, IP_FORWARDING, NULL);
+ error = ip_output(m, NULL, &ro, IP_FORWARDING, NULL);
# endif
+ if (ro.ro_rt)
+ RTFREE(ro.ro_rt);
# endif /* SOLARIS */
if (error)
fr_authstats.fas_sendfail++;
diff --git a/sys/netinet/ip_fil.c b/sys/netinet/ip_fil.c
index ad0fc260add..cff0124d53c 100644
--- a/sys/netinet/ip_fil.c
+++ b/sys/netinet/ip_fil.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: ip_fil.c,v 1.43 2001/04/22 19:44:34 gluk Exp $ */
+/* $OpenBSD: ip_fil.c,v 1.44 2001/05/08 19:58:01 fgsch Exp $ */
/*
- * Copyright (C) 1993-2000 by Darren Reed.
+ * Copyright (C) 1993-2001 by Darren Reed.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and due credit is given
@@ -9,7 +9,7 @@
*/
#if !defined(lint)
static const char sccsid[] = "@(#)ip_fil.c 2.41 6/5/96 (C) 1993-2000 Darren Reed";
-static const char rcsid[] = "@(#)$IPFilter: ip_fil.c,v 2.42.2.17 2000/10/19 15:39:42 darrenr Exp $";
+static const char rcsid[] = "@(#)$IPFilter: ip_fil.c,v 2.42.2.19 2001/04/03 14:13:37 darrenr Exp $";
#endif
#ifndef SOLARIS
@@ -254,15 +254,15 @@ int iplattach()
# endif
if (nat_init() == -1) {
SPL_X(s);
- return -1;
+ return EIO;
}
if (fr_stateinit() == -1) {
SPL_X(s);
- return -1;
+ return EIO;
}
if (appr_init() == -1) {
SPL_X(s);
- return -1;
+ return EIO;
}
# ifdef NETBSD_PF
diff --git a/sys/netinet/ip_fil.h b/sys/netinet/ip_fil.h
index ced4f4fbe79..c7989940004 100644
--- a/sys/netinet/ip_fil.h
+++ b/sys/netinet/ip_fil.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_fil.h,v 1.23 2001/02/06 17:29:30 fgsch Exp $ */
+/* $OpenBSD: ip_fil.h,v 1.24 2001/05/08 19:58:01 fgsch 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
- * $IPFilter: ip_fil.h,v 2.29.2.4 2000/11/12 11:54:53 darrenr Exp $
+ * $IPFilter: ip_fil.h,v 2.29.2.5 2001/03/20 13:18:05 darrenr Exp $
*/
#ifndef __IP_FIL_H__
@@ -61,7 +61,7 @@
# define SIOCSTLCK _IOWR('r', 79, u_int)
# define SIOCSTPUT _IOWR('r', 80, struct ipstate_save *)
# define SIOCSTGET _IOWR('r', 81, struct ipstate_save *)
-# define SIOCSTGSZ _IOWR('r', 82, struct natget *)
+# define SIOCSTGSZ _IOWR('r', 82, struct natget)
# define SIOCGFRST _IOWR('r', 83, struct ipfrstat *)
#else
# define SIOCADAFR _IOW(r, 60, struct frentry *)
@@ -86,7 +86,7 @@
# define SIOCSTLCK _IOWR(r, 79, u_int)
# define SIOCSTPUT _IOWR(r, 80, struct ipstate_save *)
# define SIOCSTGET _IOWR(r, 81, struct ipstate_save *)
-# define SIOCSTGSZ _IOWR(r, 82, struct natget *)
+# define SIOCSTGSZ _IOWR(r, 82, struct natget)
# define SIOCGFRST _IOWR(r, 83, struct ipfrstat *)
#endif
#define SIOCADDFR SIOCADAFR
@@ -424,9 +424,9 @@ typedef struct ipflog {
} ipflog_t;
-# ifndef ICMP_UNREACH_FILTER
-# define ICMP_UNREACH_FILTER 13
-# endif
+#ifndef ICMP_UNREACH_FILTER
+# define ICMP_UNREACH_FILTER 13
+#endif
#ifndef IPF_LOGGING
# define IPF_LOGGING 0
diff --git a/sys/netinet/ip_fil_compat.h b/sys/netinet/ip_fil_compat.h
index 44ae8640a71..c8be3b22056 100644
--- a/sys/netinet/ip_fil_compat.h
+++ b/sys/netinet/ip_fil_compat.h
@@ -1,14 +1,14 @@
-/* $OpenBSD: ip_fil_compat.h,v 1.20 2001/01/30 04:22:24 kjell Exp $ */
+/* $OpenBSD: ip_fil_compat.h,v 1.21 2001/05/08 19:58:01 fgsch Exp $ */
/*
- * Copyright (C) 1993-2000 by Darren Reed.
+ * Copyright (C) 1993-2001 by Darren Reed.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and due credit is given
* to the original author and the contributors.
*
* @(#)ip_compat.h 1.8 1/14/96
- * $IPFilter: ip_compat.h,v 2.26.2.9 2001/01/14 14:58:01 darrenr Exp $
+ * $IPFilter: ip_compat.h,v 2.26.2.11 2001/04/03 14:13:35 darrenr Exp $
*/
#ifndef __IP_COMPAT_H__
@@ -510,7 +510,7 @@ extern vm_map_t kmem_map;
# define SLEEP(id, n) tsleep((id), PPAUSE|PCATCH, n, 0)
# define WAKEUP(id) wakeup(id)
# endif /* BSD */
-# if defined(NetBSD) && NetBSD <= 1991011 && NetBSD >= 199407
+# if (defined(NetBSD) && (NetBSD <= 1991011) && (NetBSD >= 199407))
# define SPL_NET(x) x = splsoftnet()
# define SPL_X(x) (void) splx(x)
# else
@@ -519,7 +519,7 @@ extern vm_map_t kmem_map;
# define SPL_NET(x) x = splnet()
# define SPL_X(x) (void) splx(x)
# endif
-# endif /* NetBSD && NetBSD <= 1991011 && NetBSD >= 199407 */
+# endif /* NetBSD && (NetBSD <= 1991011) && (NetBSD >= 199407) */
# define PANIC(x,y) if (x) panic y
#else /* KERNEL */
# define SLEEP(x,y) ;
diff --git a/sys/netinet/ip_ftp_pxy.c b/sys/netinet/ip_ftp_pxy.c
index 8cedf2807a1..a82544da0f2 100644
--- a/sys/netinet/ip_ftp_pxy.c
+++ b/sys/netinet/ip_ftp_pxy.c
@@ -1,10 +1,10 @@
-/* $OpenBSD: ip_ftp_pxy.c,v 1.13 2001/03/17 22:54:20 beck Exp $ */
+/* $OpenBSD: ip_ftp_pxy.c,v 1.14 2001/05/08 19:58:01 fgsch Exp $ */
/*
* Simple FTP transparent proxy for in-kernel use. For use with the NAT
* code.
*
- * $IPFilter: ip_ftp_pxy.c,v 2.7.2.20 2000/12/02 00:15:06 darrenr Exp $
+ * $IPFilter: ip_ftp_pxy.c,v 2.7.2.21 2001/01/17 13:30:52 darrenr Exp $
*/
#if SOLARIS && defined(_KERNEL)
extern kmutex_t ipf_rw;
@@ -515,12 +515,11 @@ int dlen;
if ((ftp->ftp_passok == 1) && !strncmp(rptr, "331", 3))
ftp->ftp_passok = 2;
- else if ((ftp->ftp_passok == 1) && !strncmp(rptr, "230", 3))
- ftp->ftp_passok = 4;
- else if ((ftp->ftp_passok == 3) && !strncmp(rptr, "230", 3))
- ftp->ftp_passok = 4;
- else if ((ftp->ftp_passok == 3) && !strncmp(rptr, "530", 3))
- ftp->ftp_passok = 0;
+ else if (((ftp->ftp_passok == 3) || (ftp->ftp_passok == 1)) &&
+ !strncmp(rptr, "230", 3)) {
+ ftp->ftp_passok = 4;
+ } else if ((ftp->ftp_passok == 3) && !strncmp(rptr, "530", 3))
+ ftp->ftp_passok = 0;
else if ((ftp->ftp_passok == 4) && !strncmp(rptr, "227 ", 4)) {
inc = ippr_ftp_pasv(fin, ip, nat, f, dlen);
} else if (ippr_ftp_insecure && !strncmp(rptr, "227 ", 4)) {
diff --git a/sys/netinet/ip_log.c b/sys/netinet/ip_log.c
index c9a14531c9e..88ce0faee8d 100644
--- a/sys/netinet/ip_log.c
+++ b/sys/netinet/ip_log.c
@@ -1,13 +1,13 @@
-/* $OpenBSD: ip_log.c,v 1.11 2001/03/25 12:03:11 gluk Exp $ */
+/* $OpenBSD: ip_log.c,v 1.12 2001/05/08 19:58:01 fgsch Exp $ */
/*
- * Copyright (C) 1997-2000 by Darren Reed.
+ * Copyright (C) 1997-2001 by Darren Reed.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and due credit is given
* to the original author and the contributors.
*
- * $IPFilter: ip_log.c,v 2.5.2.2 2000/08/13 03:50:41 darrenr Exp $
+ * $IPFilter: ip_log.c,v 2.5.2.3 2001/04/03 15:45:49 darrenr Exp $
*/
#include <sys/param.h>
#if defined(KERNEL) && !defined(_KERNEL)
@@ -47,7 +47,7 @@
# include <sys/ioctl.h>
# endif
# include <sys/time.h>
-# if defined(_KERNEL) && !defined(linux)
+# if defined(_KERNEL)
# include <sys/systm.h>
# endif
# include <sys/uio.h>
@@ -57,9 +57,7 @@
# else
# include <sys/dir.h>
# endif
-# ifndef linux
-# include <sys/mbuf.h>
-# endif
+# include <sys/mbuf.h>
# else
# include <sys/filio.h>
# include <sys/cred.h>
@@ -71,9 +69,7 @@
# include <sys/dditypes.h>
# include <sys/cmn_err.h>
# endif
-# ifndef linux
-# include <sys/protosw.h>
-# endif
+# include <sys/protosw.h>
# include <sys/socket.h>
# include <net/if.h>
@@ -91,7 +87,7 @@
# include <sys/hashing.h>
# endif
# endif
-# if !defined(linux) && !(defined(__sgi) && !defined(IFF_DRVRLOCK)) /*IRIX<6*/
+# if !(defined(__sgi) && !defined(IFF_DRVRLOCK)) /*IRIX<6*/
# include <netinet/in_var.h>
# endif
# include <netinet/in_systm.h>
@@ -99,9 +95,7 @@
# include <netinet/tcp.h>
# include <netinet/udp.h>
# include <netinet/ip_icmp.h>
-# ifndef linux
-# include <netinet/ip_var.h>
-# endif
+# include <netinet/ip_var.h>
# ifndef _KERNEL
# include <syslog.h>
# endif
@@ -132,9 +126,6 @@ extern kcondvar_t iplwait;
iplog_t **iplh[IPL_LOGMAX+1], *iplt[IPL_LOGMAX+1], *ipll[IPL_LOGMAX+1];
size_t iplused[IPL_LOGMAX+1];
static fr_info_t iplcrc[IPL_LOGMAX+1];
-# ifdef linux
-static struct wait_queue *iplwait[IPL_LOGMAX+1];
-# endif
/*
@@ -231,9 +222,7 @@ mb_t *m;
(defined(OpenBSD) && (OpenBSD >= 199603))
strncpy(ipfl.fl_ifname, ifp->if_xname, IFNAMSIZ);
# else
-# ifndef linux
ipfl.fl_unit = (u_char)ifp->if_unit;
-# endif
if ((ipfl.fl_ifname[0] = ifp->if_name[0]))
if ((ipfl.fl_ifname[1] = ifp->if_name[1]))
if ((ipfl.fl_ifname[2] = ifp->if_name[2]))
@@ -339,7 +328,7 @@ int *types, cnt;
ipl->ipl_count = 1;
ipl->ipl_next = NULL;
ipl->ipl_dsize = len;
-# if SOLARIS || defined(sun) || defined(linux)
+# if SOLARIS || defined(sun)
uniqtime((struct timeval *)&ipl->ipl_sec);
# else
# if BSD >= 199306 || defined(__FreeBSD__) || defined(__sgi)
@@ -372,11 +361,7 @@ int *types, cnt;
mutex_exit(&ipl_mutex);
# else
MUTEX_EXIT(&ipl_mutex);
-# ifdef linux
- wake_up_interruptible(&iplwait[dev]);
-# else
wakeup(&iplh[dev]);
-# endif
# endif
return 1;
}
@@ -401,8 +386,7 @@ struct uio *uio;
return ENXIO;
if (!uio->uio_resid)
return 0;
- if ((uio->uio_resid < sizeof(iplog_t)) ||
- (uio->uio_resid > IPLLOGSIZE))
+ if (uio->uio_resid < sizeof(iplog_t))
return EINVAL;
/*
@@ -419,19 +403,13 @@ struct uio *uio;
return EINTR;
}
# else
-# ifdef linux
- interruptible_sleep_on(&iplwait[unit]);
- if (current->signal & ~current->blocked)
- return -EINTR;
-# else
MUTEX_EXIT(&ipl_mutex);
- SPL_X(s);
error = SLEEP(&iplh[unit], "ipl sleep");
- if (error)
+ if (error) {
+ SPL_X(s);
return error;
- SPL_NET(s);
+ }
MUTEX_ENTER(&ipl_mutex);
-# endif /* linux */
# endif /* SOLARIS */
}
@@ -468,13 +446,7 @@ struct uio *uio;
MUTEX_EXIT(&ipl_mutex);
SPL_X(s);
-# ifdef linux
- if (!error)
- return (int)copied;
- return -error;
-# else
return error;
-# endif
}
diff --git a/sys/netinet/ip_nat.c b/sys/netinet/ip_nat.c
index 615864dffcd..412fb9fb6a2 100644
--- a/sys/netinet/ip_nat.c
+++ b/sys/netinet/ip_nat.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: ip_nat.c,v 1.39 2001/02/06 17:29:30 fgsch Exp $ */
+/* $OpenBSD: ip_nat.c,v 1.40 2001/05/08 19:58:01 fgsch Exp $ */
/*
- * Copyright (C) 1995-2000 by Darren Reed.
+ * Copyright (C) 1995-2001 by Darren Reed.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and due credit is given
@@ -11,7 +11,7 @@
*/
#if !defined(lint)
static const char sccsid[] = "@(#)ip_nat.c 1.11 6/5/96 (C) 1995 Darren Reed";
-static const char rcsid[] = "@(#)$IPFilter: ip_nat.c,v 2.37.2.32 2001/01/10 06:19:11 darrenr Exp $";
+static const char rcsid[] = "@(#)$IPFilter: ip_nat.c,v 2.37.2.35 2001/04/06 14:07:40 darrenr Exp $";
#endif
#if defined(__FreeBSD__) && defined(KERNEL) && !defined(_KERNEL)
@@ -2280,7 +2280,8 @@ maskloop:
*/
if (nat) {
np = nat->nat_ptr;
- if (natadd && fin->fin_fi.fi_fl & FI_FRAG)
+ if (natadd && (fin->fin_fi.fi_fl & FI_FRAG) &&
+ np && (np->in_flags & IPN_FRAG))
ipfr_nat_newfrag(ip, fin, 0, nat);
MUTEX_ENTER(&nat->nat_lock);
nat->nat_age = fr_defnatage;
@@ -2485,7 +2486,8 @@ maskloop:
if (nat) {
np = nat->nat_ptr;
fin->fin_fr = nat->nat_fr;
- if (natadd && fin->fin_fi.fi_fl & FI_FRAG)
+ if (natadd && (fin->fin_fi.fi_fl & FI_FRAG) &&
+ np && (np->in_flags & IPN_FRAG))
ipfr_nat_newfrag(ip, fin, 0, nat);
if ((np->in_apr != NULL) && (np->in_dport == 0 ||
(tcp != NULL && sport == np->in_dport))) {
diff --git a/sys/netinet/ip_nat.h b/sys/netinet/ip_nat.h
index 8b218a28148..c0cab691185 100644
--- a/sys/netinet/ip_nat.h
+++ b/sys/netinet/ip_nat.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_nat.h,v 1.18 2001/01/17 04:47:15 fgsch Exp $ */
+/* $OpenBSD: ip_nat.h,v 1.19 2001/05/08 19:58:02 fgsch 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
- * $IPFilter: ip_nat.h,v 2.17.2.14 2000/11/18 03:58:04 darrenr Exp $
+ * $IPFilter: ip_nat.h,v 2.17.2.15 2001/04/06 13:47:35 darrenr Exp $
*/
#ifndef __IP_NAT_H__
@@ -228,6 +228,7 @@ typedef struct natstat {
#define IPN_ROUNDR 0x100
#define IPN_NOTSRC 0x080000
#define IPN_NOTDST 0x100000
+#define IPN_FRAG 0x200000
typedef struct natlog {
diff --git a/sys/netinet/ip_raudio_pxy.c b/sys/netinet/ip_raudio_pxy.c
index 171ae21ad7e..2c15281ffa6 100644
--- a/sys/netinet/ip_raudio_pxy.c
+++ b/sys/netinet/ip_raudio_pxy.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: ip_raudio_pxy.c,v 1.8 2001/01/17 04:47:16 fgsch Exp $ */
+/* $OpenBSD: ip_raudio_pxy.c,v 1.9 2001/05/08 19:58:02 fgsch Exp $ */
/*
- * $IPFilter: ip_raudio_pxy.c,v 1.7.2.3 2000/10/27 22:54:04 darrenr Exp $
+ * $IPFilter: ip_raudio_pxy.c,v 1.7.2.4 2001/04/03 15:45:15 darrenr Exp $
*/
#if SOLARIS && defined(_KERNEL)
extern kmutex_t ipf_rw;
@@ -64,8 +64,8 @@ nat_t *nat;
raudio_t *rap = aps->aps_data;
unsigned char membuf[512 + 1], *s;
u_short id = 0;
- tcphdr_t *tcp;
int off, dlen;
+ tcphdr_t *tcp;
int len = 0;
mb_t *m;
#if SOLARIS
@@ -88,14 +88,16 @@ nat_t *nat;
dlen = msgdsize(m) - off;
if (dlen <= 0)
return 0;
- copyout_mblk(m, off, MIN(sizeof(membuf), dlen), (char *)membuf);
+ dlen = MIN(sizeof(membuf), dlen);
+ copyout_mblk(m, off, dlen, (char *)membuf);
#else
m = *(mb_t **)fin->fin_mp;
dlen = mbufchainlen(m) - off;
if (dlen <= 0)
return 0;
- m_copydata(m, off, MIN(sizeof(membuf), dlen), (char *)membuf);
+ dlen = MIN(sizeof(membuf), dlen);
+ m_copydata(m, off, dlen, (char *)membuf);
#endif
/*
* In all the startup parsing, ensure that we don't go outside
diff --git a/sys/netinet/ipl.h b/sys/netinet/ipl.h
index e3933e579e0..9baf5e3b5e8 100644
--- a/sys/netinet/ipl.h
+++ b/sys/netinet/ipl.h
@@ -1,19 +1,19 @@
-/* $OpenBSD: ipl.h,v 1.14 2001/01/17 07:25:19 fgsch Exp $ */
+/* $OpenBSD: ipl.h,v 1.15 2001/05/08 19:58:02 fgsch Exp $ */
/*
- * Copyright (C) 1993-2000 by Darren Reed.
+ * Copyright (C) 1993-2001 by Darren Reed.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and due credit is given
* to the original author and the contributors.
*
* @(#)ipl.h 1.21 6/5/96
- * $IPFilter: ipl.h,v 2.15.2.17 2001/01/14 13:47:15 darrenr Exp $
+ * $IPFilter: ipl.h,v 2.15.2.19 2001/04/06 12:21:28 darrenr Exp $
*/
#ifndef __IPL_H__
#define __IPL_H__
-#define IPL_VERSION "IP Filter: v3.4.16"
+#define IPL_VERSION "IP Filter: v3.4.17"
#endif