]> git.neil.brown.name Git - history.git/commitdiff
Import 2.2.15pre18 2.2.15pre18
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 23 Nov 2007 20:21:08 +0000 (15:21 -0500)
committerAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 23 Nov 2007 20:21:08 +0000 (15:21 -0500)
15 files changed:
Makefile
arch/alpha/kernel/alpha_ksyms.c
arch/alpha/kernel/smc37c669.c
arch/alpha/kernel/smp.c
arch/alpha/mm/extable.c
drivers/block/ide-pci.c
drivers/net/eepro100.c
drivers/net/rtl8139.c
include/asm-alpha/pgtable.h
include/linux/sysctl.h
include/net/br.h
masq.patch [new file with mode: 0644]
net/appletalk/aarp.c
net/ipv4/ip_masq.c
net/ipv4/sysctl_net_ipv4.c

index 2d6eb92e5cafa2f9e535c0d53faacf835d8e0055..d9a9a9c635f6d75b542076f18539455549fd1e98 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -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/)
 
index 52206c5d0f0e6f2fed0b65aa08fcdcf1c75c307c..6c87516116bc7f28a880fe0e018f907757946199 100644 (file)
@@ -160,6 +160,7 @@ EXPORT_SYMBOL(flush_tlb_all);
 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);
index caab7accc292aec42e1d9220e4a3e607d33c264b..0b2db18ab34c8bc49bf43e4366a9d67736ef256d 100644 (file)
@@ -2588,6 +2588,9 @@ void __init SMC669_Init ( int index )
         );
         SMC37c669_enable_device( FLOPPY_0 );
           
+       /* Wake up sometimes forgotten floppy, especially on DP264. */
+       outb(0xc, 0x3f2);
+
         SMC37c669_disable_device( IDE_0 );
 
 #if SMC_DEBUG
index e448d384066e420a91552fa9fa824bd07484ffc7..65ec8ce4b5e1874b20633918600ced0514086c68 100644 (file)
@@ -348,7 +348,7 @@ secondary_cpu_start(int cpuid, struct task_struct *idle)
        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 @@ handle_ipi(struct pt_regs *regs)
        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. */
@@ -838,6 +838,23 @@ smp_call_function (void (*func) (void *info), void *info, int retry, int wait)
        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
 ipi_flush_tlb_all(void *ignored)
 {
index 12a1f4803fd1f47a175d60c00a896946ba7fbe83..b0cb627ad6976a6b4f62e22324bcab94f6ec0a07 100644 (file)
@@ -41,7 +41,7 @@ search_exception_table(unsigned long addr)
 {
        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);
index 71d4801188a0cb7bf339460a4a2164a72b833483..7455f03557b339e9c7c939451407846d7b96db88 100644 (file)
@@ -245,7 +245,7 @@ __initfunc(static ide_hwif_t *ide_match_hwif (unsigned long io_base, byte bootab
                                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 */
index eefbcbac5ed6fc05716637bdaea4d690c0591314..5b6cad4254aa6ec9feb4eed03697f73757121d43 100644 (file)
@@ -335,7 +335,7 @@ struct pci_id_info {
    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);
 }
index c2da78a17f0dff212efc2bd4975662467c242264..710e1d345c81c3627e732d712b098be55dec8c87 100644 (file)
@@ -1136,6 +1136,15 @@ static void rtl8129_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
 
                        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;
index 41ced4b6cbf718a0d1dea847d268590ed3dbb2f5..889737c82494499666fb06d83896141ef0156c85 100644 (file)
 #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
index 00bebabefd75929efc0e41163166e975cfbf99a9..d4abfc53a8d56b9af7dd2392ae06980e15ad3b85 100644 (file)
@@ -227,7 +227,8 @@ enum
        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 {
index cbf4b4c3c472451e1ee82d70574e075a1e062e4a..c88681fbaf0ff65b04d7b0eabdefc8a441f4ff9c 100644 (file)
@@ -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 --git a/masq.patch b/masq.patch
new file mode 100644 (file)
index 0000000..7881f1e
--- /dev/null
@@ -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 ####
index 79c6c7e457ef59b998079e2b449eba1028349312..9adc8749310861100101cb38745c022db02140c1 100644 (file)
@@ -814,6 +814,7 @@ static int aarp_rcv(struct sk_buff *skb, struct device *dev, struct packet_type
        unsigned long flags;
        int hash;
        struct atalk_iface *ifa;
+       int func;
        
        
        /*
@@ -836,13 +837,13 @@ static int aarp_rcv(struct sk_buff *skb, struct device *dev, struct packet_type
                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 @@ static int aarp_rcv(struct sk_buff *skb, struct device *dev, struct packet_type
                        return 1;
                }
 
-       switch(ea->function)
+       switch(func)
        {
                case AARP_REPLY:        
                        if(unresolved_count==0) /* Speed up */
@@ -977,7 +978,7 @@ static int aarp_rcv(struct sk_buff *skb, struct device *dev, struct packet_type
                                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
index df8186cc676830692a6e1c270be95d090ee9c466..8d42ea8608c6899c50b91fd5fbbbcf92bd1ce9f3 100644 (file)
@@ -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 @@ struct ip_masq * ip_masq_new(int proto, __u32 maddr, __u16 mport, __u32 saddr, _
        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;
index 235b36d15a89b1d483c86d767a7a8dddc45d7ee6..fa4dc0912a11367ed7bc37d245c4afcb4cfbb150 100644 (file)
@@ -46,6 +46,7 @@ extern int sysctl_ip_always_defrag;
 
 /* 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 @@ ctl_table ipv4_table[] = {
 #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,