## Automatically generated incremental diff
## From:   linux-2.2.15-pre17
## To:     linux-2.2.15-pre18
## Robot:  $Id: make-incremental-diff,v 1.7 2001/12/04 05:19:54 hpa Exp $

diff -urN linux-2.2.15-pre17/Makefile linux/Makefile
--- linux-2.2.15-pre17/Makefile	Mon Dec  3 22:02:16 2001
+++ linux/Makefile	Mon Dec  3 22:02:22 2001
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 2
 SUBLEVEL = 15
-EXTRAVERSION = pre17
+EXTRAVERSION = pre18
 
 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
 
diff -urN linux-2.2.15-pre17/arch/alpha/kernel/alpha_ksyms.c linux/arch/alpha/kernel/alpha_ksyms.c
--- linux-2.2.15-pre17/arch/alpha/kernel/alpha_ksyms.c	Tue Jan  4 10:12:11 2000
+++ linux/arch/alpha/kernel/alpha_ksyms.c	Mon Dec  3 22:02:22 2001
@@ -160,6 +160,7 @@
 EXPORT_SYMBOL(flush_tlb_mm);
 EXPORT_SYMBOL(flush_tlb_page);
 EXPORT_SYMBOL(flush_tlb_range);
+EXPORT_SYMBOL(smp_imb);
 EXPORT_SYMBOL(cpu_data);
 EXPORT_SYMBOL(cpu_number_map);
 EXPORT_SYMBOL(global_bh_lock);
diff -urN linux-2.2.15-pre17/arch/alpha/kernel/smc37c669.c linux/arch/alpha/kernel/smc37c669.c
--- linux-2.2.15-pre17/arch/alpha/kernel/smc37c669.c	Sun Feb 21 19:06:36 1999
+++ linux/arch/alpha/kernel/smc37c669.c	Mon Dec  3 22:02:22 2001
@@ -2588,6 +2588,9 @@
         );
         SMC37c669_enable_device( FLOPPY_0 );
           
+	/* Wake up sometimes forgotten floppy, especially on DP264. */
+	outb(0xc, 0x3f2);
+
         SMC37c669_disable_device( IDE_0 );
 
 #if SMC_DEBUG
diff -urN linux-2.2.15-pre17/arch/alpha/kernel/smp.c linux/arch/alpha/kernel/smp.c
--- linux-2.2.15-pre17/arch/alpha/kernel/smp.c	Tue Jan  4 10:12:11 2000
+++ linux/arch/alpha/kernel/smp.c	Mon Dec  3 22:02:22 2001
@@ -348,7 +348,7 @@
 	hwpcb->res1 = hwpcb->res2 = 0;
 
 	DBGS(("KSP 0x%lx PTBR 0x%lx VPTBR 0x%lx UNIQUE 0x%lx\n",
-	      hwpcb->ksp, hwpcb->ptbr, hwrpb->vptb, hwcpb->unique));
+	      hwpcb->ksp, hwpcb->ptbr, hwrpb->vptb, hwpcb->unique));
 	DBGS(("Starting secondary cpu %d: state 0x%lx pal_flags 0x%lx\n",
 	      cpuid, idle->state, idle->tss.pal_flags));
 
@@ -704,7 +704,7 @@
 	unsigned long *pending_ipis = &ipi_data[this_cpu].bits;
 	unsigned long ops;
 
-	DBGS(("handle_ipi: on CPU %d ops 0x%x PC 0x%lx\n",
+	DBGS(("handle_ipi: on CPU %d ops 0x%lx PC 0x%lx\n",
 	      this_cpu, *pending_ipis, regs->pc));
 
 	mb();	/* Order interrupt and bit testing. */
@@ -836,6 +836,23 @@
 	}
 
 	return 0;
+}
+
+static void
+ipi_imb(void *ignored)
+{
+	imb();
+}
+
+void
+smp_imb(void)
+{
+	/* Must wait for other processors to flush their icache
+	   before continuing. */
+	if (smp_call_function(ipi_imb, NULL, 1, 1))
+		printk(KERN_CRIT "smp_imb: timed out\n");
+
+	imb();
 }
 
 static void
