]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'fixes-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville...
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 30 Nov 2007 12:29:27 +0000 (23:29 +1100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 30 Nov 2007 12:29:27 +0000 (23:29 +1100)
80 files changed:
MAINTAINERS
Makefile
README
arch/x86/Kconfig
arch/x86/kernel/acpi/boot.c
arch/x86/kernel/cpu/mcheck/mce_64.c
arch/x86/kernel/cpu/proc.c
arch/x86/kernel/reboot_fixups_32.c
arch/x86/kernel/setup_64.c
arch/x86/kernel/time_64.c
arch/x86/mach-voyager/voyager_cat.c
arch/x86/mach-voyager/voyager_smp.c
arch/x86/pci/acpi.c
arch/x86/vdso/vgetcpu.c
drivers/atm/he.c
drivers/net/sungem.c
drivers/net/wireless/rt2x00/rt2500usb.c
drivers/net/wireless/rt2x00/rt2x00.h
drivers/net/wireless/rt2x00/rt2x00usb.c
drivers/net/wireless/rt2x00/rt73usb.c
include/asm-x86/mach-default/mach_reboot.h
include/asm-x86/mach-es7000/mach_mpparse.h
include/asm-x86/mach-voyager/setup_arch.h
include/linux/skbuff.h
include/linux/sunrpc/xprtsock.h
include/net/ieee80211.h
include/net/inet_hashtables.h
include/net/ip_vs.h
include/net/sctp/constants.h
include/net/sock.h
include/net/tcp.h
kernel/sys.c
kernel/sysctl_check.c
kernel/time/ntp.c
net/8021q/vlan_dev.c
net/bridge/br.c
net/bridge/br_input.c
net/bridge/netfilter/ebt_among.c
net/bridge/netfilter/ebtable_broute.c
net/core/pktgen.c
net/core/skbuff.c
net/dccp/ccids/lib/loss_interval.c
net/ieee80211/ieee80211_crypt_ccmp.c
net/ieee80211/ieee80211_crypt_tkip.c
net/ipv4/arp.c
net/ipv4/inet_diag.c
net/ipv4/ipvs/ip_vs_core.c
net/ipv4/ipvs/ip_vs_ctl.c
net/ipv4/ipvs/ip_vs_lblc.c
net/ipv4/ipvs/ip_vs_lblcr.c
net/ipv4/ipvs/ip_vs_proto.c
net/ipv4/netfilter/iptable_raw.c
net/ipv4/netfilter/nf_nat_core.c
net/ipv4/route.c
net/ipv4/sysctl_net_ipv4.c
net/ipv4/tcp_illinois.c
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_output.c
net/ipv6/addrconf.c
net/ipv6/tcp_ipv6.c
net/irda/iriap.c
net/irda/irlan/irlan_eth.c
net/key/af_key.c
net/mac80211/ieee80211.c
net/mac80211/ieee80211_sta.c
net/sctp/Kconfig
net/sctp/auth.c
net/sctp/sm_make_chunk.c
net/sctp/sm_statefuns.c
net/sunrpc/auth_gss/auth_gss.c
net/sunrpc/xprt.c
net/sunrpc/xprtsock.c
net/unix/af_unix.c
net/wireless/wext.c
net/xfrm/xfrm_policy.c
net/xfrm/xfrm_state.c
net/xfrm/xfrm_user.c
scripts/kconfig/conf.c
scripts/kconfig/confdata.c
scripts/kconfig/lkc_proto.h

index cad0882754a68ebee704d42e2ec34cb1155a6b14..695551a1519d6036476dbf87ff69344456d38d1b 100644 (file)
@@ -3733,7 +3733,7 @@ S:        Maintained
 TLAN NETWORK DRIVER
 P:     Samuel Chessman
 M:     chessman@tux.org
-L:     tlan-devel@lists.sourceforge.net
+L:     tlan-devel@lists.sourceforge.net (subscribers-only)
 W:     http://sourceforge.net/projects/tlan/
 S:     Maintained
 
index 7f969303ed492f9cb5cfa727086df9884cfe5c91..a65ffd27de6b5f6786f2d17cc716f003efa628b9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -200,11 +200,9 @@ SRCARCH    := $(ARCH)
 # Additional ARCH settings for x86
 ifeq ($(ARCH),i386)
         SRCARCH := x86
-        K64BIT  := n
 endif
 ifeq ($(ARCH),x86_64)
         SRCARCH := x86
-        K64BIT  := y
 endif
 
 KCONFIG_CONFIG ?= .config
@@ -341,7 +339,7 @@ KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
 KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
 export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION
-export ARCH SRCARCH K64BIT CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
+export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
 export CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE
 export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
 
@@ -1334,12 +1332,7 @@ else
 ALLINCLUDE_ARCHS := $(ALLSOURCE_ARCHS)
 endif
 
-# Take care of arch/x86
-ifeq ($(ARCH), $(SRCARCH))
-ALLSOURCE_ARCHS := $(ARCH)
-else
-ALLSOURCE_ARCHS := $(ARCH) $(SRCARCH)
-endif
+ALLSOURCE_ARCHS := $(SRCARCH)
 
 define find-sources
         ( for arch in $(ALLSOURCE_ARCHS) ; do \
diff --git a/README b/README
index 592f8a2382817a233b2ece0577694d585229a1f7..159912cf515549455ed5f579b8825d28962bd22e 100644 (file)
--- a/README
+++ b/README
@@ -194,8 +194,6 @@ CONFIGURING the kernel:
    "make *config" checks for a file named "all{yes/mod/no/random}.config"
    for symbol values that are to be forced.  If this file is not found,
    it checks for a file named "all.config" to contain forced values.
-   Finally it checks the environment variable K64BIT and if found, sets
-   the config symbol "64BIT" to the value of the K64BIT variable.
    
        NOTES on "make config":
        - having unnecessary drivers will make the kernel bigger, and can
index 1eb59971af5d77364dfd32c4c2beae5b6ae94018..368864dfe6eb635ef210f046ec351f04e96f42ef 100644 (file)
@@ -3,8 +3,8 @@ mainmenu "Linux Kernel Configuration for x86"
 
 # Select 32 or 64 bit
 config 64BIT
-       bool "64-bit kernel"
-       default n
+       bool "64-bit kernel" if ARCH = "x86"
+       default ARCH = "x86_64"
        help
          Say yes to build a 64-bit kernel - formerly known as x86_64
          Say no to build a 32-bit kernel - formerly known as i386
index 289247d974c60fe77ed4b989a2a2634734392ab9..0ca27c7b0e8db00335d47dc158557bf4915aede6 100644 (file)
@@ -637,6 +637,38 @@ static int __init acpi_parse_hpet(struct acpi_table_header *table)
        }
 
        hpet_address = hpet_tbl->address.address;
+
+       /*
+        * Some broken BIOSes advertise HPET at 0x0. We really do not
+        * want to allocate a resource there.
+        */
+       if (!hpet_address) {
+               printk(KERN_WARNING PREFIX
+                      "HPET id: %#x base: %#lx is invalid\n",
+                      hpet_tbl->id, hpet_address);
+               return 0;
+       }
+#ifdef CONFIG_X86_64
+       /*
+        * Some even more broken BIOSes advertise HPET at
+        * 0xfed0000000000000 instead of 0xfed00000. Fix it up and add
+        * some noise:
+        */
+       if (hpet_address == 0xfed0000000000000UL) {
+               if (!hpet_force_user) {
+                       printk(KERN_WARNING PREFIX "HPET id: %#x "
+                              "base: 0xfed0000000000000 is bogus\n "
+                              "try hpet=force on the kernel command line to "
+                              "fix it up to 0xfed00000.\n", hpet_tbl->id);
+                       hpet_address = 0;
+                       return 0;
+               }
+               printk(KERN_WARNING PREFIX
+                      "HPET id: %#x base: 0xfed0000000000000 fixed up "
+                      "to 0xfed00000.\n", hpet_tbl->id);
+               hpet_address >>= 32;
+       }
+#endif
        printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
               hpet_tbl->id, hpet_address);
 
index 447b351f1f2aefcb07ea7b68b6456f50d20f5336..4b21d29fb5aa575b6146132db6dadd319ac5ca4a 100644 (file)
@@ -810,7 +810,7 @@ static __cpuinit int mce_create_device(unsigned int cpu)
        int err;
        int i;
 
-       if (!mce_available(&cpu_data(cpu)))
+       if (!mce_available(&boot_cpu_data))
                return -EIO;
 
        memset(&per_cpu(device_mce, cpu).kobj, 0, sizeof(struct kobject));
index 066f8c6af4dfa0e92370aed065f41ca3d84d83d4..3900e46d66db4c91ea8b898504af963dc3ff4df4 100644 (file)
@@ -89,8 +89,6 @@ static int show_cpuinfo(struct seq_file *m, void *v)
        int fpu_exception;
 
 #ifdef CONFIG_SMP
-       if (!cpu_online(n))
-               return 0;
        n = c->cpu_index;
 #endif
        seq_printf(m, "processor\t: %d\n"
@@ -177,14 +175,14 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 static void *c_start(struct seq_file *m, loff_t *pos)
 {
        if (*pos == 0)  /* just in case, cpu 0 is not the first */
-               *pos = first_cpu(cpu_possible_map);
-       if ((*pos) < NR_CPUS && cpu_possible(*pos))
+               *pos = first_cpu(cpu_online_map);
+       if ((*pos) < NR_CPUS && cpu_online(*pos))
                return &cpu_data(*pos);
        return NULL;
 }
 static void *c_next(struct seq_file *m, void *v, loff_t *pos)
 {
-       *pos = next_cpu(*pos, cpu_possible_map);
+       *pos = next_cpu(*pos, cpu_online_map);
        return c_start(m, pos);
 }
 static void c_stop(struct seq_file *m, void *v)
index 1a07bbea7be36eadcea68843d7b727eaa03ee9a4..f452726c0fe276c2482e79b70ac1a1caedec7c5d 100644 (file)
@@ -39,6 +39,7 @@ struct device_fixup {
 static struct device_fixup fixups_table[] = {
 { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY, cs5530a_warm_reset },
 { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_ISA, cs5536_warm_reset },
+{ PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_SC1100_BRIDGE, cs5530a_warm_reset },
 };
 
 /*
index 238633d3d09a7ac1d8a6427d2e26c3ce773291e8..30d94d1d5f5f38e222b8ac7e4a869a6e0ee91b01 100644 (file)
@@ -892,7 +892,6 @@ void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c)
 
 #ifdef CONFIG_SMP
        c->phys_proc_id = (cpuid_ebx(1) >> 24) & 0xff;
-       c->cpu_index = 0;
 #endif
 }
 
@@ -1078,8 +1077,6 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 
 
 #ifdef CONFIG_SMP
-       if (!cpu_online(c->cpu_index))
-               return 0;
        cpu = c->cpu_index;
 #endif
 
@@ -1171,15 +1168,15 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 static void *c_start(struct seq_file *m, loff_t *pos)
 {
        if (*pos == 0)  /* just in case, cpu 0 is not the first */
-               *pos = first_cpu(cpu_possible_map);
-       if ((*pos) < NR_CPUS && cpu_possible(*pos))
+               *pos = first_cpu(cpu_online_map);
+       if ((*pos) < NR_CPUS && cpu_online(*pos))
                return &cpu_data(*pos);
        return NULL;
 }
 
 static void *c_next(struct seq_file *m, void *v, loff_t *pos)
 {
-       *pos = next_cpu(*pos, cpu_possible_map);
+       *pos = next_cpu(*pos, cpu_online_map);
        return c_start(m, pos);
 }
 
index c821edc32216b88c674d2a704f105fdf063c1014..368b1942b39aba509cfafe7fae629ef400a7a243 100644 (file)
@@ -82,18 +82,15 @@ static int set_rtc_mmss(unsigned long nowtime)
        int retval = 0;
        int real_seconds, real_minutes, cmos_minutes;
        unsigned char control, freq_select;
+       unsigned long flags;
 
 /*
- * IRQs are disabled when we're called from the timer interrupt,
- * no need for spin_lock_irqsave()
+ * set_rtc_mmss is called when irqs are enabled, so disable irqs here
  */
-
-       spin_lock(&rtc_lock);
-
+       spin_lock_irqsave(&rtc_lock, flags);
 /*
  * Tell the clock it's being set and stop it.
  */
-
        control = CMOS_READ(RTC_CONTROL);
        CMOS_WRITE(control | RTC_SET, RTC_CONTROL);
 
@@ -138,7 +135,7 @@ static int set_rtc_mmss(unsigned long nowtime)
        CMOS_WRITE(control, RTC_CONTROL);
        CMOS_WRITE(freq_select, RTC_FREQ_SELECT);
 
-       spin_unlock(&rtc_lock);
+       spin_unlock_irqrestore(&rtc_lock, flags);
 
        return retval;
 }
