PERFORCE change 42388 for review
Peter Wemm
peter at FreeBSD.org
Fri Nov 14 14:03:21 PST 2003
http://perforce.freebsd.org/chv.cgi?CH=42388
Change 42388 by peter at peter_daintree on 2003/11/14 14:02:39
IFC @42387
Affected files ...
.. //depot/projects/hammer/sbin/idmapd/Makefile#1 branch
.. //depot/projects/hammer/sbin/idmapd/idmapd.8#1 branch
.. //depot/projects/hammer/sbin/idmapd/idmapd.c#1 branch
.. //depot/projects/hammer/sbin/mount_nfs4/Makefile#1 branch
.. //depot/projects/hammer/sbin/mount_nfs4/mount_nfs4.8#1 branch
.. //depot/projects/hammer/sbin/mount_nfs4/mount_nfs4.c#1 branch
.. //depot/projects/hammer/share/man/man4/Makefile#26 integrate
.. //depot/projects/hammer/share/man/man4/idt.4#1 branch
.. //depot/projects/hammer/sys/conf/files#37 integrate
.. //depot/projects/hammer/sys/dev/acpica/acpi_pci_link.c#8 integrate
.. //depot/projects/hammer/sys/dev/acpica/acpi_pcib.c#10 integrate
.. //depot/projects/hammer/sys/i386/i386/intr_machdep.c#3 integrate
.. //depot/projects/hammer/sys/i386/i386/mptable.c#5 integrate
.. //depot/projects/hammer/sys/i386/isa/atpic.c#5 integrate
.. //depot/projects/hammer/sys/i386/isa/atpic_vector.s#3 integrate
.. //depot/projects/hammer/sys/modules/if_gre/Makefile#5 integrate
.. //depot/projects/hammer/sys/net/if_arcsubr.c#7 integrate
.. //depot/projects/hammer/sys/net/if_ef.c#6 integrate
.. //depot/projects/hammer/sys/net/if_ethersubr.c#19 integrate
.. //depot/projects/hammer/sys/net/if_fddisubr.c#8 integrate
.. //depot/projects/hammer/sys/net/if_gre.c#8 integrate
.. //depot/projects/hammer/sys/net/if_iso88025subr.c#7 integrate
.. //depot/projects/hammer/sys/net/if_ppp.c#10 integrate
.. //depot/projects/hammer/sys/netatm/ipatm/ipatm_vcm.c#6 integrate
.. //depot/projects/hammer/sys/netinet/in_rmx.c#7 integrate
.. //depot/projects/hammer/sys/netinet/in_var.h#4 integrate
.. //depot/projects/hammer/sys/netinet/ip_fastfwd.c#1 branch
.. //depot/projects/hammer/sys/netinet/ip_flow.c#5 delete
.. //depot/projects/hammer/sys/netinet/ip_flow.h#3 delete
.. //depot/projects/hammer/sys/netinet/ip_fw2.c#18 integrate
.. //depot/projects/hammer/sys/netinet/ip_icmp.c#10 integrate
.. //depot/projects/hammer/sys/netinet/ip_input.c#21 integrate
.. //depot/projects/hammer/sys/netinet/ip_output.c#22 integrate
.. //depot/projects/hammer/sys/netinet/ip_var.h#13 integrate
.. //depot/projects/hammer/sys/nfs/nfsproto.h#2 integrate
.. //depot/projects/hammer/sys/nfs/rpcv2.h#2 integrate
.. //depot/projects/hammer/sys/nfs4client/nfs4.h#1 branch
.. //depot/projects/hammer/sys/nfs4client/nfs4_dev.c#1 branch
.. //depot/projects/hammer/sys/nfs4client/nfs4_dev.h#1 branch
.. //depot/projects/hammer/sys/nfs4client/nfs4_idmap.c#1 branch
.. //depot/projects/hammer/sys/nfs4client/nfs4_idmap.h#1 branch
.. //depot/projects/hammer/sys/nfs4client/nfs4_socket.c#1 branch
.. //depot/projects/hammer/sys/nfs4client/nfs4_subs.c#1 branch
.. //depot/projects/hammer/sys/nfs4client/nfs4_vfs.h#1 branch
.. //depot/projects/hammer/sys/nfs4client/nfs4_vfs_subs.c#1 branch
.. //depot/projects/hammer/sys/nfs4client/nfs4_vfsops.c#1 branch
.. //depot/projects/hammer/sys/nfs4client/nfs4_vn.h#1 branch
.. //depot/projects/hammer/sys/nfs4client/nfs4_vn_subs.c#1 branch
.. //depot/projects/hammer/sys/nfs4client/nfs4_vnops.c#1 branch
.. //depot/projects/hammer/sys/nfs4client/nfs4m_subs.h#1 branch
.. //depot/projects/hammer/sys/nfsclient/bootp_subr.c#10 integrate
.. //depot/projects/hammer/sys/nfsclient/krpc_subr.c#5 integrate
.. //depot/projects/hammer/sys/nfsclient/nfs.h#4 integrate
.. //depot/projects/hammer/sys/nfsclient/nfs_bio.c#11 integrate
.. //depot/projects/hammer/sys/nfsclient/nfs_diskless.c#6 integrate
.. //depot/projects/hammer/sys/nfsclient/nfs_lock.c#11 integrate
.. //depot/projects/hammer/sys/nfsclient/nfs_nfsiod.c#5 integrate
.. //depot/projects/hammer/sys/nfsclient/nfs_node.c#9 integrate
.. //depot/projects/hammer/sys/nfsclient/nfs_socket.c#10 integrate
.. //depot/projects/hammer/sys/nfsclient/nfs_subs.c#8 integrate
.. //depot/projects/hammer/sys/nfsclient/nfs_vfsops.c#19 integrate
.. //depot/projects/hammer/sys/nfsclient/nfs_vnops.c#15 integrate
.. //depot/projects/hammer/sys/nfsclient/nfsargs.h#2 integrate
.. //depot/projects/hammer/sys/nfsclient/nfsm_subs.h#2 integrate
.. //depot/projects/hammer/sys/nfsclient/nfsmount.h#3 integrate
.. //depot/projects/hammer/sys/nfsclient/nfsnode.h#3 integrate
.. //depot/projects/hammer/sys/rpc/rpcclnt.c#1 branch
.. //depot/projects/hammer/sys/rpc/rpcclnt.h#1 branch
.. //depot/projects/hammer/sys/rpc/rpcm_subs.h#1 branch
.. //depot/projects/hammer/sys/rpc/rpcv2.h#1 branch
.. //depot/projects/hammer/sys/security/mac/mac_internal.h#5 integrate
.. //depot/projects/hammer/sys/sparc64/conf/GENERIC#18 integrate
.. //depot/projects/hammer/sys/sys/mbuf.h#14 integrate
.. //depot/projects/hammer/sys/sys/reboot.h#3 integrate
.. //depot/projects/hammer/sys/sys/sysctl.h#12 integrate
Differences ...
==== //depot/projects/hammer/share/man/man4/Makefile#26 (text+ko) ====
@@ -1,5 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/18/93
-# $FreeBSD: src/share/man/man4/Makefile,v 1.239 2003/11/11 18:48:02 trhodes Exp $
+# $FreeBSD: src/share/man/man4/Makefile,v 1.240 2003/11/14 20:29:12 bms Exp $
MAN= aac.4 \
acpi.4 \
@@ -82,6 +82,7 @@
icmp.4 \
icmp6.4 \
ida.4 \
+ idt.4 \
ieee80211.4 \
ifmib.4 \
iic.4 \
@@ -332,6 +333,7 @@
MLINKS+=gx.4 if_gx.4
MLINKS+=hatm.4 if_hatm.4
MLINKS+=hme.4 if_hme.4
+MLINKS+=idt.4 if_idt.4
MLINKS+=ipfirewall.4 ipacct.4 ipfirewall.4 ipaccounting.4 ipfirewall.4 ipfw.4
MLINKS+=kue.4 if_kue.4
MLINKS+=lge.4 if_lge.4
==== //depot/projects/hammer/sys/conf/files#37 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.850 2003/11/12 04:22:36 ume Exp $
+# $FreeBSD: src/sys/conf/files,v 1.852 2003/11/14 21:02:22 andre Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -1448,7 +1448,7 @@
netinet/ip_ecn.c optional inet6
netinet/ip_encap.c optional inet
netinet/ip_encap.c optional inet6
-netinet/ip_flow.c optional inet
+netinet/ip_fastfwd.c optional inet
netinet/ip_fw2.c optional ipfirewall
netinet/ip_icmp.c optional inet
netinet/ip_input.c optional inet
@@ -1562,6 +1562,15 @@
nfsclient/nfs_vfsops.c optional nfsclient
nfsclient/nfs_vnops.c optional nfsclient
nfsclient/nfs_lock.c optional nfsclient
+nfs4client/nfs4_socket.c optional nfsclient
+nfs4client/nfs4_vfsops.c optional nfsclient
+nfs4client/nfs4_vnops.c optional nfsclient
+nfs4client/nfs4_subs.c optional nfsclient
+nfs4client/nfs4_vfs_subs.c optional nfsclient
+nfs4client/nfs4_vn_subs.c optional nfsclient
+nfs4client/nfs4_dev.c optional nfsclient
+nfs4client/nfs4_idmap.c optional nfsclient
+rpc/rpcclnt.c optional nfsclient
nfsserver/nfs_serv.c optional nfsserver
nfsserver/nfs_srvsock.c optional nfsserver
nfsserver/nfs_srvcache.c optional nfsserver
==== //depot/projects/hammer/sys/dev/acpica/acpi_pci_link.c#8 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pci_link.c,v 1.8 2003/11/12 19:46:17 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pci_link.c,v 1.9 2003/11/14 21:36:09 jhb Exp $");
#include "opt_acpi.h"
#include <sys/param.h>
==== //depot/projects/hammer/sys/dev/acpica/acpi_pcib.c#10 (text+ko) ====
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pcib.c,v 1.32 2003/08/24 17:48:01 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pcib.c,v 1.33 2003/11/14 21:36:09 jhb Exp $");
#include "opt_acpi.h"
#include <sys/param.h>
==== //depot/projects/hammer/sys/i386/i386/intr_machdep.c#3 (text+ko) ====
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/i386/i386/intr_machdep.c,v 1.2 2003/11/12 18:13:57 jhb Exp $
+ * $FreeBSD: src/sys/i386/i386/intr_machdep.c,v 1.3 2003/11/14 21:00:32 jhb Exp $
*/
/*
@@ -171,7 +171,10 @@
atomic_add_int(&cnt.v_intr, 1);
it = isrc->is_ithread;
- ih = TAILQ_FIRST(&it->it_handlers);
+ if (it == NULL)
+ ih = NULL;
+ else
+ ih = TAILQ_FIRST(&it->it_handlers);
/*
* XXX: We assume that IRQ 0 is only used for the ISA timer
==== //depot/projects/hammer/sys/i386/i386/mptable.c#5 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/mptable.c,v 1.225 2003/11/11 21:19:43 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/mptable.c,v 1.226 2003/11/14 20:51:07 peter Exp $");
#include "opt_mptable_force_htt.h"
#include <sys/param.h>
@@ -237,7 +237,7 @@
goto found;
} else {
/* last 1K of base memory, effective 'top of base' passed in */
- target = (u_int32_t) (basemem - 0x400);
+ target = (u_int32_t) ((basemem * 1024) - 0x400);
if ((x = search_for_sig(target, 1024 / 4)) >= 0)
goto found;
}
==== //depot/projects/hammer/sys/i386/isa/atpic.c#5 (text+ko) ====
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/isa/atpic.c,v 1.4 2003/11/14 19:13:06 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/isa/atpic.c,v 1.5 2003/11/14 21:02:49 jhb Exp $");
#include "opt_auto_eoi.h"
#include "opt_isa.h"
@@ -215,16 +215,6 @@
static void
atpic_enable_intr(struct intsrc *isrc)
{
- struct atpic_intsrc *ai = (struct atpic_intsrc *)isrc;
- struct atpic *ap = (struct atpic *)isrc->is_pic;
- register_t eflags;
-
- mtx_lock_spin(&icu_lock);
- eflags = intr_disable();
- setidt(ap->at_intbase + ai->at_irq, ai->at_intr, SDT_SYS386IGT,
- SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
- intr_restore(eflags);
- mtx_unlock_spin(&icu_lock);
}
static int
@@ -326,6 +316,9 @@
if (i == ICU_SLAVEID)
continue;
ai = &atintrs[i];
+ setidt(((struct atpic *)ai->at_intsrc.is_pic)->at_intbase +
+ ai->at_irq, ai->at_intr, SDT_SYS386IGT, SEL_KPL,
+ GSEL(GCODE_SEL, SEL_KPL));
intr_register_source(&ai->at_intsrc);
}
}
==== //depot/projects/hammer/sys/i386/isa/atpic_vector.s#3 (text+ko) ====
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* from: vector.s, 386BSD 0.1 unknown origin
- * $FreeBSD: src/sys/i386/isa/atpic_vector.s,v 1.39 2003/11/12 18:13:57 jhb Exp $
+ * $FreeBSD: src/sys/i386/isa/atpic_vector.s,v 1.40 2003/11/14 20:06:24 peter Exp $
*/
/*
@@ -40,8 +40,6 @@
* master and slave interrupt controllers.
*/
-#include "opt_auto_eoi.h"
-
#include <machine/asmacros.h>
#include <i386/isa/icu.h>
#ifdef PC98
==== //depot/projects/hammer/sys/modules/if_gre/Makefile#5 (text+ko) ====
@@ -1,13 +1,16 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../../net ${.CURDIR}/../../netinet
+.PATH: ${.CURDIR}/../../net ${.CURDIR}/../../netinet ${.CURDIR}/../../netinet6
KMOD= if_gre
-SRCS= if_gre.c ip_gre.c opt_inet.h opt_atalk.h
+SRCS= if_gre.c ip_gre.c opt_inet.h opt_inet6.h opt_atalk.h
opt_inet.h:
echo "#define INET 1" > ${.TARGET}
+opt_inet6.h:
+ echo "#define INET6 1" > ${.TARGET}
+
opt_atalk.h:
echo "#define NETATALK 1" > ${.TARGET}
==== //depot/projects/hammer/sys/net/if_arcsubr.c#7 (text+ko) ====
@@ -1,5 +1,5 @@
/* $NetBSD: if_arcsubr.c,v 1.36 2001/06/14 05:44:23 itojun Exp $ */
-/* $FreeBSD: src/sys/net/if_arcsubr.c,v 1.14 2003/10/31 18:32:08 brooks Exp $ */
+/* $FreeBSD: src/sys/net/if_arcsubr.c,v 1.15 2003/11/14 21:02:22 andre Exp $ */
/*
* Copyright (c) 1994, 1995 Ignatios Souvatzis
@@ -543,14 +543,14 @@
#ifdef INET
case ARCTYPE_IP:
m_adj(m, ARC_HDRNEWLEN);
- if (ipflow_fastforward(m))
+ if (ip_fastforward(m))
return;
isr = NETISR_IP;
break;
case ARCTYPE_IP_OLD:
m_adj(m, ARC_HDRLEN);
- if (ipflow_fastforward(m))
+ if (ip_fastforward(m))
return;
isr = NETISR_IP;
break;
==== //depot/projects/hammer/sys/net/if_ef.c#6 (text+ko) ====
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/net/if_ef.c,v 1.26 2003/10/31 18:32:08 brooks Exp $
+ * $FreeBSD: src/sys/net/if_ef.c,v 1.27 2003/11/14 21:02:22 andre Exp $
*/
#include "opt_inet.h"
@@ -253,7 +253,7 @@
#endif
#ifdef INET
case ETHERTYPE_IP:
- if (ipflow_fastforward(m))
+ if (ip_fastforward(m))
return (0);
isr = NETISR_IP;
break;
==== //depot/projects/hammer/sys/net/if_ethersubr.c#19 (text+ko) ====
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93
- * $FreeBSD: src/sys/net/if_ethersubr.c,v 1.154 2003/10/31 18:32:08 brooks Exp $
+ * $FreeBSD: src/sys/net/if_ethersubr.c,v 1.155 2003/11/14 21:02:22 andre Exp $
*/
#include "opt_atalk.h"
@@ -714,7 +714,7 @@
switch (ether_type) {
#ifdef INET
case ETHERTYPE_IP:
- if (ipflow_fastforward(m))
+ if (ip_fastforward(m))
return;
isr = NETISR_IP;
break;
==== //depot/projects/hammer/sys/net/if_fddisubr.c#8 (text+ko) ====
@@ -33,7 +33,7 @@
* SUCH DAMAGE.
*
* from: if_ethersubr.c,v 1.5 1994/12/13 22:31:45 wollman Exp
- * $FreeBSD: src/sys/net/if_fddisubr.c,v 1.86 2003/10/23 17:47:55 imp Exp $
+ * $FreeBSD: src/sys/net/if_fddisubr.c,v 1.87 2003/11/14 21:02:22 andre Exp $
*/
#include "opt_atalk.h"
@@ -471,7 +471,7 @@
switch (type) {
#ifdef INET
case ETHERTYPE_IP:
- if (ipflow_fastforward(m))
+ if (ip_fastforward(m))
return;
isr = NETISR_IP;
break;
==== //depot/projects/hammer/sys/net/if_gre.c#8 (text+ko) ====
@@ -48,6 +48,7 @@
#include "opt_atalk.h"
#include "opt_inet.h"
+#include "opt_inet6.h"
#include <sys/param.h>
#include <sys/kernel.h>
@@ -585,6 +586,9 @@
memcpy(&lifr->dstaddr, &si, sizeof(si));
break;
case SIOCGIFPSRCADDR:
+#ifdef INET6
+ case SIOCGIFPSRCADDR_IN6:
+#endif
if (sc->g_src.s_addr == INADDR_ANY) {
error = EADDRNOTAVAIL;
break;
@@ -596,6 +600,9 @@
bcopy(&si, &ifr->ifr_addr, sizeof(ifr->ifr_addr));
break;
case SIOCGIFPDSTADDR:
+#ifdef INET6
+ case SIOCGIFPDSTADDR_IN6:
+#endif
if (sc->g_dst.s_addr == INADDR_ANY) {
error = EADDRNOTAVAIL;
break;
==== //depot/projects/hammer/sys/net/if_iso88025subr.c#7 (text+ko) ====
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/net/if_iso88025subr.c,v 1.57 2003/09/14 02:32:31 mdodd Exp $
+ * $FreeBSD: src/sys/net/if_iso88025subr.c,v 1.58 2003/11/14 21:02:22 andre Exp $
*
*/
@@ -556,7 +556,7 @@
#ifdef INET
case ETHERTYPE_IP:
th->iso88025_shost[0] &= ~(TR_RII);
- if (ipflow_fastforward(m))
+ if (ip_fastforward(m))
return;
isr = NETISR_IP;
break;
==== //depot/projects/hammer/sys/net/if_ppp.c#10 (text+ko) ====
@@ -69,7 +69,7 @@
* Paul Mackerras (paulus at cs.anu.edu.au).
*/
-/* $FreeBSD: src/sys/net/if_ppp.c,v 1.93 2003/11/08 22:28:39 sam Exp $ */
+/* $FreeBSD: src/sys/net/if_ppp.c,v 1.94 2003/11/14 21:02:22 andre Exp $ */
/* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */
/* from NetBSD: if_ppp.c,v 1.15.2.2 1994/07/28 05:17:58 cgd Exp */
@@ -1537,7 +1537,7 @@
m->m_pkthdr.len -= PPP_HDRLEN;
m->m_data += PPP_HDRLEN;
m->m_len -= PPP_HDRLEN;
- if (ipflow_fastforward(m))
+ if (ip_fastforward(m))
return;
isr = NETISR_IP;
break;
==== //depot/projects/hammer/sys/netatm/ipatm/ipatm_vcm.c#6 (text+ko) ====
@@ -31,19 +31,20 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/netatm/ipatm/ipatm_vcm.c,v 1.16 2003/07/25 08:35:26 harti Exp $");
+__FBSDID("$FreeBSD: src/sys/netatm/ipatm/ipatm_vcm.c,v 1.17 2003/11/14 21:02:10 bde Exp $");
#include <sys/param.h>
-#include <sys/types.h>
#include <sys/systm.h>
-#include <sys/errno.h>
-#include <sys/time.h>
+#include <sys/malloc.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/syslog.h>
+
#include <net/if.h>
+
#include <netinet/in.h>
#include <netinet/in_var.h>
+
#include <netatm/port.h>
#include <netatm/queue.h>
#include <netatm/atm.h>
@@ -59,6 +60,7 @@
#include <netatm/ipatm/ipatm_var.h>
#include <netatm/ipatm/ipatm_serv.h>
+#include <vm/uma.h>
Atm_attributes ipatm_aal5llc = {
NULL, /* nif */
==== //depot/projects/hammer/sys/netinet/in_rmx.c#7 (text+ko) ====
@@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/netinet/in_rmx.c,v 1.48 2003/11/03 06:11:44 sam Exp $
+ * $FreeBSD: src/sys/netinet/in_rmx.c,v 1.49 2003/11/14 21:48:56 andre Exp $
*/
/*
@@ -134,13 +134,6 @@
}
}
- /*
- * If the new route created successfully, and we are forwarding,
- * flush any cached routes to avoid using a stale value.
- */
- if (ret != NULL && ipforwarding)
- ip_forward_cacheinval();
-
return ret;
}
==== //depot/projects/hammer/sys/netinet/in_var.h#4 (text+ko) ====
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)in_var.h 8.2 (Berkeley) 1/9/95
- * $FreeBSD: src/sys/netinet/in_var.h,v 1.47 2003/08/20 17:09:01 rwatson Exp $
+ * $FreeBSD: src/sys/netinet/in_var.h,v 1.48 2003/11/14 21:02:21 andre Exp $
*/
#ifndef _NETINET_IN_VAR_H_
@@ -230,9 +230,7 @@
void ip_input(struct mbuf *);
int in_ifadown(struct ifaddr *ifa, int);
void in_ifscrub(struct ifnet *, struct in_ifaddr *);
-int ipflow_fastforward(struct mbuf *);
-void ipflow_create(const struct route *, struct mbuf *);
-void ipflow_slowtimo(void);
+int ip_fastforward(struct mbuf *);
#endif /* _KERNEL */
==== //depot/projects/hammer/sys/netinet/ip_fw2.c#18 (text+ko) ====
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/netinet/ip_fw2.c,v 1.43 2003/11/07 23:26:57 sam Exp $
+ * $FreeBSD: src/sys/netinet/ip_fw2.c,v 1.44 2003/11/14 21:48:56 andre Exp $
*/
#define DEB(x)
@@ -1160,7 +1160,6 @@
struct mbuf *m;
struct ip *ip;
struct tcphdr *tcp;
- struct route sro; /* fake route */
MGETHDR(m, M_DONTWAIT, MT_HEADER);
if (m == 0)
@@ -1226,12 +1225,8 @@
*/
ip->ip_ttl = ip_defttl;
ip->ip_len = m->m_pkthdr.len;
- bzero (&sro, sizeof (sro));
- ip_rtaddr(ip->ip_dst, &sro);
m->m_flags |= M_SKIP_FIREWALL;
- ip_output(m, NULL, &sro, 0, NULL, NULL);
- if (sro.ro_rt)
- RTFREE(sro.ro_rt);
+ ip_output(m, NULL, NULL, 0, NULL, NULL);
}
/*
==== //depot/projects/hammer/sys/netinet/ip_icmp.c#10 (text+ko) ====
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94
- * $FreeBSD: src/sys/netinet/ip_icmp.c,v 1.82 2003/11/13 00:32:13 andre Exp $
+ * $FreeBSD: src/sys/netinet/ip_icmp.c,v 1.83 2003/11/14 21:48:57 andre Exp $
*/
#include "opt_ipsec.h"
@@ -120,7 +120,7 @@
#endif
static void icmp_reflect(struct mbuf *);
-static void icmp_send(struct mbuf *, struct mbuf *, struct route *);
+static void icmp_send(struct mbuf *, struct mbuf *);
static int ip_next_mtu(int, int);
extern struct protosw inetsw[];
@@ -615,7 +615,6 @@
struct in_addr t;
struct mbuf *opts = 0;
int optlen = (ip->ip_hl << 2) - sizeof(struct ip);
- struct route *ro = NULL, rt;
if (!in_canforward(ip->ip_src) &&
((ntohl(ip->ip_src.s_addr) & IN_CLASSA_NET) !=
@@ -626,8 +625,6 @@
}
t = ip->ip_dst;
ip->ip_dst = ip->ip_src;
- ro = &rt;
- bzero(ro, sizeof(*ro));
/*
* If the incoming packet was addressed directly to us,
* use dst as the src for the reply. Otherwise (broadcast
@@ -648,7 +645,7 @@
goto match;
}
}
- ia = ip_rtaddr(ip->ip_dst, ro);
+ ia = ip_rtaddr(ip->ip_dst);
/* We need a route to do anything useful. */
if (ia == NULL) {
m_freem(m);
@@ -738,12 +735,10 @@
}
m_tag_delete_nonpersistent(m);
m->m_flags &= ~(M_BCAST|M_MCAST);
- icmp_send(m, opts, ro);
+ icmp_send(m, opts);
done:
if (opts)
(void)m_free(opts);
- if (ro && ro->ro_rt)
- RTFREE(ro->ro_rt);
}
/*
@@ -751,10 +746,9 @@
* after supplying a checksum.
*/
static void
-icmp_send(m, opts, rt)
+icmp_send(m, opts)
register struct mbuf *m;
struct mbuf *opts;
- struct route *rt;
{
register struct ip *ip = mtod(m, struct ip *);
register int hlen;
@@ -777,7 +771,7 @@
buf, inet_ntoa(ip->ip_src));
}
#endif
- (void) ip_output(m, opts, rt, 0, NULL, NULL);
+ (void) ip_output(m, opts, NULL, 0, NULL, NULL);
}
n_time
==== //depot/projects/hammer/sys/netinet/ip_input.c#21 (text+ko) ====
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ip_input.c 8.2 (Berkeley) 1/4/94
- * $FreeBSD: src/sys/netinet/ip_input.c,v 1.252 2003/11/08 23:36:31 sam Exp $
+ * $FreeBSD: src/sys/netinet/ip_input.c,v 1.254 2003/11/14 21:48:57 andre Exp $
*/
#include "opt_bootp.h"
@@ -213,52 +213,6 @@
ip_dn_io_t *ip_dn_io_ptr;
/*
- * One deep route cache for ip forwarding. This is done
- * very inefficiently. We don't care as it's about to be
- * replaced by something better.
- */
-static struct rtcache {
- struct route rc_ro; /* most recently used route */
- struct mtx rc_mtx; /* update lock for cache */
-} ip_fwdcache;
-
-#define RTCACHE_LOCK() mtx_lock(&ip_fwdcache.rc_mtx)
-#define RTCACHE_UNLOCK() mtx_unlock(&ip_fwdcache.rc_mtx)
-#define RTCACHE_LOCK_INIT() \
- mtx_init(&ip_fwdcache.rc_mtx, "route cache", NULL, MTX_DEF)
-#define RTCACHE_LOCK_ASSERT() mtx_assert(&ip_fwdcache.rc_mtx, MA_OWNED)
-
-/*
- * Get a copy of the current route cache contents.
- */
-#define RTCACHE_GET(_ro) do { \
- struct rtentry *rt; \
- RTCACHE_LOCK(); \
- *(_ro) = ip_fwdcache.rc_ro; \
- if ((rt = (_ro)->ro_rt) != NULL) { \
- RT_LOCK(rt); \
- RT_ADDREF(rt); \
- RT_UNLOCK(rt); \
- } \
- RTCACHE_UNLOCK(); \
-} while (0)
-
-/*
- * Update the cache contents.
- */
-#define RTCACHE_UPDATE(_ro) do { \
- struct rtentry *rt; \
- RTCACHE_LOCK(); \
- rt = ip_fwdcache.rc_ro.ro_rt; \
- if ((_ro)->ro_rt != rt) { \
- ip_fwdcache.rc_ro = *(_ro); \
- if (rt) \
- RTFREE(rt); \
- } \
- RTCACHE_UNLOCK(); \
-} while (0)
-
-/*
* XXX this is ugly -- the following two global variables are
* used to store packet state while it travels through the stack.
* Note that the code even makes assumptions on the size and
@@ -282,7 +236,7 @@
static void save_rte(u_char *, struct in_addr);
static int ip_dooptions(struct mbuf *m, int,
struct sockaddr_in *next_hop);
-static void ip_forward(struct mbuf *m, struct route *, int srcrt,
+static void ip_forward(struct mbuf *m, int srcrt,
struct sockaddr_in *next_hop);
static void ip_freef(struct ipqhead *, struct ipq *);
static struct mbuf *ip_reass(struct mbuf *, struct ipqhead *,
@@ -323,9 +277,6 @@
for (i = 0; i < IPREASS_NHASH; i++)
TAILQ_INIT(&ipq[i]);
- bzero(&ip_fwdcache, sizeof(ip_fwdcache));
- RTCACHE_LOCK_INIT();
-
maxnipq = nmbclusters / 32;
maxfragsperpacket = 16;
@@ -338,39 +289,23 @@
}
/*
- * Invalidate any cached route used for forwarding.
- */
-void
-ip_forward_cacheinval(void)
-{
- struct rtentry *rt;
-
- RTCACHE_LOCK();
- rt = ip_fwdcache.rc_ro.ro_rt;
- ip_fwdcache.rc_ro.ro_rt = 0;
- if (rt != NULL)
- RTFREE(rt);
- RTCACHE_UNLOCK();
-}
-
-/*
* Ip input routine. Checksum and byte swap header. If fragmented
* try to reassemble. Process options. Pass to next level.
*/
void
ip_input(struct mbuf *m)
{
- struct ip *ip;
+ struct ip *ip = NULL;
struct ipq *fp;
struct in_ifaddr *ia = NULL;
struct ifaddr *ifa;
- int i, hlen, checkif;
+ int i, checkif, hlen = 0;
+ int ours = 0;
u_short sum;
struct in_addr pkt_dst;
u_int32_t divert_info = 0; /* packet divert/tee info */
struct ip_fw_args args;
- struct route cro; /* copy of cached route */
- int srcrt = 0; /* forward by ``src routing'' */
+ int dchg = 0; /* dest changed after fw */
#ifdef PFIL_HOOKS
struct in_addr odst; /* original dst address */
#endif
@@ -387,8 +322,18 @@
args.divert_rule = 0; /* divert cookie */
args.next_hop = NULL;
- /* Grab info from MT_TAG mbufs prepended to the chain. */
- for (; m && m->m_type == MT_TAG; m = m->m_next) {
+ /*
+ * Grab info from MT_TAG mbufs prepended to the chain.
+ *
+ * XXX: This is ugly. These pseudo mbuf prepend tags should really
+ * be real m_tags. Before these have always been allocated on the
+ * callers stack, so we didn't have to free them. Now with
+ * ip_fastforward they are true mbufs and we have to free them
+ * otherwise we have a leak. Must rewrite ipfw to use m_tags.
+ */
+ for (; m && m->m_type == MT_TAG;) {
+ struct mbuf *m0;
+
switch(m->_m_tag_id) {
default:
printf("ip_input: unrecognised MT_TAG tag %d\n",
@@ -406,11 +351,24 @@
case PACKET_TAG_IPFORWARD:
args.next_hop = (struct sockaddr_in *)m->m_hdr.mh_data;
break;
+
+ case PACKET_TAG_IPFASTFWD_OURS:
+ ours = 1;
+ break;
}
+
+ m0 = m;
+ m = m->m_next;
+ /* XXX: This is set by ip_fastforward */
+ if (m0->m_nextpkt == (struct mbuf *)1)
+ m_free(m0);
}
M_ASSERTPKTHDR(m);
+ if (ours) /* ip_fastforward firewall changed dest to local */
+ goto ours;
+
if (args.rule) { /* dummynet already filtered us */
ip = mtod(m, struct ip *);
hlen = ip->ip_hl << 2;
@@ -542,7 +500,7 @@
if (m == NULL) /* consumed by filter */
return;
ip = mtod(m, struct ip *);
- srcrt = (odst.s_addr != ip->ip_dst.s_addr);
+ dchg = (odst.s_addr != ip->ip_dst.s_addr);
#endif /* PFIL_HOOKS */
if (fw_enable && IPFW_LOADED) {
@@ -778,8 +736,7 @@
goto bad;
}
#endif /* FAST_IPSEC */
- RTCACHE_GET(&cro);
- ip_forward(m, &cro, srcrt, args.next_hop);
+ ip_forward(m, dchg, args.next_hop);
}
return;
@@ -1350,7 +1307,6 @@
}
}
IPQ_UNLOCK();
- ipflow_slowtimo();
splx(s);
}
@@ -1396,14 +1352,6 @@
struct in_addr *sin, dst;
n_time ntime;
struct sockaddr_in ipaddr = { sizeof(ipaddr), AF_INET };
- struct route cro; /* copy of cached route */
-
- /*
- * Grab a copy of the route cache in case we need
- * to update to reflect source routing or the like.
- * Could optimize this to do it later...
- */
- RTCACHE_GET(&cro);
dst = ip->ip_dst;
cp = (u_char *)(ip + 1);
@@ -1523,7 +1471,7 @@
if ((ia = (INA)ifa_ifwithdstaddr((SA)&ipaddr)) == 0)
ia = (INA)ifa_ifwithnet((SA)&ipaddr);
} else
- ia = ip_rtaddr(ipaddr.sin_addr, &cro);
+ ia = ip_rtaddr(ipaddr.sin_addr);
if (ia == 0) {
type = ICMP_UNREACH;
code = ICMP_UNREACH_SRCFAIL;
@@ -1565,7 +1513,7 @@
* use the incoming interface (should be same).
*/
if ((ia = (INA)ifa_ifwithaddr((SA)&ipaddr)) == 0 &&
- (ia = ip_rtaddr(ipaddr.sin_addr, &cro)) == 0) {
+ (ia = ip_rtaddr(ipaddr.sin_addr)) == 0) {
type = ICMP_UNREACH;
code = ICMP_UNREACH_HOST;
goto bad;
@@ -1645,7 +1593,7 @@
}
}
if (forward && ipforwarding) {
- ip_forward(m, &cro, 1, next_hop);
+ ip_forward(m, 1, next_hop);
return (1);
}
return (0);
@@ -1660,30 +1608,26 @@
* return internet address info of interface to be used to get there.
*/
struct in_ifaddr *
-ip_rtaddr(dst, rt)
+ip_rtaddr(dst)
struct in_addr dst;
- struct route *rt;
{
- register struct sockaddr_in *sin;
+ struct sockaddr_in *sin;
+ struct in_ifaddr *ifa;
+ struct route ro;
- sin = (struct sockaddr_in *)&rt->ro_dst;
+ bzero(&ro, sizeof(ro));
+ sin = (struct sockaddr_in *)&ro.ro_dst;
+ sin->sin_family = AF_INET;
+ sin->sin_len = sizeof(*sin);
+ sin->sin_addr = dst;
+ rtalloc_ign(&ro, (RTF_PRCLONING | RTF_CLONING));
- if (rt->ro_rt == 0 ||
- !(rt->ro_rt->rt_flags & RTF_UP) ||
- dst.s_addr != sin->sin_addr.s_addr) {
- if (rt->ro_rt) {
- RTFREE(rt->ro_rt);
- rt->ro_rt = 0;
- }
- sin->sin_family = AF_INET;
- sin->sin_len = sizeof(*sin);
- sin->sin_addr = dst;
+ if (ro.ro_rt == 0)
+ return ((struct in_ifaddr *)0);
- rtalloc_ign(rt, RTF_PRCLONING);
- }
- if (rt->ro_rt == 0)
- return ((struct in_ifaddr *)0);
- return (ifatoia(rt->ro_rt->rt_ifa));
+ ifa = ifatoia(ro.ro_rt->rt_ifa);
+ RTFREE(ro.ro_rt);
+ return ifa;
}
/*
@@ -1830,11 +1774,10 @@
* via a source route.
*/
static void
-ip_forward(struct mbuf *m, struct route *ro,
- int srcrt, struct sockaddr_in *next_hop)
+ip_forward(struct mbuf *m, int srcrt, struct sockaddr_in *next_hop)
{
struct ip *ip = mtod(m, struct ip *);
- struct rtentry *rt;
+ struct in_ifaddr *ia;
int error, type = 0, code = 0;
struct mbuf *mcopy;
n_long dest;
@@ -1844,7 +1787,6 @@
struct ifnet dummyifp;
#endif
- dest = 0;
/*
* Cache the destination address of the packet; this may be
* changed by use of 'ipfw fwd'.
@@ -1869,18 +1811,17 @@
#endif
if (ip->ip_ttl <= IPTTLDEC) {
icmp_error(m, ICMP_TIMXCEED, ICMP_TIMXCEED_INTRANS,
- dest, 0);
+ 0, 0);
return;
}
#ifdef IPSTEALTH
}
#endif
- if (ip_rtaddr(pkt_dst, ro) == 0) {
- icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, dest, 0);
+ if ((ia = ip_rtaddr(pkt_dst)) == 0) {
+ icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, 0, 0);
return;
- } else
- rt = ro->ro_rt;
+ }
/*
* Save the IP header and at most 8 bytes of the payload,
@@ -1931,27 +1872,44 @@
* Also, don't send redirect if forwarding using a default route
* or a route modified by a redirect.
*/
- if (rt->rt_ifp == m->m_pkthdr.rcvif &&
- (rt->rt_flags & (RTF_DYNAMIC|RTF_MODIFIED)) == 0 &&
- satosin(rt_key(rt))->sin_addr.s_addr != 0 &&
- ipsendredirects && !srcrt && !next_hop) {
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list