diff -urN linux-2.2.15-pre17/arch/alpha/mm/extable.c linux/arch/alpha/mm/extable.c
--- linux-2.2.15-pre17/arch/alpha/mm/extable.c	Thu Jan 23 11:01:28 1997
+++ linux/arch/alpha/mm/extable.c	Mon Dec  3 22:02:22 2001
@@ -41,7 +41,7 @@
 {
 	unsigned ret;
 
-#ifndef CONFIG_MODULE
+#ifndef CONFIG_MODULES
 	/* There is only the kernel to search.  */
 	ret = search_one_table(__start___ex_table, __stop___ex_table - 1,
 			       addr - gp);
diff -urN linux-2.2.15-pre17/drivers/block/ide-pci.c linux/drivers/block/ide-pci.c
--- linux-2.2.15-pre17/drivers/block/ide-pci.c	Mon Dec  3 22:02:16 2001
+++ linux/drivers/block/ide-pci.c	Mon Dec  3 22:02:22 2001
@@ -245,7 +245,7 @@
 				return hwif;	/* pick an unused entry */
 		}
 	}
-	for (h = 0; h < 2; ++h) {
+	for (h = 0; h < ((MAX_HWIFS >= 2) ? 2 : MAX_HWIFS); ++h) {
 		hwif = ide_hwifs + h;
 		if (hwif->chipset == ide_unknown)
 			return hwif;	/* pick an unused entry */
diff -urN linux-2.2.15-pre17/drivers/net/eepro100.c linux/drivers/net/eepro100.c
--- linux-2.2.15-pre17/drivers/net/eepro100.c	Mon Dec  3 22:02:16 2001
+++ linux/drivers/net/eepro100.c	Mon Dec  3 22:02:23 2001
@@ -335,7 +335,7 @@
    Typically this takes 0 ticks. */
 static inline void wait_for_cmd_done(long cmd_ioaddr)
 {
-	int wait = 100;
+	int wait = 1000;
 	do   ;
 	while(inb(cmd_ioaddr) && --wait >= 0);
 }
diff -urN linux-2.2.15-pre17/drivers/net/rtl8139.c linux/drivers/net/rtl8139.c
--- linux-2.2.15-pre17/drivers/net/rtl8139.c	Tue Oct 26 17:53:40 1999
+++ linux/drivers/net/rtl8139.c	Mon Dec  3 22:02:23 2001
@@ -1136,6 +1136,15 @@
 
 			if (status & (PCSTimeout)) tp->stats.rx_length_errors++;
 			if (status & (RxUnderrun|RxFIFOOver)) tp->stats.rx_fifo_errors++;
+
+			if (status & RxFIFOOver) {
+				tp->cur_rx = 0;
+				outb(CmdTxEnb, ioaddr + ChipCmd);
+				outb(CmdRxEnb | CmdTxEnb, ioaddr + ChipCmd);
+				outl((RX_FIFO_THRESH << 13) | (RX_BUF_LEN_IDX << 11) |
+				 (RX_DMA_BURST<<8), ioaddr + RxConfig);
+			}
+
 			if (status & RxOverflow) {
 				tp->stats.rx_over_errors++;
 				tp->cur_rx = inw(ioaddr + RxBufAddr) % RX_BUF_LEN;
diff -urN linux-2.2.15-pre17/include/asm-alpha/pgtable.h linux/include/asm-alpha/pgtable.h
--- linux-2.2.15-pre17/include/asm-alpha/pgtable.h	Mon Dec  3 22:02:17 2001
+++ linux/include/asm-alpha/pgtable.h	Mon Dec  3 22:02:23 2001
@@ -17,14 +17,29 @@
 #include <asm/spinlock.h>	/* For the task lock */
 
 
-/* Caches aren't brain-dead on the Alpha. */
-#define flush_cache_all()			do { } while (0)
+/* The icache is not coherent with the dcache on an Alpha, thus before
+   running self modified code we must always issue an imb(). Actually
+   flush_cache_all() is real overkill as it's recalled from vmalloc() before
+   accessing pagetables and on the Alpha we are not required to flush the
+   icache before doing that, but the semantic of flush_cache_all() requires
+   us to flush _all_ the caches and so we must be correct here. It's instead
+   vmalloc that should be changed to use a more finegrained cache flush
+   operation (I suspect that also other archs doesn't need an icache flush
+   while handling pagetables). OTOH vmalloc is not a performance critical
+   path so after all we can live with it for now. */
+
+#define flush_cache_all()                      flush_icache_range(0, 0)
 #define flush_cache_mm(mm)			do { } while (0)
 #define flush_cache_range(mm, start, end)	do { } while (0)
 #define flush_cache_page(vma, vmaddr)		do { } while (0)
 #define flush_page_to_ram(page)			do { } while (0)
-#define flush_icache_range(start, end)		do { } while (0)
 #define flush_dcache_page(page)			do { } while (0)
+#ifndef __SMP__
+#define flush_icache_range(start, end)		imb()
+#else
+#define flush_icache_range(start, end)		smp_imb()
+extern void smp_imb(void);
+#endif
 
 /*
  * Use a few helper functions to hide the ugly broken ASN
diff -urN linux-2.2.15-pre17/include/linux/sysctl.h linux/include/linux/sysctl.h
--- linux-2.2.15-pre17/include/linux/sysctl.h	Tue Jan  4 10:12:25 2000
+++ linux/include/linux/sysctl.h	Mon Dec  3 22:02:24 2001
@@ -227,7 +227,8 @@
 	NET_IPV4_ICMP_ECHOREPLY_RATE=63,
 	NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES=64,
 	NET_IPV4_IGMP_MAX_MEMBERSHIPS=65,
-	NET_IPV4_ALWAYS_DEFRAG=67
+	NET_IPV4_ALWAYS_DEFRAG=67,
+	NET_IPV4_IP_MASQ_UDP_DLOOSE=68
 };
 
 enum {
diff -urN linux-2.2.15-pre17/include/net/br.h linux/include/net/br.h
--- linux-2.2.15-pre17/include/net/br.h	Tue Jan  4 10:12:25 2000
+++ linux/include/net/br.h	Mon Dec  3 22:02:24 2001
@@ -50,7 +50,7 @@
 #define HOLD_TIME		1
 
 /* broacast/multicast storm limitation. This per source. */
-#define MAX_MCAST_PER_PERIOD    4
+#define MAX_MCAST_PER_PERIOD    32
 #define MCAST_HOLD_TIME		(10*HZ/100)
 
 #define Default_path_cost 10
diff -urN linux-2.2.15-pre17/masq.patch linux/masq.patch
--- linux-2.2.15-pre17/masq.patch	Wed Dec 31 16:00:00 1969
+++ linux/masq.patch	Mon Dec  3 22:02:24 2001
@@ -0,0 +1,96 @@
+# This is a patch for linux-2.2.15pre16 to update it to linux-2.2.15pre16.masq
+# 
+# To apply this patch:
+# STEP 1: Chdir to the source directory.
+# STEP 2: Run the 'applypatch' program with this patch file as input.
+#
+# If you do not have 'applypatch', it is part of the 'makepatch' package
+# that you can fetch from the Comprehensive Perl Archive Network:
+# http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz
+# In the above URL, 'x' should be 2 or higher.
+#
+# To apply this patch without the use of 'applypatch':
+# STEP 1: Chdir to the source directory.
+# STEP 2: Run the 'patch' program with this file as input.
+#
+#### End of Preamble ####
+
+#### Patch data follows ####
+diff -u 'linux-2.2.15pre16/Documentation/Configure.help' 'linux-2.2.15pre16.masq/Documentation/Configure.help'
+Index: ./Documentation/Configure.help
+--- ./Documentation/Configure.help	Fri Mar 31 09:34:45 2000
++++ ./Documentation/Configure.help	Fri Mar 31 09:50:34 2000
+@@ -2550,6 +2550,20 @@
+   kernel whenever you want; read Documentation/modules.txt for
+   details.
+ 
++IP: UDP masquerading loose checking
++CONFIG_IP_MASQUERADE_UDP_LOOSE
++  Whether UDP masquerading does address checking in a loose fashion.
++
++  If you say Y here, then UDP masqueraded connections will allow
++  any external system to be connect back through the firewall to the
++  port on the internal machine.  However it will allow the more
++  efficient use of masqueraded ports, and may be required for some
++  gaming uses.
++
++  You should only say Y here if you understand the consequences since
++  it will open your internal network to external probing and potential
++  attacks.  In all other cases choose N
++
+ IP: ICMP masquerading
+ CONFIG_IP_MASQUERADE_ICMP
+   The basic masquerade code described for "IP: masquerading" above
+diff -u 'linux-2.2.15pre16/net/ipv4/Config.in' 'linux-2.2.15pre16.masq/net/ipv4/Config.in'
+Index: ./net/ipv4/Config.in
+--- ./net/ipv4/Config.in	Fri Mar 31 09:34:03 2000
++++ ./net/ipv4/Config.in	Fri Mar 31 09:52:26 2000
+@@ -41,6 +41,7 @@
+     bool 'IP: masquerading' CONFIG_IP_MASQUERADE
+     if [ "$CONFIG_IP_MASQUERADE" != "n" ]; then
+       comment 'Protocol-specific masquerading support will be built as modules.'
++      bool 'IP: UDP masquerading loose checking' CONFIG_IP_MASQUERADE_UDP_LOOSE
+       bool 'IP: ICMP masquerading' CONFIG_IP_MASQUERADE_ICMP
+       comment 'Protocol-specific masquerading support will be built as modules.'
+       if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+diff -u 'linux-2.2.15pre16/net/ipv4/ip_masq.c' 'linux-2.2.15pre16.masq/net/ipv4/ip_masq.c'
+Index: ./net/ipv4/ip_masq.c
+Prereq:  1.34.2.2 
+--- ./net/ipv4/ip_masq.c	Fri Mar 31 09:34:19 2000
++++ ./net/ipv4/ip_masq.c	Fri Mar 31 14:38:17 2000
+@@ -412,12 +412,6 @@
+ #define MASQ_DPORT_PASS	(IP_MASQ_F_NO_DPORT|IP_MASQ_F_DLOOSE)
+ 
+ /*
+- *	By default enable dest loose semantics
+- */
+-#define CONFIG_IP_MASQ_LOOSE_DEFAULT 1
+-
+-
+-/*
+  * 	Set masq expiration (deletion) and adds timer,
+  *	if timeout==0 cancel expiration.
+  *	Warning: it does not check/delete previous timer!
+@@ -937,7 +931,7 @@
+ 	atomic_set(&ms->refcnt,0);
+ 
+         if (proto == IPPROTO_UDP && !mport)
+-#ifdef CONFIG_IP_MASQ_LOOSE_DEFAULT
++#ifdef CONFIG_IP_MASQUERADE_UDP_LOOSE
+ 		/*
+ 		 *	Flag this tunnel as "dest loose"
+ 		 *	
+#### End of Patch data ####
+
+#### ApplyPatch data follows ####
+# Data version        : 1.0
+# Date generated      : Fri Mar 31 14:38:26 2000
+# Generated by        : makepatch 2.00
+# Recurse directories : Yes
+# p 'Documentation/Configure.help' 565235 954492634 0100644
+# p 'net/ipv4/Config.in' 3618 954492746 0100644
+# p 'net/ipv4/ip_masq.c' 65999 954509897 0100644
+#### End of ApplyPatch data ####
+
+#### End of Patch kit [created: Fri Mar 31 14:38:26 2000] ####
+#### Checksum: 95 3735 33457 ####
diff -urN linux-2.2.15-pre17/net/appletalk/aarp.c linux/net/appletalk/aarp.c
--- linux-2.2.15-pre17/net/appletalk/aarp.c	Mon Apr 12 16:18:26 1999
+++ linux/net/appletalk/aarp.c	Mon Dec  3 22:02:24 2001
@@ -814,6 +814,7 @@
 	unsigned long flags;
 	int hash;
 	struct atalk_iface *ifa;
+	int func;
 	
 	
 	/*
@@ -836,13 +837,13 @@
 		return 0;
 	}
 
-	ea->function=ntohs(ea->function);
+	func=ntohs(ea->function);
 	
 	/*
 	 *	Sanity check fields.
 	 */
 	 
-	if(ea->function<AARP_REQUEST || ea->function > AARP_PROBE || ea->hw_len != ETH_ALEN || ea->pa_len != AARP_PA_ALEN ||
+	if(func<AARP_REQUEST || func > AARP_PROBE || ea->hw_len != ETH_ALEN || ea->pa_len != AARP_PA_ALEN ||
 		ea->pa_src_zero != 0 || ea->pa_dst_zero != 0)
 	{
 		kfree_skb(skb);
@@ -920,7 +921,7 @@
 			return 1;
 		}
 
-	switch(ea->function)
+	switch(func)
 	{
 		case AARP_REPLY:	
 			if(unresolved_count==0)	/* Speed up */
@@ -977,7 +978,7 @@
 				ma = &da;
 			}
 
-			if(ea->function==AARP_PROBE)
+			if(func==AARP_PROBE)
 			{
 				/* A probe implies someone trying to get an
 				   address. So as a precaution flush any
diff -urN linux-2.2.15-pre17/net/ipv4/ip_masq.c linux/net/ipv4/ip_masq.c
--- linux-2.2.15-pre17/net/ipv4/ip_masq.c	Mon Dec  3 22:02:17 2001
+++ linux/net/ipv4/ip_masq.c	Mon Dec  3 22:02:24 2001
@@ -74,6 +74,7 @@
 #include <net/tcp.h>
 #include <net/udp.h>
 #include <net/checksum.h>
+#include <net/sock.h>
 #include <net/ip_masq.h>
 
 #ifdef CONFIG_IP_MASQUERADE_MOD
@@ -85,6 +86,7 @@
 #include <linux/ip_masq.h>
 
 int sysctl_ip_masq_debug = 0;
+int sysctl_ip_masq_udp_dloose = 0;
 
 /*
  *	Exported wrapper 
@@ -930,17 +932,29 @@
 	atomic_set(&ms->n_control,0);
 	atomic_set(&ms->refcnt,0);
 
-        if (proto == IPPROTO_UDP && !mport)
-#ifdef CONFIG_IP_MASQUERADE_UDP_LOOSE
-		/*
-		 *	Flag this tunnel as "dest loose"
-		 *	
-		 */
-		ms->flags |= IP_MASQ_F_DLOOSE;
-#else
-                ms->flags |= IP_MASQ_F_NO_DADDR;
-#endif
+        if (proto == IPPROTO_UDP && !mport) {
 
+		switch( sysctl_ip_masq_udp_dloose ) {
+		case 2:
+			/*
+		 	*	Flag this tunnel as "dest loose"
+		 	*	
+		 	*/
+			ms->flags |= IP_MASQ_F_DLOOSE;
+			break;
+		case 1:
+			if( ntohs(sport) < PROT_SOCK ) {
+				ms->flags |= IP_MASQ_F_NO_DADDR;
+			}
+			else {
+				ms->flags |= IP_MASQ_F_DLOOSE;
+			}
+			break;
+		default:
+			ms->flags |= IP_MASQ_F_NO_DADDR;
+			break;
+		}
+	}
         
         /* get masq address from rif */
         ms->maddr	   = maddr;
diff -urN linux-2.2.15-pre17/net/ipv4/sysctl_net_ipv4.c linux/net/ipv4/sysctl_net_ipv4.c
--- linux-2.2.15-pre17/net/ipv4/sysctl_net_ipv4.c	Tue Oct 26 17:53:42 1999
+++ linux/net/ipv4/sysctl_net_ipv4.c	Mon Dec  3 22:02:24 2001
@@ -46,6 +46,7 @@
 
 /* From ip_masq.c */
 extern int sysctl_ip_masq_debug;
+extern int sysctl_ip_masq_udp_dloose;
 
 extern int sysctl_tcp_timestamps;
 extern int sysctl_tcp_window_scaling;
@@ -149,6 +150,8 @@
 #ifdef CONFIG_IP_MASQUERADE
 	{NET_IPV4_IP_MASQ_DEBUG, "ip_masq_debug",
 	 &sysctl_ip_masq_debug, sizeof(int), 0644, NULL, &proc_dointvec},
+	{NET_IPV4_IP_MASQ_UDP_DLOOSE, "ip_masq_udp_dloose",
+	 &sysctl_ip_masq_udp_dloose, sizeof(int), 0644, NULL, &proc_dointvec},
 #endif
 	{NET_IPV4_IPFRAG_TIME, "ipfrag_time",
 	 &sysctl_ipfrag_time, sizeof(int), 0644, NULL, &proc_dointvec_jiffies, 