@@ -164,21 +161,27 @@ unsigned long read_persistent_clock(void)
        unsigned century = 0;
 
        spin_lock_irqsave(&rtc_lock, flags);
+       /*
+        * if UIP is clear, then we have >= 244 microseconds before RTC
+        * registers will be updated.  Spec sheet says that this is the
+        * reliable way to read RTC - registers invalid (off bus) during update
+        */
+       while ((CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP))
+               cpu_relax();
 
-       do {
-               sec = CMOS_READ(RTC_SECONDS);
-               min = CMOS_READ(RTC_MINUTES);
-               hour = CMOS_READ(RTC_HOURS);
-               day = CMOS_READ(RTC_DAY_OF_MONTH);
-               mon = CMOS_READ(RTC_MONTH);
-               year = CMOS_READ(RTC_YEAR);
+
+       /* now read all RTC registers while stable with interrupts disabled */
+       sec = CMOS_READ(RTC_SECONDS);
+       min = CMOS_READ(RTC_MINUTES);
+       hour = CMOS_READ(RTC_HOURS);
+       day = CMOS_READ(RTC_DAY_OF_MONTH);
+       mon = CMOS_READ(RTC_MONTH);
+       year = CMOS_READ(RTC_YEAR);
 #ifdef CONFIG_ACPI
-               if (acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID &&
-                                       acpi_gbl_FADT.century)
-                       century = CMOS_READ(acpi_gbl_FADT.century);
+       if (acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID &&
+                               acpi_gbl_FADT.century)
+               century = CMOS_READ(acpi_gbl_FADT.century);
 #endif
-       } while (sec != CMOS_READ(RTC_SECONDS));
-
        spin_unlock_irqrestore(&rtc_lock, flags);
 
        /*
index 26a2d4c54b684e8d3da8f451ad3c2be9e1ce262c..2132ca652df1d65de50fefab33bb81bde854c3db 100644 (file)
@@ -568,7 +568,7 @@ static voyager_module_t *voyager_initial_module;
  * boot cpu *after* all memory initialisation has been done (so we can
  * use kmalloc) but before smp initialisation, so we can probe the SMP
  * configuration and pick up necessary information.  */
-void
+void __init
 voyager_cat_init(void)
 {
        voyager_module_t **modpp = &voyager_initial_module;
index 69371434b0cfe9b3f2622b539423faa93cb44939..88124dd35406d2484f999c837833d4a9c270ba03 100644 (file)
@@ -1900,7 +1900,7 @@ voyager_smp_prepare_cpus(unsigned int max_cpus)
        smp_boot_cpus();
 }
 
-static void __devinit voyager_smp_prepare_boot_cpu(void)
+static void __cpuinit voyager_smp_prepare_boot_cpu(void)
 {
        init_gdt(smp_processor_id());
        switch_to_new_gdt();
@@ -1911,7 +1911,7 @@ static void __devinit voyager_smp_prepare_boot_cpu(void)
        cpu_set(smp_processor_id(), cpu_present_map);
 }
 
-static int __devinit
+static int __cpuinit
 voyager_cpu_up(unsigned int cpu)
 {
        /* This only works at boot for x86.  See "rewrite" above. */
index 2d88f7c6d6ac901a3f2f2ffe2f64f680706b435a..7e35078673a4a43f83fb70143cfb131eeb1e88c9 100644 (file)
@@ -77,6 +77,9 @@ count_resource(struct acpi_resource *acpi_res, void *data)
        struct acpi_resource_address64 addr;
        acpi_status status;
 
+       if (info->res_num >= PCI_BUS_NUM_RESOURCES)
+               return AE_OK;
+
        status = resource_to_addr(acpi_res, &addr);
        if (ACPI_SUCCESS(status))
                info->res_num++;
@@ -93,6 +96,9 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
        unsigned long flags;
        struct resource *root;
 
+       if (info->res_num >= PCI_BUS_NUM_RESOURCES)
+               return AE_OK;
+
        status = resource_to_addr(acpi_res, &addr);
        if (!ACPI_SUCCESS(status))
                return AE_OK;
index 91f6e85d0fc2d7219c15816749337c64041ea3a2..3b1ae1abfba9abc1f00332ccb6c7af0805a8e403 100644 (file)
 #include <asm/vgtod.h>
 #include "vextern.h"
 
-long __vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *tcache)
+long __vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused)
 {
        unsigned int dummy, p;
-       unsigned long j = 0;
 
-       /* Fast cache - only recompute value once per jiffies and avoid
-          relatively costly rdtscp/cpuid otherwise.
-          This works because the scheduler usually keeps the process
-          on the same CPU and this syscall doesn't guarantee its
-          results anyways.
-          We do this here because otherwise user space would do it on
-          its own in a likely inferior way (no access to jiffies).
-          If you don't like it pass NULL. */
-       if (tcache && tcache->blob[0] == (j = *vdso_jiffies)) {
-               p = tcache->blob[1];
-       } else if (*vdso_vgetcpu_mode == VGETCPU_RDTSCP) {
+       if (*vdso_vgetcpu_mode == VGETCPU_RDTSCP) {
                /* Load per CPU data from RDTSCP */
                rdtscp(dummy, dummy, p);
        } else {
                /* Load per CPU data from GDT */
                asm("lsl %1,%0" : "=r" (p) : "r" (__PER_CPU_SEG));
        }
-       if (tcache) {
-               tcache->blob[0] = j;
-               tcache->blob[1] = p;
-       }
        if (cpu)
                *cpu = p & 0xfff;
        if (node)
index d33aba6864c247e34a05f3dd94db131a2c62fc50..3b64a99772ea826187dbc792875332722f77f94b 100644 (file)
@@ -394,6 +394,11 @@ he_init_one(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent)
        he_dev->atm_dev->dev_data = he_dev;
        atm_dev->dev_data = he_dev;
        he_dev->number = atm_dev->number;
+#ifdef USE_TASKLET
+       tasklet_init(&he_dev->tasklet, he_tasklet, (unsigned long) he_dev);
+#endif
+       spin_lock_init(&he_dev->global_lock);
+
        if (he_start(atm_dev)) {
                he_stop(he_dev);
                err = -ENODEV;
@@ -1173,11 +1178,6 @@ he_start(struct atm_dev *dev)
        if ((err = he_init_irq(he_dev)) != 0)
                return err;
 
-#ifdef USE_TASKLET
-       tasklet_init(&he_dev->tasklet, he_tasklet, (unsigned long) he_dev);
-#endif
-       spin_lock_init(&he_dev->global_lock);
-
        /* 4.11 enable pci bus controller state machines */
        host_cntl |= (OUTFF_ENB | CMDFF_ENB |
                                QUICK_RD_RETRY | QUICK_WR_RETRY | PERR_INT_ENB);
index f6fedcc32de17ce8bca604068d736e38fda45927..68872142530b5e5a7807157c0b8e539494e62a1b 100644 (file)
@@ -2281,14 +2281,12 @@ static void gem_reset_task(struct work_struct *work)
 
        mutex_lock(&gp->pm_mutex);
 
-       napi_disable(&gp->napi);
+       if (gp->opened)
+               napi_disable(&gp->napi);
 
        spin_lock_irq(&gp->lock);
        spin_lock(&gp->tx_lock);
 
-       if (gp->running == 0)
-               goto not_running;
-
        if (gp->running) {
                netif_stop_queue(gp->dev);
 
@@ -2298,13 +2296,14 @@ static void gem_reset_task(struct work_struct *work)
                        gem_set_link_modes(gp);
                netif_wake_queue(gp->dev);
        }
- not_running:
+
        gp->reset_task_pending = 0;
 
        spin_unlock(&gp->tx_lock);
        spin_unlock_irq(&gp->lock);
 
-       napi_enable(&gp->napi);
+       if (gp->opened)
+               napi_enable(&gp->napi);
 
        mutex_unlock(&gp->pm_mutex);
 }
index 277a020b35e9039c994e583c1c0a276c11511e1a..50775f9234cc72fb8a2dc34bf52ff59fc1c1fb53 100644 (file)
@@ -1032,7 +1032,7 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
 }
 
 static int rt2500usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev,
-                                    int maxpacket, struct sk_buff *skb)
+                                    struct sk_buff *skb)
 {
        int length;
 
@@ -1041,7 +1041,7 @@ static int rt2500usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev,
         * but it must _not_ be a multiple of the USB packet size.
         */
        length = roundup(skb->len, 2);
-       length += (2 * !(length % maxpacket));
+       length += (2 * !(length % rt2x00dev->usb_maxpacket));
 
        return length;
 }
@@ -1643,7 +1643,6 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw,
        struct data_entry *beacon;
        struct data_entry *guardian;
        int pipe = usb_sndbulkpipe(usb_dev, 1);
-       int max_packet = usb_maxpacket(usb_dev, pipe, 1);
        int length;
 
        /*
@@ -1672,7 +1671,7 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw,
                                                         ring->desc_size),
                                skb->len - ring->desc_size, control);
 
-       length = rt2500usb_get_tx_data_len(rt2x00dev, max_packet, skb);
+       length = rt2500usb_get_tx_data_len(rt2x00dev, skb);
 
        usb_fill_bulk_urb(beacon->priv, usb_dev, pipe,
                          skb->data, length, rt2500usb_beacondone, beacon);
index d1ad5251a77a89d1f0afbee37c2ebf1dd77f328a..c8f16f161c285e5a90069f797fc980a648a465b0 100644 (file)
@@ -418,7 +418,7 @@ struct rt2x00lib_ops {
        int (*write_tx_data) (struct rt2x00_dev *rt2x00dev,
                              struct data_ring *ring, struct sk_buff *skb,
                              struct ieee80211_tx_control *control);
-       int (*get_tx_data_len) (struct rt2x00_dev *rt2x00dev, int maxpacket,
+       int (*get_tx_data_len) (struct rt2x00_dev *rt2x00dev,
                                struct sk_buff *skb);
        void (*kick_tx_queue) (struct rt2x00_dev *rt2x00dev,
                               unsigned int queue);
@@ -598,6 +598,11 @@ struct rt2x00_dev {
         */
        u32 *rf;
 
+       /*
+        * USB Max frame size (for rt2500usb & rt73usb).
+        */
+       u16 usb_maxpacket;
+
        /*
         * Current TX power value.
         */
index 73cc726c4046724f01f6e5b9e1b88b5eaf8dc0d2..1f5675dd329f78963fbd94a77976ab57687570f2 100644 (file)
@@ -159,7 +159,6 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev,
            interface_to_usbdev(rt2x00dev_usb(rt2x00dev));
        struct data_entry *entry = rt2x00_get_data_entry(ring);
        int pipe = usb_sndbulkpipe(usb_dev, 1);
-       int max_packet = usb_maxpacket(usb_dev, pipe, 1);
        u32 length;
 
        if (rt2x00_ring_full(ring)) {
@@ -194,8 +193,7 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev,
         * length of the data to usb_fill_bulk_urb. Pass the skb
         * to the driver to determine what the length should be.
         */
-       length = rt2x00dev->ops->lib->get_tx_data_len(rt2x00dev,
-                                                     max_packet, skb);
+       length = rt2x00dev->ops->lib->get_tx_data_len(rt2x00dev, skb);
 
        /*
         * Initialize URB and send the frame to the device.
@@ -490,6 +488,11 @@ int rt2x00usb_probe(struct usb_interface *usb_intf,
        rt2x00dev->ops = ops;
        rt2x00dev->hw = hw;
 
+       rt2x00dev->usb_maxpacket =
+           usb_maxpacket(usb_dev, usb_sndbulkpipe(usb_dev, 1), 1);
+       if (!rt2x00dev->usb_maxpacket)
+               rt2x00dev->usb_maxpacket = 1;
+
        retval = rt2x00usb_alloc_reg(rt2x00dev);
        if (retval)
                goto exit_free_device;
index dc640bf6b5ebe86f3b4ee99cb29e871949e8da8c..c0671c2e6e7301e93d9909c864fbda8b651a140b 100644 (file)
@@ -1251,7 +1251,7 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
 }
 
 static int rt73usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev,
-                                  int maxpacket, struct sk_buff *skb)
+                                  struct sk_buff *skb)
 {
        int length;
 
@@ -1260,7 +1260,7 @@ static int rt73usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev,
         * but it must _not_ be a multiple of the USB packet size.
         */
        length = roundup(skb->len, 4);
-       length += (4 * !(length % maxpacket));
+       length += (4 * !(length % rt2x00dev->usb_maxpacket));
 
        return length;
 }
index e23fd9fbebb3a5b024a9c8c2e155ea02ae51c8a9..6adee6a97dec4f462776a59c2259842a4cfc7c71 100644 (file)
@@ -49,7 +49,7 @@ static inline void mach_reboot(void)
                udelay(50);
                kb_wait();
                udelay(50);
-               outb(cmd | 0x04, 0x60); /* set "System flag" */
+               outb(cmd | 0x14, 0x60); /* set "System flag" and "Keyboard Disabled" */
                udelay(50);
                kb_wait();
                udelay(50);
index 8aa10547b4b1e9aed60bc91223fc86ccf035a9aa..52ee75cd0fe175067d5bbe35af64d3f1801296c2 100644 (file)
@@ -29,9 +29,9 @@ extern int mps_oem_check(struct mp_config_table *mpc, char *oem,
 static inline int es7000_check_dsdt(void)
 {
        struct acpi_table_header header;
-       memcpy(&header, 0, sizeof(struct acpi_table_header));
-       acpi_get_table_header(ACPI_SIG_DSDT, 0, &header);
-       if (!strncmp(header.oem_id, "UNISYS", 6))
+
+       if (ACPI_SUCCESS(acpi_get_table_header(ACPI_SIG_DSDT, 0, &header)) &&
+           !strncmp(header.oem_id, "UNISYS", 6))
                return 1;
        return 0;
 }
index 1710ae10eb6745b7e2eb5ff07ad5568be5d501e6..71729ca05cd738308eabc7f61ba6cb94dff94554 100644 (file)
@@ -1,5 +1,5 @@
 #include <asm/voyager.h>
-#include <asm/setup_32.h>
+#include <asm/setup.h>
 #define VOYAGER_BIOS_INFO ((struct voyager_bios_info *) \
                        (&boot_params.apm_bios_info))
 
index 91140fe8c119a317b28d62ce1255f00d8719dba8..bddd50bd6878856ba20363ec2dda6101cde0f879 100644 (file)
@@ -356,7 +356,6 @@ static inline struct sk_buff *alloc_skb_fclone(unsigned int size,
        return __alloc_skb(size, priority, 1, -1);
 }
 
-extern void           kfree_skbmem(struct sk_buff *skb);
 extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src);
 extern struct sk_buff *skb_clone(struct sk_buff *skb,
                                 gfp_t priority);
index 2c6c2c2783d8b899940280c47a70ee3bff588e18..c2a46c45c8f75a3dab16327b78651501e1bd5740 100644 (file)
@@ -9,12 +9,6 @@
 
 #ifdef __KERNEL__
 
-/*
- * Socket transport setup operations
- */
-struct rpc_xprt *xs_setup_udp(struct xprt_create *args);
-struct rpc_xprt *xs_setup_tcp(struct xprt_create *args);
-
 int            init_socket_xprt(void);
 void           cleanup_socket_xprt(void);
 
index 164d13211165422ef32ed5e206025d8daf060ed0..d8ae48439f120a27b18e7d226ba49d54a16b322e 100644 (file)
@@ -115,8 +115,16 @@ extern u32 ieee80211_debug_level;
 do { if (ieee80211_debug_level & (level)) \
   printk(KERN_DEBUG "ieee80211: %c %s " fmt, \
          in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0)
+static inline bool ieee80211_ratelimit_debug(u32 level)
+{
+       return (ieee80211_debug_level & level) && net_ratelimit();
+}
 #else
 #define IEEE80211_DEBUG(level, fmt, args...) do {} while (0)
+static inline bool ieee80211_ratelimit_debug(u32 level)
+{
+       return false;
+}
 #endif                         /* CONFIG_IEEE80211_DEBUG */
 
 /* escape_essid() is intended to be used in debug (and possibly error)
index 469216d936631d3e76a4d92544b7e9f32e5c0706..37f6cb11212723f7f2094a16b6cec92bbe9ef670 100644 (file)
@@ -186,9 +186,8 @@ static inline void inet_ehash_locks_free(struct inet_hashinfo *hashinfo)
                if (size > PAGE_SIZE)
                        vfree(hashinfo->ehash_locks);
                else
-#else
-               kfree(hashinfo->ehash_locks);
 #endif
+               kfree(hashinfo->ehash_locks);
                hashinfo->ehash_locks = NULL;
        }
 }
index 67ea2c0c0ab75a1fb1a40dd31c734c6326f73cca..8a7d59be8a0d0e4886d9384215b315a1f1f320a1 100644 (file)
@@ -327,40 +327,6 @@ extern int ip_vs_get_debug_level(void);
 #define FTPPORT  __constant_htons(21)
 #define FTPDATA  __constant_htons(20)
 
-/*
- *      IPVS sysctl variables under the /proc/sys/net/ipv4/vs/
- */
-#define NET_IPV4_VS              21
-
-enum {
-       NET_IPV4_VS_DEBUG_LEVEL=1,
-       NET_IPV4_VS_AMEMTHRESH=2,
-       NET_IPV4_VS_AMDROPRATE=3,
-       NET_IPV4_VS_DROP_ENTRY=4,
-       NET_IPV4_VS_DROP_PACKET=5,
-       NET_IPV4_VS_SECURE_TCP=6,
-       NET_IPV4_VS_TO_ES=7,
-       NET_IPV4_VS_TO_SS=8,
-       NET_IPV4_VS_TO_SR=9,
-       NET_IPV4_VS_TO_FW=10,
-       NET_IPV4_VS_TO_TW=11,
-       NET_IPV4_VS_TO_CL=12,
-       NET_IPV4_VS_TO_CW=13,
-       NET_IPV4_VS_TO_LA=14,
-       NET_IPV4_VS_TO_LI=15,
-       NET_IPV4_VS_TO_SA=16,
-       NET_IPV4_VS_TO_UDP=17,
-       NET_IPV4_VS_TO_ICMP=18,
-       NET_IPV4_VS_LBLC_EXPIRE=19,
-       NET_IPV4_VS_LBLCR_EXPIRE=20,
-       NET_IPV4_VS_CACHE_BYPASS=22,
-       NET_IPV4_VS_EXPIRE_NODEST_CONN=23,
-       NET_IPV4_VS_SYNC_THRESHOLD=24,
-       NET_IPV4_VS_NAT_ICMP_SEND=25,
-       NET_IPV4_VS_EXPIRE_QUIESCENT_TEMPLATE=26,
-       NET_IPV4_VS_LAST
-};
-
 /*
  *      TCP State Values
  */
index f30b537d69525168e078a2eb8a0c39a51ef6bdc1..05f22a6afbcdc4cceeefd4431696db74c384f044 100644 (file)
@@ -441,11 +441,14 @@ enum {
        SCTP_AUTH_HMAC_ID_RESERVED_0,
        SCTP_AUTH_HMAC_ID_SHA1,
        SCTP_AUTH_HMAC_ID_RESERVED_2,
-       SCTP_AUTH_HMAC_ID_SHA256
+#if defined (CONFIG_CRYPTO_SHA256) || defined (CONFIG_CRYPTO_SHA256_MODULE)
+       SCTP_AUTH_HMAC_ID_SHA256,
+#endif
+       __SCTP_AUTH_HMAC_MAX
 };
 
-#define SCTP_AUTH_HMAC_ID_MAX  SCTP_AUTH_HMAC_ID_SHA256
-#define SCTP_AUTH_NUM_HMACS (SCTP_AUTH_HMAC_ID_SHA256 + 1)
+#define SCTP_AUTH_HMAC_ID_MAX  __SCTP_AUTH_HMAC_MAX - 1
+#define SCTP_AUTH_NUM_HMACS    __SCTP_AUTH_HMAC_MAX
 #define SCTP_SHA1_SIG_SIZE 20
 #define SCTP_SHA256_SIG_SIZE 32
 
index 567e468d74929c993f6c8fd14271068dc6bc0eb3..67e35c7e230c42a08bb718e6508d3826dbbe6cdd 100644 (file)
@@ -1236,6 +1236,9 @@ static inline struct sk_buff *sk_stream_alloc_pskb(struct sock *sk,
 {
        struct sk_buff *skb;
 
+       /* The TCP header must be at least 32-bit aligned.  */
+       size = ALIGN(size, 4);
+
        skb = alloc_skb_fclone(size + sk->sk_prot->max_header, gfp);
        if (skb) {
                skb->truesize += mem;
index d695cea7730da4a4bd16da6c0ce7bfcf2680767f..cb5b033e0e59c205980243d2b7e494db0925f218 100644 (file)
@@ -1288,6 +1288,9 @@ static inline void tcp_insert_write_queue_before(struct sk_buff *new,
                                                  struct sock *sk)
 {
        __skb_insert(new, skb->prev, skb, &sk->sk_write_queue);
+
+       if (sk->sk_send_head == skb)
+               sk->sk_send_head = new;
 }
 
 static inline void tcp_unlink_write_queue(struct sk_buff *skb, struct sock *sk)
index 304b5410d746ec724afcb4e3ce50bfe65f1bf2ff..d1fe71eb45469bc99f23cfe9aee83a8cbecc81b1 100644 (file)
@@ -1750,7 +1750,7 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3,
 }
 
 asmlinkage long sys_getcpu(unsigned __user *cpup, unsigned __user *nodep,
-                          struct getcpu_cache __user *cache)
+                          struct getcpu_cache __user *unused)
 {
        int err = 0;
        int cpu = raw_smp_processor_id();
@@ -1758,24 +1758,6 @@ asmlinkage long sys_getcpu(unsigned __user *cpup, unsigned __user *nodep,
                err |= put_user(cpu, cpup);
        if (nodep)
                err |= put_user(cpu_to_node(cpu), nodep);
-       if (cache) {
-               /*
-                * The cache is not needed for this implementation,
-                * but make sure user programs pass something
-                * valid. vsyscall implementations can instead make
-                * good use of the cache. Only use t0 and t1 because
-                * these are available in both 32bit and 64bit ABI (no
-                * need for a compat_getcpu). 32bit has enough
-                * padding
-                */
-               unsigned long t0, t1;
-               get_user(t0, &cache->blob[0]);
-               get_user(t1, &cache->blob[1]);
-               t0++;
-               t1++;
-               put_user(t0, &cache->blob[0]);
-               put_user(t1, &cache->blob[1]);
-       }
        return err ? -EFAULT : 0;
 }
 
index 4abc6d2306f451e8da9141e753b7b517045edda6..fdfca0dd990526afd7e034c583574abe736071ba 100644 (file)
@@ -237,36 +237,6 @@ static struct trans_ctl_table trans_net_ipv4_conf_table[] = {
        {}
 };
 
-
-static struct trans_ctl_table trans_net_ipv4_vs_table[] = {
-       { NET_IPV4_VS_AMEMTHRESH,       "amemthresh" },
-       { NET_IPV4_VS_DEBUG_LEVEL,      "debug_level" },
-       { NET_IPV4_VS_AMDROPRATE,       "am_droprate" },
-       { NET_IPV4_VS_DROP_ENTRY,       "drop_entry" },
-       { NET_IPV4_VS_DROP_PACKET,      "drop_packet" },
-       { NET_IPV4_VS_SECURE_TCP,       "secure_tcp" },
-       { NET_IPV4_VS_TO_ES,            "timeout_established" },
-       { NET_IPV4_VS_TO_SS,            "timeout_synsent" },
-       { NET_IPV4_VS_TO_SR,            "timeout_synrecv" },
-       { NET_IPV4_VS_TO_FW,            "timeout_finwait" },
-       { NET_IPV4_VS_TO_TW,            "timeout_timewait" },
-       { NET_IPV4_VS_TO_CL,            "timeout_close" },
-       { NET_IPV4_VS_TO_CW,            "timeout_closewait" },
-       { NET_IPV4_VS_TO_LA,            "timeout_lastack" },
-       { NET_IPV4_VS_TO_LI,            "timeout_listen" },
-       { NET_IPV4_VS_TO_SA,            "timeout_synack" },
-       { NET_IPV4_VS_TO_UDP,           "timeout_udp" },
-       { NET_IPV4_VS_TO_ICMP,          "timeout_icmp" },
-       { NET_IPV4_VS_CACHE_BYPASS,     "cache_bypass" },
-       { NET_IPV4_VS_EXPIRE_NODEST_CONN,       "expire_nodest_conn" },
-       { NET_IPV4_VS_EXPIRE_QUIESCENT_TEMPLATE,        "expire_quiescent_template" },
-       { NET_IPV4_VS_SYNC_THRESHOLD,           "sync_threshold" },
-       { NET_IPV4_VS_NAT_ICMP_SEND,    "nat_icmp_send" },
-       { NET_IPV4_VS_LBLC_EXPIRE,              "lblc_expiration" },
-       { NET_IPV4_VS_LBLCR_EXPIRE,             "lblcr_expiration" },
-       {}
-};
-
 static struct trans_ctl_table trans_net_neigh_vars_table[] = {
        { NET_NEIGH_MCAST_SOLICIT,      "mcast_solicit" },
        { NET_NEIGH_UCAST_SOLICIT,      "ucast_solicit" },
@@ -341,7 +311,6 @@ static struct trans_ctl_table trans_net_ipv4_table[] = {
        { NET_IPV4_ROUTE,               "route",        trans_net_ipv4_route_table },
        /* NET_IPV4_FIB_HASH unused */
        { NET_IPV4_NETFILTER,           "netfilter",    trans_net_ipv4_netfilter_table },
-       { NET_IPV4_VS,                  "vs",           trans_net_ipv4_vs_table },
 
        { NET_IPV4_TCP_TIMESTAMPS,              "tcp_timestamps" },
        { NET_IPV4_TCP_WINDOW_SCALING,          "tcp_window_scaling" },
index de6a2d6b3ebb69ad65f1491e9f44a846e1b86f44..14a2ecf2b318f82bd87d22031da05738e3773fd4 100644 (file)
@@ -205,7 +205,7 @@ static void sync_cmos_clock(unsigned long dummy)
                return;
 
        getnstimeofday(&now);
-       if (abs(xtime.tv_nsec - (NSEC_PER_SEC / 2)) <= tick_nsec / 2)
+       if (abs(now.tv_nsec - (NSEC_PER_SEC / 2)) <= tick_nsec / 2)
                fail = update_persistent_clock(now);
 
        next.tv_nsec = (NSEC_PER_SEC / 2) - now.tv_nsec;
index 7a36878241dabf132f09fb861afca2b68f10ca77..4f99bb86af5c594b1bb77042ba43b321a9d50d4a 100644 (file)
@@ -462,7 +462,8 @@ int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
         * OTHER THINGS LIKE FDDI/TokenRing/802.3 SNAPs...
         */
 
-       if (veth->h_vlan_proto != htons(ETH_P_8021Q)) {
+       if (veth->h_vlan_proto != htons(ETH_P_8021Q) ||
+               VLAN_DEV_INFO(dev)->flags & VLAN_FLAG_REORDER_HDR) {
                int orig_headroom = skb_headroom(skb);
                unsigned short veth_TCI;
 
index 93867bb6cc978ca76c07c6de8bb31f55b0e8dc79..a9018287312071c4cd77a442b062b7444c7b72bf 100644 (file)
@@ -39,7 +39,7 @@ static int __init br_init(void)
 
        err = br_fdb_init();
        if (err)
-               goto err_out1;
+               goto err_out;
 
        err = br_netfilter_init();
        if (err)
@@ -65,6 +65,8 @@ err_out3:
 err_out2:
        br_netfilter_fini();
 err_out1:
+       br_fdb_fini();
+err_out:
        llc_sap_put(br_stp_sap);
        return err;
 }
index 3cedd4eeeed6f30826c671a4e0cfd5575fc88a51..0ee79a726d91f3159e293282013dd7fad395760e 100644 (file)
@@ -122,6 +122,7 @@ static inline int is_link_local(const unsigned char *dest)
 struct sk_buff *br_handle_frame(struct net_bridge_port *p, struct sk_buff *skb)
 {
        const unsigned char *dest = eth_hdr(skb)->h_dest;
+       int (*rhook)(struct sk_buff *skb);
 
        if (!is_valid_ether_addr(eth_hdr(skb)->h_source))
                goto drop;
@@ -147,9 +148,9 @@ struct sk_buff *br_handle_frame(struct net_bridge_port *p, struct sk_buff *skb)
 
        switch (p->state) {
        case BR_STATE_FORWARDING:
-
-               if (br_should_route_hook) {
-                       if (br_should_route_hook(skb))
+               rhook = rcu_dereference(br_should_route_hook);
+               if (rhook != NULL) {
+                       if (rhook(skb))
                                return skb;
                        dest = eth_hdr(skb)->h_dest;
                }
index 392d877040d31897f063d97c49b49ff7c1949532..6436d30a550eac56f42a2d2a8a44aab7295cb9fa 100644 (file)
@@ -187,7 +187,7 @@ static int ebt_among_check(const char *tablename, unsigned int hookmask,
 
        if (datalen != EBT_ALIGN(expected_length)) {
                printk(KERN_WARNING
-                      "ebtables: among: wrong size: %d"
+                      "ebtables: among: wrong size: %d "
                       "against expected %d, rounded to %Zd\n",
                       datalen, expected_length,
                       EBT_ALIGN(expected_length));
index e44519ebf1d22b7054232a7ec6da86e6cff2461f..be6f18681053174667c6e7a2abcb4c79afe7c622 100644 (file)
@@ -70,13 +70,13 @@ static int __init ebtable_broute_init(void)
        if (ret < 0)
                return ret;
        /* see br_input.c */
-       br_should_route_hook = ebt_broute;
+       rcu_assign_pointer(br_should_route_hook, ebt_broute);
        return ret;
 }
 
 static void __exit ebtable_broute_fini(void)
 {
-       br_should_route_hook = NULL;
+       rcu_assign_pointer(br_should_route_hook, NULL);
        synchronize_net();
        ebt_unregister_table(&broute_table);
 }
index de33f36947e9064294085e6f775881b98a636a8a..285ec3ed9b378179248b8d8900ad983c9ee0f210 100644 (file)
@@ -2463,8 +2463,6 @@ static int pktgen_output_ipsec(struct sk_buff *skb, struct pktgen_dev *pkt_dev)
 
        x->curlft.bytes +=skb->len;
        x->curlft.packets++;
-       spin_unlock(&x->lock);
-
 error:
        spin_unlock(&x->lock);
        return err;
index 32d5826b7177078eb51dd99bc1887b974516888f..5b4ce9b4dd2060c9fd5920bfad967493b7e7eea6 100644 (file)
@@ -275,12 +275,11 @@ static void skb_release_data(struct sk_buff *skb)
 /*
  *     Free an skbuff by memory without cleaning the state.
  */
-void kfree_skbmem(struct sk_buff *skb)
+static void kfree_skbmem(struct sk_buff *skb)
 {
        struct sk_buff *other;
        atomic_t *fclone_ref;
 
-       skb_release_data(skb);
        switch (skb->fclone) {
        case SKB_FCLONE_UNAVAILABLE:
                kmem_cache_free(skbuff_head_cache, skb);
@@ -307,16 +306,8 @@ void kfree_skbmem(struct sk_buff *skb)
        }
 }
 
-/**
- *     __kfree_skb - private function
- *     @skb: buffer
- *
- *     Free an sk_buff. Release anything attached to the buffer.
- *     Clean the state. This is an internal helper function. Users should
- *     always call kfree_skb
- */
-
-void __kfree_skb(struct sk_buff *skb)
+/* Free everything but the sk_buff shell. */
+static void skb_release_all(struct sk_buff *skb)
 {
        dst_release(skb->dst);
 #ifdef CONFIG_XFRM
@@ -340,7 +331,21 @@ void __kfree_skb(struct sk_buff *skb)
        skb->tc_verd = 0;
 #endif
 #endif
+       skb_release_data(skb);
+}
+
+/**
+ *     __kfree_skb - private function
+ *     @skb: buffer
+ *
+ *     Free an sk_buff. Release anything attached to the buffer.
+ *     Clean the state. This is an internal helper function. Users should
+ *     always call kfree_skb
+ */
 
+void __kfree_skb(struct sk_buff *skb)
+{
+       skb_release_all(skb);
        kfree_skbmem(skb);
 }
 
@@ -441,7 +446,7 @@ static struct sk_buff *__skb_clone(struct sk_buff *n, struct sk_buff *skb)
  */
 struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src)
 {
-       skb_release_data(dst);
+       skb_release_all(dst);
        return __skb_clone(dst, src);
 }
 EXPORT_SYMBOL_GPL(skb_morph);
index 40ad428a27f56dcf1aff0eed16b69dfa49cda4e2..d26b88dbbb45cbab0b5de86bf0151d9cfa3a6638 100644 (file)
@@ -166,7 +166,7 @@ static u32 dccp_li_calc_first_li(struct sock *sk,
        }
 
        if (unlikely(interval == 0)) {
-               DCCP_WARN("%s(%p), Could not find a win_count interval > 0."
+               DCCP_WARN("%s(%p), Could not find a win_count interval > 0. "
                          "Defaulting to 1\n", dccp_role(sk), sk);
                interval = 1;
        }
index c6d760d9fbbe2a83fb3902ee040d6e1db3ce16df..208bf35b55463d10d95222f36e38c11bedf8c18a 100644 (file)
@@ -338,7 +338,7 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
        pos += 8;
 
        if (ccmp_replay_check(pn, key->rx_pn)) {
-               if (net_ratelimit()) {
+               if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) {
                        IEEE80211_DEBUG_DROP("CCMP: replay detected: STA=%s "
                                 "previous PN %02x%02x%02x%02x%02x%02x "
                                 "received PN %02x%02x%02x%02x%02x%02x\n",
index 58b22619ab15c160ad072cbd65edbc7931ba7b98..8e146949fc6f595eb75ca15f234060347ade8c89 100644 (file)
@@ -464,7 +464,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
        pos += 8;
 
        if (tkip_replay_check(iv32, iv16, tkey->rx_iv32, tkey->rx_iv16)) {
-               if (net_ratelimit()) {
+               if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) {
                        IEEE80211_DEBUG_DROP("TKIP: replay detected: STA=%s"
                               " previous TSC %08x%04x received TSC "
                               "%08x%04x\n", print_mac(mac, hdr->addr2),
@@ -504,7 +504,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
                         * it needs to be recalculated for the next packet. */
                        tkey->rx_phase1_done = 0;
                }
-               if (net_ratelimit()) {
+               if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) {
                        IEEE80211_DEBUG_DROP("TKIP: ICV error detected: STA="
                               "%s\n", print_mac(mac, hdr->addr2));
                }
index 36d6798947b59026eb400c6b06882099fddd8ba0..b3f366a33a5cd4f834a512f2dfa7bad2963356f4 100644 (file)
 #include <net/tcp.h>
 #include <net/sock.h>
 #include <net/arp.h>
-#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
 #include <net/ax25.h>
-#if defined(CONFIG_NETROM) || defined(CONFIG_NETROM_MODULE)
 #include <net/netrom.h>
-#endif
-#endif
 #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE)
 #include <net/atmclip.h>
 struct neigh_table *clip_tbl_hook;
@@ -731,20 +727,10 @@ static int arp_process(struct sk_buff *skb)
                    htons(dev_type) != arp->ar_hrd)
                        goto out;
                break;
-#ifdef CONFIG_NET_ETHERNET
        case ARPHRD_ETHER:
-#endif
-#ifdef CONFIG_TR
        case ARPHRD_IEEE802_TR:
-#endif
-#ifdef CONFIG_FDDI
        case ARPHRD_FDDI:
-#endif
-#ifdef CONFIG_NET_FC
        case ARPHRD_IEEE802:
-#endif
-#if defined(CONFIG_NET_ETHERNET) || defined(CONFIG_TR) || \
-    defined(CONFIG_FDDI)        || defined(CONFIG_NET_FC)
                /*
                 * ETHERNET, Token Ring and Fibre Channel (which are IEEE 802
                 * devices, according to RFC 2625) devices will accept ARP
@@ -759,21 +745,16 @@ static int arp_process(struct sk_buff *skb)
                    arp->ar_pro != htons(ETH_P_IP))
                        goto out;
                break;
-#endif
-#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
        case ARPHRD_AX25:
                if (arp->ar_pro != htons(AX25_P_IP) ||
                    arp->ar_hrd != htons(ARPHRD_AX25))
                        goto out;
                break;
-#if defined(CONFIG_NETROM) || defined(CONFIG_NETROM_MODULE)
        case ARPHRD_NETROM:
                if (arp->ar_pro != htons(AX25_P_IP) ||
                    arp->ar_hrd != htons(ARPHRD_NETROM))
                        goto out;
                break;
-#endif
-#endif
        }
 
        /* Understand only these message types */
@@ -828,7 +809,8 @@ static int arp_process(struct sk_buff *skb)
                if (arp->ar_op == htons(ARPOP_REQUEST) &&
                    inet_addr_type(tip) == RTN_LOCAL &&
                    !arp_ignore(in_dev,dev,sip,tip))
-                       arp_send(ARPOP_REPLY,ETH_P_ARP,tip,dev,tip,sha,dev->dev_addr,dev->dev_addr);
+                       arp_send(ARPOP_REPLY, ETH_P_ARP, sip, dev, tip, sha,
+                                dev->dev_addr, sha);
                goto out;
        }
 
index b0170732b5e9e962ed1fca65cf930c3bf4cc98f0..6b3fffb554b6fa59f01abc5464934c28d6b38785 100644 (file)
@@ -853,8 +853,6 @@ static void inet_diag_rcv(struct sk_buff *skb)
        mutex_unlock(&inet_diag_mutex);
 }
 
-static DEFINE_SPINLOCK(inet_diag_register_lock);
-
 int inet_diag_register(const struct inet_diag_handler *h)
 {
        const __u16 type = h->idiag_type;
@@ -863,13 +861,13 @@ int inet_diag_register(const struct inet_diag_handler *h)
        if (type >= INET_DIAG_GETSOCK_MAX)
                goto out;
 
-       spin_lock(&inet_diag_register_lock);
+       mutex_lock(&inet_diag_mutex);
        err = -EEXIST;
        if (inet_diag_table[type] == NULL) {
                inet_diag_table[type] = h;
                err = 0;
        }
-       spin_unlock(&inet_diag_register_lock);
+       mutex_unlock(&inet_diag_mutex);
 out:
        return err;
 }
@@ -882,11 +880,9 @@ void inet_diag_unregister(const struct inet_diag_handler *h)
        if (type >= INET_DIAG_GETSOCK_MAX)
                return;
 
-       spin_lock(&inet_diag_register_lock);
+       mutex_lock(&inet_diag_mutex);
        inet_diag_table[type] = NULL;
-       spin_unlock(&inet_diag_register_lock);
-
-       synchronize_rcu();
+       mutex_unlock(&inet_diag_mutex);
 }
 EXPORT_SYMBOL_GPL(inet_diag_unregister);
 
@@ -901,7 +897,7 @@ static int __init inet_diag_init(void)
                goto out;
 
        idiagnl = netlink_kernel_create(&init_net, NETLINK_INET_DIAG, 0,
-                                       inet_diag_rcv, NULL, THIS_MODULE);
+                       inet_diag_rcv, &inet_diag_mutex, THIS_MODULE);
        if (idiagnl == NULL)
                goto out_free_table;
        err = 0;
index 20c884a57721b472ec1c5e756aac3f38b703827d..8fba20256f52abeae41df323563a8c04149b1293 100644 (file)
@@ -637,7 +637,7 @@ static int ip_vs_out_icmp(struct sk_buff *skb, int *related)
        verdict = NF_DROP;
 
        if (IP_VS_FWD_METHOD(cp) != 0) {
-               IP_VS_ERR("shouldn't reach here, because the box is on the"
+               IP_VS_ERR("shouldn't reach here, because the box is on the "
                          "half connection in the tun/dr module.\n");
        }
 
index b64cf45a9eadde464169663688b53da624a2a0fd..693d92490c117a587db3b882d648fa179c201698 100644 (file)
@@ -1424,7 +1424,6 @@ proc_do_sync_threshold(ctl_table *table, int write, struct file *filp,
 
 static struct ctl_table vs_vars[] = {
        {
-               .ctl_name       = NET_IPV4_VS_AMEMTHRESH,
                .procname       = "amemthresh",
                .data           = &sysctl_ip_vs_amemthresh,
                .maxlen         = sizeof(int),
@@ -1433,7 +1432,6 @@ static struct ctl_table vs_vars[] = {
        },
 #ifdef CONFIG_IP_VS_DEBUG
        {
-               .ctl_name       = NET_IPV4_VS_DEBUG_LEVEL,
                .procname       = "debug_level",
                .data           = &sysctl_ip_vs_debug_level,
                .maxlen         = sizeof(int),
@@ -1442,7 +1440,6 @@ static struct ctl_table vs_vars[] = {
        },
 #endif
        {
-               .ctl_name       = NET_IPV4_VS_AMDROPRATE,
                .procname       = "am_droprate",
                .data           = &sysctl_ip_vs_am_droprate,
                .maxlen         = sizeof(int),
@@ -1450,7 +1447,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec,
        },
        {
-               .ctl_name       = NET_IPV4_VS_DROP_ENTRY,
                .procname       = "drop_entry",
                .data           = &sysctl_ip_vs_drop_entry,
                .maxlen         = sizeof(int),
@@ -1458,7 +1454,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_do_defense_mode,
        },
        {
-               .ctl_name       = NET_IPV4_VS_DROP_PACKET,
                .procname       = "drop_packet",
                .data           = &sysctl_ip_vs_drop_packet,
                .maxlen         = sizeof(int),
@@ -1466,7 +1461,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_do_defense_mode,
        },
        {
-               .ctl_name       = NET_IPV4_VS_SECURE_TCP,
                .procname       = "secure_tcp",
                .data           = &sysctl_ip_vs_secure_tcp,
                .maxlen         = sizeof(int),
@@ -1475,7 +1469,6 @@ static struct ctl_table vs_vars[] = {
        },
 #if 0
        {
-               .ctl_name       = NET_IPV4_VS_TO_ES,
                .procname       = "timeout_established",
                .data   = &vs_timeout_table_dos.timeout[IP_VS_S_ESTABLISHED],
                .maxlen         = sizeof(int),
@@ -1483,7 +1476,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_VS_TO_SS,
                .procname       = "timeout_synsent",
                .data   = &vs_timeout_table_dos.timeout[IP_VS_S_SYN_SENT],
                .maxlen         = sizeof(int),
@@ -1491,7 +1483,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_VS_TO_SR,
                .procname       = "timeout_synrecv",
                .data   = &vs_timeout_table_dos.timeout[IP_VS_S_SYN_RECV],
                .maxlen         = sizeof(int),
@@ -1499,7 +1490,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_VS_TO_FW,
                .procname       = "timeout_finwait",
                .data   = &vs_timeout_table_dos.timeout[IP_VS_S_FIN_WAIT],
                .maxlen         = sizeof(int),
@@ -1507,7 +1497,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_VS_TO_TW,
                .procname       = "timeout_timewait",
                .data   = &vs_timeout_table_dos.timeout[IP_VS_S_TIME_WAIT],
                .maxlen         = sizeof(int),
@@ -1515,7 +1504,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_VS_TO_CL,
                .procname       = "timeout_close",
                .data   = &vs_timeout_table_dos.timeout[IP_VS_S_CLOSE],
                .maxlen         = sizeof(int),
@@ -1523,7 +1511,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_VS_TO_CW,
                .procname       = "timeout_closewait",
                .data   = &vs_timeout_table_dos.timeout[IP_VS_S_CLOSE_WAIT],
                .maxlen         = sizeof(int),
@@ -1531,7 +1518,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_VS_TO_LA,
                .procname       = "timeout_lastack",
                .data   = &vs_timeout_table_dos.timeout[IP_VS_S_LAST_ACK],
                .maxlen         = sizeof(int),
@@ -1539,7 +1525,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_VS_TO_LI,
                .procname       = "timeout_listen",
                .data   = &vs_timeout_table_dos.timeout[IP_VS_S_LISTEN],
                .maxlen         = sizeof(int),
@@ -1547,7 +1532,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_VS_TO_SA,
                .procname       = "timeout_synack",
                .data   = &vs_timeout_table_dos.timeout[IP_VS_S_SYNACK],
                .maxlen         = sizeof(int),
@@ -1555,7 +1539,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_VS_TO_UDP,
                .procname       = "timeout_udp",
                .data   = &vs_timeout_table_dos.timeout[IP_VS_S_UDP],
                .maxlen         = sizeof(int),
@@ -1563,7 +1546,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_VS_TO_ICMP,
                .procname       = "timeout_icmp",
                .data   = &vs_timeout_table_dos.timeout[IP_VS_S_ICMP],
                .maxlen         = sizeof(int),
@@ -1572,7 +1554,6 @@ static struct ctl_table vs_vars[] = {
        },
 #endif
        {
-               .ctl_name       = NET_IPV4_VS_CACHE_BYPASS,
                .procname       = "cache_bypass",
                .data           = &sysctl_ip_vs_cache_bypass,
                .maxlen         = sizeof(int),
@@ -1580,7 +1561,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec,
        },
        {
-               .ctl_name       = NET_IPV4_VS_EXPIRE_NODEST_CONN,
                .procname       = "expire_nodest_conn",
                .data           = &sysctl_ip_vs_expire_nodest_conn,
                .maxlen         = sizeof(int),
@@ -1588,7 +1568,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec,
        },
        {
-               .ctl_name       = NET_IPV4_VS_EXPIRE_QUIESCENT_TEMPLATE,
                .procname       = "expire_quiescent_template",
                .data           = &sysctl_ip_vs_expire_quiescent_template,
                .maxlen         = sizeof(int),
@@ -1596,7 +1575,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_dointvec,
        },
        {
-               .ctl_name       = NET_IPV4_VS_SYNC_THRESHOLD,
                .procname       = "sync_threshold",
                .data           = &sysctl_ip_vs_sync_threshold,
                .maxlen         = sizeof(sysctl_ip_vs_sync_threshold),
@@ -1604,7 +1582,6 @@ static struct ctl_table vs_vars[] = {
                .proc_handler   = &proc_do_sync_threshold,
        },
        {
-               .ctl_name       = NET_IPV4_VS_NAT_ICMP_SEND,
                .procname       = "nat_icmp_send",
                .data           = &sysctl_ip_vs_nat_icmp_send,
                .maxlen         = sizeof(int),
@@ -1616,7 +1593,6 @@ static struct ctl_table vs_vars[] = {
 
 static ctl_table vs_table[] = {
        {
-               .ctl_name       = NET_IPV4_VS,
                .procname       = "vs",
                .mode           = 0555,
                .child          = vs_vars
index 052f4ed59174ac0b40012712e33e06fabe0a72cb..b843a11d7cf7c33ae187a8879841516e33927e31 100644 (file)
@@ -114,7 +114,6 @@ struct ip_vs_lblc_table {
 
 static ctl_table vs_vars_table[] = {
        {
-               .ctl_name       = NET_IPV4_VS_LBLC_EXPIRE,
                .procname       = "lblc_expiration",
                .data           = &sysctl_ip_vs_lblc_expiration,
                .maxlen         = sizeof(int),
@@ -126,7 +125,6 @@ static ctl_table vs_vars_table[] = {
 
 static ctl_table vs_table[] = {
        {
-               .ctl_name       = NET_IPV4_VS,
                .procname       = "vs",
                .mode           = 0555,
                .child          = vs_vars_table
index 427b593c1069b82bab52215a16767db96fe6ae91..e5b323a6b2f784a02389f5cdc4e4fceedd508be9 100644 (file)
@@ -302,7 +302,6 @@ struct ip_vs_lblcr_table {
 
 static ctl_table vs_vars_table[] = {
        {
-               .ctl_name       = NET_IPV4_VS_LBLCR_EXPIRE,
                .procname       = "lblcr_expiration",
                .data           = &sysctl_ip_vs_lblcr_expiration,
                .maxlen         = sizeof(int),
@@ -314,7 +313,6 @@ static ctl_table vs_vars_table[] = {
 
 static ctl_table vs_table[] = {
        {
-               .ctl_name       = NET_IPV4_VS,
                .procname       = "vs",
                .mode           = 0555,
                .child          = vs_vars_table
index e844ddb82b9a9e20cdedaf886111cb21e0daf23e..c0e11ec8f0f991d7096ce0e44f1535eddd7e39b2 100644 (file)
@@ -45,7 +45,7 @@ static struct ip_vs_protocol *ip_vs_proto_table[IP_VS_PROTO_TAB_SIZE];
 /*
  *     register an ipvs protocol
  */
-static int register_ip_vs_protocol(struct ip_vs_protocol *pp)
+static int __used register_ip_vs_protocol(struct ip_vs_protocol *pp)
 {
        unsigned hash = IP_VS_PROTO_HASH(pp->protocol);
 
index 5de6e57ac55c20ebd3f0ca8bd16310d15b52a640..f8678651250f0b349058e9243444372ab8b1d95a 100644 (file)
@@ -66,7 +66,7 @@ ipt_local_hook(unsigned int hook,
        if (skb->len < sizeof(struct iphdr) ||
            ip_hdrlen(skb) < sizeof(struct iphdr)) {
                if (net_ratelimit())
-                       printk("iptable_raw: ignoring short SOCK_RAW"
+                       printk("iptable_raw: ignoring short SOCK_RAW "
                               "packet.\n");
                return NF_ACCEPT;
        }
index 70e7997ea2844aead26de3776008cbbdd73358c9..86b465b176baad0e0a3a504d47cb2d059894cf20 100644 (file)
@@ -607,13 +607,10 @@ static void nf_nat_move_storage(struct nf_conn *conntrack, void *old)
        struct nf_conn_nat *new_nat = nf_ct_ext_find(conntrack, NF_CT_EXT_NAT);
        struct nf_conn_nat *old_nat = (struct nf_conn_nat *)old;
        struct nf_conn *ct = old_nat->ct;
-       unsigned int srchash;
 
-       if (!(ct->status & IPS_NAT_DONE_MASK))
+       if (!ct || !(ct->status & IPS_NAT_DONE_MASK))
                return;
 
-       srchash = hash_by_src(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
-
        write_lock_bh(&nf_nat_lock);
        hlist_replace_rcu(&old_nat->bysource, &new_nat->bysource);
        new_nat->ct = ct;
index 1bff9ed349ff5a9e5d14ba1f09888e304bd88950..c426dec6d57903467fd5cd7a233a872efa0524ce 100644 (file)
@@ -2888,18 +2888,14 @@ static int ip_rt_acct_read(char *buffer, char **start, off_t offset,
        offset /= sizeof(u32);
 
        if (length > 0) {
-               u32 *src = ((u32 *) IP_RT_ACCT_CPU(0)) + offset;
                u32 *dst = (u32 *) buffer;
 
-               /* Copy first cpu. */
                *start = buffer;
-               memcpy(dst, src, length);
+               memset(dst, 0, length);
 
-               /* Add the other cpus in, one int at a time */
                for_each_possible_cpu(i) {
                        unsigned int j;
-
-                       src = ((u32 *) IP_RT_ACCT_CPU(i)) + offset;
+                       u32 *src = ((u32 *) IP_RT_ACCT_CPU(i)) + offset;
 
                        for (j = 0; j < length/4; j++)
                                dst[j] += src[j];
index ffddd2b453523c137dae115fde91aa1e91d5471a..bec6fe880657b9149228ac191ac1cb309f6bc05a 100644 (file)
@@ -191,7 +191,7 @@ static int sysctl_tcp_congestion_control(ctl_table *table, int __user *name,
 
        tcp_get_default_congestion_control(val);
        ret = sysctl_string(&tbl, name, nlen, oldval, oldlenp, newval, newlen);
-       if (ret == 0 && newval && newlen)
+       if (ret == 1 && newval && newlen)
                ret = tcp_set_default_congestion_control(val);
        return ret;
 }
index 64f1cbaf96e8a487bba6edc9398aeff535c2ec79..5aa5f5496d6d79e4553fcb2cdf0f5f8283f33e45 100644 (file)
@@ -298,7 +298,7 @@ static u32 tcp_illinois_ssthresh(struct sock *sk)
        struct illinois *ca = inet_csk_ca(sk);
 
        /* Multiplicative decrease */
-       return max((tp->snd_cwnd * ca->beta) >> BETA_SHIFT, 2U);
+       return max(tp->snd_cwnd - ((tp->snd_cwnd * ca->beta) >> BETA_SHIFT), 2U);
 }
 
 
index e566f3c676772d6a7141bb50213d7eb0430135d3..652c32368cccb6cb590c2c4eec96b77026288d0b 100644 (file)
@@ -900,8 +900,7 @@ int tcp_v4_md5_do_add(struct sock *sk, __be32 addr,
                                       sizeof(*keys) * md5sig->entries4);
 
                        /* Free old key list, and reference new one */
-                       if (md5sig->keys4)
-                               kfree(md5sig->keys4);
+                       kfree(md5sig->keys4);
                        md5sig->keys4 = keys;
                        md5sig->alloced4++;
                }
@@ -939,10 +938,10 @@ int tcp_v4_md5_do_del(struct sock *sk, __be32 addr)
                                tp->md5sig_info->alloced4 = 0;
                        } else if (tp->md5sig_info->entries4 != i) {
                                /* Need to do some manipulation */
-                               memcpy(&tp->md5sig_info->keys4[i],
-                                      &tp->md5sig_info->keys4[i+1],
-                                      (tp->md5sig_info->entries4 - i) *
-                                       sizeof(struct tcp4_md5sig_key));
+                               memmove(&tp->md5sig_info->keys4[i],
+                                       &tp->md5sig_info->keys4[i+1],
+                                       (tp->md5sig_info->entries4 - i) *
+                                        sizeof(struct tcp4_md5sig_key));
                        }
                        tcp_free_md5sig_pool();
                        return 0;
index 324b4207254ae411728dd8a3cc1740f5ac0ce267..e5130a7fe181865f70476f402007d941b37af707 100644 (file)
@@ -1295,6 +1295,7 @@ static int tcp_mtu_probe(struct sock *sk)
        struct sk_buff *skb, *nskb, *next;
        int len;
        int probe_size;
+       int size_needed;
        unsigned int pif;
        int copy;
        int mss_now;
@@ -1313,27 +1314,20 @@ static int tcp_mtu_probe(struct sock *sk)
        /* Very simple search strategy: just double the MSS. */
        mss_now = tcp_current_mss(sk, 0);
        probe_size = 2*tp->mss_cache;
+       size_needed = probe_size + (tp->reordering + 1) * tp->mss_cache;
        if (probe_size > tcp_mtu_to_mss(sk, icsk->icsk_mtup.search_high)) {
                /* TODO: set timer for probe_converge_event */
                return -1;
        }
 
        /* Have enough data in the send queue to probe? */
-       len = 0;
-       if ((skb = tcp_send_head(sk)) == NULL)
-               return -1;
-       while ((len += skb->len) < probe_size && !tcp_skb_is_last(sk, skb))
-               skb = tcp_write_queue_next(sk, skb);
-       if (len < probe_size)
+       if (tp->write_seq - tp->snd_nxt < size_needed)
                return -1;
 
-       /* Receive window check. */
-       if (after(TCP_SKB_CB(skb)->seq + probe_size, tp->snd_una + tp->snd_wnd)) {
-               if (tp->snd_wnd < probe_size)
-                       return -1;
-               else
-                       return 0;
-       }
+       if (tp->snd_wnd < size_needed)
+               return -1;
+       if (after(tp->snd_nxt + size_needed, tp->snd_una + tp->snd_wnd))
+               return 0;
 
        /* Do we need to wait to drain cwnd? */
        pif = tcp_packets_in_flight(tp);
@@ -1352,7 +1346,6 @@ static int tcp_mtu_probe(struct sock *sk)
 
        skb = tcp_send_head(sk);
        tcp_insert_write_queue_before(nskb, skb, sk);
-       tcp_advance_send_head(sk, skb);
 
        TCP_SKB_CB(nskb)->seq = TCP_SKB_CB(skb)->seq;
        TCP_SKB_CB(nskb)->end_seq = TCP_SKB_CB(skb)->seq + probe_size;
index 1bd8d818f8e9ec1b28b3ae74eae6d78975d03020..567664eac463633643ddd63735b304d3e5efa3f6 100644 (file)
@@ -967,7 +967,7 @@ int ipv6_dev_get_saddr(struct net_device *daddr_dev,
                        if (unlikely(score.addr_type == IPV6_ADDR_ANY ||
                                     score.addr_type & IPV6_ADDR_MULTICAST)) {
                                LIMIT_NETDEBUG(KERN_DEBUG
-                                              "ADDRCONF: unspecified / multicast address"
+                                              "ADDRCONF: unspecified / multicast address "
                                               "assigned as unicast address on %s",
                                               dev->name);
                                continue;
index 3aad861975a0a084d4ec952e2c1082d87cff7ba3..93980c3b83e694460fe42ab4ed74e91f47649d2f 100644 (file)
@@ -581,7 +581,10 @@ static int tcp_v6_md5_do_add(struct sock *sk, struct in6_addr *peer,
                        }
                        sk->sk_route_caps &= ~NETIF_F_GSO_MASK;
                }
-               tcp_alloc_md5sig_pool();
+               if (tcp_alloc_md5sig_pool() == NULL) {
+                       kfree(newkey);
+                       return -ENOMEM;
+               }
                if (tp->md5sig_info->alloced6 == tp->md5sig_info->entries6) {
                        keys = kmalloc((sizeof (tp->md5sig_info->keys6[0]) *
                                       (tp->md5sig_info->entries6 + 1)), GFP_ATOMIC);
@@ -634,10 +637,6 @@ static int tcp_v6_md5_do_del(struct sock *sk, struct in6_addr *peer)
                                kfree(tp->md5sig_info->keys6);
                                tp->md5sig_info->keys6 = NULL;
                                tp->md5sig_info->alloced6 = 0;
-
-                               tcp_free_md5sig_pool();
-
-                               return 0;
                        } else {
                                /* shrink the database */
                                if (tp->md5sig_info->entries6 != i)
@@ -646,6 +645,8 @@ static int tcp_v6_md5_do_del(struct sock *sk, struct in6_addr *peer)
                                                (tp->md5sig_info->entries6 - i)
                                                * sizeof (tp->md5sig_info->keys6[0]));
                        }
+                       tcp_free_md5sig_pool();
+                       return 0;
                }
        }
        return -ENOENT;
index dc5e34a01620b8225d8f4081c03e84ef4288b706..a86a5d83786b349bb92e773ad8d70c0d6340fe49 100644 (file)
@@ -928,7 +928,7 @@ void iriap_call_indication(struct iriap_cb *self, struct sk_buff *skb)
 
        opcode = fp[0];
        if (~opcode & 0x80) {
-               IRDA_WARNING("%s: IrIAS multiframe commands or results"
+               IRDA_WARNING("%s: IrIAS multiframe commands or results "
                             "is not implemented yet!\n", __FUNCTION__);
                return;
        }
index 7f9c8542e5fc0deabdb0ff86a7fd654a1fc962c0..c68220773d28ee2d62dd8af780dc72adc9a80794 100644 (file)
@@ -296,6 +296,7 @@ void irlan_eth_flow_indication(void *instance, void *sap, LOCAL_FLOW flow)
  */
 void irlan_eth_send_gratuitous_arp(struct net_device *dev)
 {
+#ifdef CONFIG_INET
        struct in_device *in_dev;
 
        /*
@@ -303,7 +304,6 @@ void irlan_eth_send_gratuitous_arp(struct net_device *dev)
         * is useful if we have changed access points on the same
         * subnet.
         */
-#ifdef CONFIG_INET
        IRDA_DEBUG(4, "IrLAN: Sending gratuitous ARP\n");
        rcu_read_lock();
        in_dev = __in_dev_get_rcu(dev);
index 10c89d47f685e492702a595dfc0061269d27801f..878039b9557dddae70eddd32a342fed056261581 100644 (file)
@@ -1015,9 +1015,7 @@ static inline struct sk_buff *pfkey_xfrm_state2msg(struct xfrm_state *x)
 {
        struct sk_buff *skb;
 
-       spin_lock_bh(&x->lock);
        skb = __pfkey_xfrm_state2msg(x, 1, 3);
-       spin_unlock_bh(&x->lock);
 
        return skb;
 }
@@ -1552,7 +1550,7 @@ static int pfkey_get(struct sock *sk, struct sk_buff *skb, struct sadb_msg *hdr,
 
        out_hdr = (struct sadb_msg *) out_skb->data;
        out_hdr->sadb_msg_version = hdr->sadb_msg_version;
-       out_hdr->sadb_msg_type = SADB_DUMP;
+       out_hdr->sadb_msg_type = SADB_GET;
        out_hdr->sadb_msg_satype = pfkey_proto2satype(proto);
        out_hdr->sadb_msg_errno = 0;
        out_hdr->sadb_msg_reserved = 0;
index 0dc114c4ef2b4d97fcbfcaaf962d7825e7815625..505af1f067ab06620fcb2050a2725a711c321f66 100644 (file)
@@ -267,6 +267,17 @@ static int ieee80211_open(struct net_device *dev)
                tasklet_enable(&local->tasklet);
        }
 
+       /*
+        * set_multicast_list will be invoked by the networking core
+        * which will check whether any increments here were done in
+        * error and sync them down to the hardware as filter flags.
+        */
+       if (sdata->flags & IEEE80211_SDATA_ALLMULTI)
+               atomic_inc(&local->iff_allmultis);
+
+       if (sdata->flags & IEEE80211_SDATA_PROMISC)
+               atomic_inc(&local->iff_promiscs);
+
        local->open_count++;
 
        netif_start_queue(dev);
@@ -284,6 +295,18 @@ static int ieee80211_stop(struct net_device *dev)
 
        netif_stop_queue(dev);
 
+       /*
+        * Don't count this interface for promisc/allmulti while it
+        * is down. dev_mc_unsync() will invoke set_multicast_list
+        * on the master interface which will sync these down to the
+        * hardware as filter flags.
+        */
+       if (sdata->flags & IEEE80211_SDATA_ALLMULTI)
+               atomic_dec(&local->iff_allmultis);
+
+       if (sdata->flags & IEEE80211_SDATA_PROMISC)
+               atomic_dec(&local->iff_promiscs);
+
        dev_mc_unsync(local->mdev, dev);
 
        /* down all dependent devices, that is VLANs */
@@ -370,8 +393,8 @@ static void ieee80211_set_multicast_list(struct net_device *dev)
 
        allmulti = !!(dev->flags & IFF_ALLMULTI);
        promisc = !!(dev->flags & IFF_PROMISC);
-       sdata_allmulti = sdata->flags & IEEE80211_SDATA_ALLMULTI;
-       sdata_promisc = sdata->flags & IEEE80211_SDATA_PROMISC;
+       sdata_allmulti = !!(sdata->flags & IEEE80211_SDATA_ALLMULTI);
+       sdata_promisc = !!(sdata->flags & IEEE80211_SDATA_PROMISC);
 
        if (allmulti != sdata_allmulti) {
                if (dev->flags & IFF_ALLMULTI)
index 015b3f879aa921f41c0d11a52a632c39be407852..16afd24d4f6b2bb392914e9fac06434ed205b54f 100644 (file)
@@ -2647,7 +2647,7 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw)
        local->sta_scanning = 0;
 
        if (ieee80211_hw_config(local))
-               printk(KERN_DEBUG "%s: failed to restore operational"
+               printk(KERN_DEBUG "%s: failed to restore operational "
                       "channel after scan\n", dev->name);
 
 
index 8210f549c4929914f29fe07f4d81809bbdb41a24..5390bc792159c7a4fdc190308f74a0c2fe9add62 100644 (file)
@@ -6,9 +6,9 @@ menuconfig IP_SCTP
        tristate "The SCTP Protocol (EXPERIMENTAL)"
        depends on INET && EXPERIMENTAL
        depends on IPV6 || IPV6=n
-       select CRYPTO if SCTP_HMAC_SHA1 || SCTP_HMAC_MD5
-       select CRYPTO_HMAC if SCTP_HMAC_SHA1 || SCTP_HMAC_MD5
-       select CRYPTO_SHA1 if SCTP_HMAC_SHA1
+       select CRYPTO
+       select CRYPTO_HMAC
+       select CRYPTO_SHA1
        select CRYPTO_MD5 if SCTP_HMAC_MD5
        ---help---
          Stream Control Transmission Protocol
index 6d5fa6bb371b0ce2d85a77093092ac440d93684a..97e6ebd145001e9b642fcf59d882714fa814e53e 100644 (file)
@@ -54,11 +54,13 @@ static struct sctp_hmac sctp_hmac_list[SCTP_AUTH_NUM_HMACS] = {
                /* id 2 is reserved as well */
                .hmac_id = SCTP_AUTH_HMAC_ID_RESERVED_2,
        },
+#if defined (CONFIG_CRYPTO_SHA256) || defined (CONFIG_CRYPTO_SHA256_MODULE)
        {
                .hmac_id = SCTP_AUTH_HMAC_ID_SHA256,
                .hmac_name="hmac(sha256)",
                .hmac_len = SCTP_SHA256_SIG_SIZE,
        }
+#endif
 };
 
 
@@ -631,7 +633,7 @@ static int __sctp_auth_cid(sctp_cid_t chunk, struct sctp_chunks_param *param)
        int found = 0;
        int i;
 
-       if (!param)
+       if (!param || param->param_hdr.length == 0)
                return 0;
 
        len = ntohs(param->param_hdr.length) - sizeof(sctp_paramhdr_t);
index 5a9783c38de160c40d66894dbefab7b6e4c76f1c..f4876291bb5e6279cdfbb324474682e673305573 100644 (file)
@@ -77,6 +77,8 @@ static int sctp_process_param(struct sctp_association *asoc,
                              union sctp_params param,
                              const union sctp_addr *peer_addr,
                              gfp_t gfp);
+static void *sctp_addto_param(struct sctp_chunk *chunk, int len,
+                             const void *data);
 
 /* What was the inbound interface for this chunk? */
 int sctp_chunk_iif(const struct sctp_chunk *chunk)
@@ -207,11 +209,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,
 
        chunksize = sizeof(init) + addrs_len + SCTP_SAT_LEN(num_types);
        chunksize += sizeof(ecap_param);
-       if (sctp_prsctp_enable) {
-               chunksize += sizeof(prsctp_param);
-               extensions[num_ext] = SCTP_CID_FWD_TSN;
-               num_ext += 1;
-       }
+
        /* ADDIP: Section 4.2.7:
         *  An implementation supporting this extension [ADDIP] MUST list
         *  the ASCONF,the ASCONF-ACK, and the AUTH  chunks in its INIT and
@@ -243,7 +241,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,
                if (auth_chunks->length)
                        chunksize += ntohs(auth_chunks->length);
                else
-                       auth_hmacs = NULL;
+                       auth_chunks = NULL;
 
                extensions[num_ext] = SCTP_CID_AUTH;
                num_ext += 1;
@@ -297,7 +295,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,
                            htons(sizeof(sctp_supported_ext_param_t) + num_ext);
                sctp_addto_chunk(retval, sizeof(sctp_supported_ext_param_t),
                                &ext_param);
-               sctp_addto_chunk(retval, num_ext, extensions);
+               sctp_addto_param(retval, num_ext, extensions);
        }
 
        if (sctp_prsctp_enable)
@@ -371,20 +369,12 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc,
        if (asoc->peer.ecn_capable)
                chunksize += sizeof(ecap_param);
 
-       /* Tell peer that we'll do PR-SCTP only if peer advertised.  */
-       if (asoc->peer.prsctp_capable) {
-               chunksize += sizeof(prsctp_param);
-               extensions[num_ext] = SCTP_CID_FWD_TSN;
-               num_ext += 1;
-       }
-
        if (sctp_addip_enable) {
                extensions[num_ext] = SCTP_CID_ASCONF;
                extensions[num_ext+1] = SCTP_CID_ASCONF_ACK;
                num_ext += 2;
        }
 
-       chunksize += sizeof(ext_param) + num_ext;
        chunksize += sizeof(aiparam);
 
        if (asoc->peer.auth_capable) {
@@ -407,6 +397,9 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc,
                num_ext += 1;
        }
 
+       if (num_ext)
+               chunksize += sizeof(sctp_supported_ext_param_t) + num_ext;
+
        /* Now allocate and fill out the chunk.  */
        retval = sctp_make_chunk(asoc, SCTP_CID_INIT_ACK, 0, chunksize);
        if (!retval)
@@ -428,7 +421,7 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc,
                            htons(sizeof(sctp_supported_ext_param_t) + num_ext);
                sctp_addto_chunk(retval, sizeof(sctp_supported_ext_param_t),
                                 &ext_param);
-               sctp_addto_chunk(retval, num_ext, extensions);
+               sctp_addto_param(retval, num_ext, extensions);
        }
        if (asoc->peer.prsctp_capable)
                sctp_addto_chunk(retval, sizeof(prsctp_param), &prsctp_param);
index 5ebbe808d801030341fbe3bd3cf7ff49b1c2d6f2..5fb84778846d9b2e353a2346e1e6c4f458eaea0e 100644 (file)
@@ -959,7 +959,7 @@ sctp_disposition_t sctp_sf_sendbeat_8_3(const struct sctp_endpoint *ep,
 {
        struct sctp_transport *transport = (struct sctp_transport *) arg;
 
-       if (asoc->overall_error_count >= asoc->max_retrans) {
+       if (asoc->overall_error_count > asoc->max_retrans) {
                sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
                                SCTP_ERROR(ETIMEDOUT));
                /* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */
@@ -1146,7 +1146,7 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep,
        /* Check if the timestamp looks valid.  */
        if (time_after(hbinfo->sent_at, jiffies) ||
            time_after(jiffies, hbinfo->sent_at + max_interval)) {
-               SCTP_DEBUG_PRINTK("%s: HEARTBEAT ACK with invalid timestamp"
+               SCTP_DEBUG_PRINTK("%s: HEARTBEAT ACK with invalid timestamp "
                                  "received for transport: %p\n",
                                   __FUNCTION__, link);
                return SCTP_DISPOSITION_DISCARD;
index 53995af9ca4b0f3b64708f59025528172ee80d4b..22906b80352311277ff833d0411324d5716dec3c 100644 (file)
@@ -967,7 +967,7 @@ gss_validate(struct rpc_task *task, __be32 *p)
        if (maj_stat == GSS_S_CONTEXT_EXPIRED)
                clear_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags);
        if (maj_stat) {
-               dprintk("RPC: %5u gss_validate: gss_verify_mic returned"
+               dprintk("RPC: %5u gss_validate: gss_verify_mic returned "
                                "error 0x%08x\n", task->tk_pid, maj_stat);
                goto out_bad;
        }
index 282a9a2ec90c6e5f6c78b1c8b0e6cfe95e04461c..cd641c8634f044c6bb580c2d725bdb908e97849d 100644 (file)
@@ -62,7 +62,7 @@ static inline void    do_xprt_reserve(struct rpc_task *);
 static void    xprt_connect_status(struct rpc_task *task);
 static int      __xprt_get_cong(struct rpc_xprt *, struct rpc_task *);
 
-static spinlock_t xprt_list_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(xprt_list_lock);
 static LIST_HEAD(xprt_list);
 
 /*
index 02298f529dad3f4a068ed86d4cf00cbe8e352eaf..2f630a512ab753f7e2df18a42a2abb02f04893ba 100644 (file)
@@ -1828,7 +1828,7 @@ static struct rpc_xprt *xs_setup_xprt(struct xprt_create *args,
  * @args: rpc transport creation arguments
  *
  */
-struct rpc_xprt *xs_setup_udp(struct xprt_create *args)
+static struct rpc_xprt *xs_setup_udp(struct xprt_create *args)
 {
        struct sockaddr *addr = args->dstaddr;
        struct rpc_xprt *xprt;
@@ -1894,7 +1894,7 @@ struct rpc_xprt *xs_setup_udp(struct xprt_create *args)
  * @args: rpc transport creation arguments
  *
  */
-struct rpc_xprt *xs_setup_tcp(struct xprt_create *args)
+static struct rpc_xprt *xs_setup_tcp(struct xprt_create *args)
 {
        struct sockaddr *addr = args->dstaddr;
        struct rpc_xprt *xprt;
index e835da8fc09184f8e2dddcba9c471922af1b1165..060bba4567d2588d2ceafce255e75ee84aa55b27 100644 (file)
@@ -1637,8 +1637,15 @@ static int unix_dgram_recvmsg(struct kiocb *iocb, struct socket *sock,
        mutex_lock(&u->readlock);
 
        skb = skb_recv_datagram(sk, flags, noblock, &err);
-       if (!skb)
+       if (!skb) {
+               unix_state_lock(sk);
+               /* Signal EOF on disconnected non-blocking SEQPACKET socket. */
+               if (sk->sk_type == SOCK_SEQPACKET && err == -EAGAIN &&
+                   (sk->sk_shutdown & RCV_SHUTDOWN))
+                       err = 0;
+               unix_state_unlock(sk);
                goto out_unlock;
+       }
 
        wake_up_interruptible_sync(&u->peer_wait);
 
index 85e5f9dd0d8e757f03e69ac08966addff50bd163..47e80cc2077c23fd207ce01478f8761f4c0baa05 100644 (file)
@@ -1094,7 +1094,7 @@ int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd,
        rtnl_lock();
        ret = wireless_process_ioctl(net, ifr, cmd);
        rtnl_unlock();
-       if (IW_IS_GET(cmd) && copy_to_user(arg, ifr, sizeof(struct ifreq)))
+       if (IW_IS_GET(cmd) && copy_to_user(arg, ifr, sizeof(struct iwreq)))
                return -EFAULT;
        return ret;
 }
index b702bd8a3893b7f2471df1c23df25a7105da70da..9a4cf2e45a15f2b10c94aaba287b1f534cc32989 100644 (file)
@@ -1344,6 +1344,7 @@ restart:
        xfrm_nr += pols[0]->xfrm_nr;
 
        switch (policy->action) {
+       default:
        case XFRM_POLICY_BLOCK:
                /* Prohibit the flow */
                err = -EPERM;
index 224b44e31a07b934091f79e42b85888ab143925f..cf43c49eab37f3c2abfee6c707fc1c24934662f0 100644 (file)
@@ -552,7 +552,7 @@ int __xfrm_state_delete(struct xfrm_state *x)
                 * The xfrm_state_alloc call gives a reference, and that
                 * is what we are dropping here.
                 */
-               __xfrm_state_put(x);
+               xfrm_state_put(x);
                err = 0;
        }
 
index d41588d101d01db756f5db3a1cd40d6e783883a9..e75dbdcb08a49674b846f2ce14b02598b2ba6b3e 100644 (file)
@@ -507,7 +507,6 @@ static int copy_to_user_state_extra(struct xfrm_state *x,
                                    struct xfrm_usersa_info *p,
                                    struct sk_buff *skb)
 {
-       spin_lock_bh(&x->lock);
        copy_to_user_state(x, p);
 
        if (x->coaddr)
@@ -515,7 +514,6 @@ static int copy_to_user_state_extra(struct xfrm_state *x,
 
        if (x->lastused)
                NLA_PUT_U64(skb, XFRMA_LASTUSED, x->lastused);
-       spin_unlock_bh(&x->lock);
 
        if (x->aalg)
                NLA_PUT(skb, XFRMA_ALG_AUTH, alg_len(x->aalg), x->aalg);
index c6bee85c396250b4f4d07999392d56a818ca40b3..a38787a881ea29bd876efdcbc483867827189b9d 100644 (file)
@@ -591,7 +591,6 @@ int main(int ac, char **av)
                        conf_read_simple(name, S_DEF_USER);
                else if (!stat("all.config", &tmpstat))
                        conf_read_simple("all.config", S_DEF_USER);
-               conf_set_env_sym("K64BIT", "64BIT", S_DEF_USER);
                break;
        default:
                break;
index e4fa3f302541c155ef552ca843cad003cb2ac3f4..e0f402f3b75d94d765875a6299f1f154e23a1c32 100644 (file)
@@ -145,33 +145,6 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
        return 0;
 }
 
-/* Read an environment variable and assign the value to the symbol */
-int conf_set_env_sym(const char *env, const char *symname, int def)
-{
-       struct symbol *sym;
-       char *p;
-       int def_flags;
-
-       p = getenv(env);
-       if (p) {
-               char warning[200];
-               sprintf(warning, "Environment variable (%s = \"%s\")", env, p);
-               conf_filename = warning;
-               def_flags = SYMBOL_DEF << def;
-               if (def == S_DEF_USER) {
-                       sym = sym_find(symname);
-                       if (!sym)
-                               return 1;
-               } else {
-                       sym = sym_lookup(symname, 0);
-                       if (sym->type == S_UNKNOWN)
-                               sym->type = S_OTHER;
-               }
-               conf_set_sym_val(sym, def, def_flags, p);
-       }
-       return 0;
-}
-
 int conf_read_simple(const char *name, int def)
 {
        FILE *in = NULL;
index dca294e90cc3defae809b49ed104dfb728cfc81a..4d09f6ddefe3daa71bb9d5d8bcbe1b774b0b2821 100644 (file)
@@ -1,7 +1,6 @@
 
 /* confdata.c */
 P(conf_parse,void,(const char *name));
-P(conf_set_env_sym,int,(const char *envname, const char *symname, int def));
 P(conf_read,int,(const char *name));
 P(conf_read_simple,int,(const char *name, int));
 P(conf_write,int,(const char *name));