]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 4 Nov 2011 04:05:43 +0000 (21:05 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 4 Nov 2011 04:05:43 +0000 (21:05 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (45 commits)
  be2net: Add detect UE feature for Lancer
  be2net: Prevent CQ full condition for Lancer
  be2net: Fix disabling multicast promiscous mode
  be2net: Fix endian issue in RX filter command
  af_packet: de-inline some helper functions
  MAINTAINERS: Add can-gw include to maintained files
  net: Add back alignment for size for __alloc_skb
  net: add missing bh_unlock_sock() calls
  l2tp: fix race in l2tp_recv_dequeue()
  ixgbevf: Update release version
  ixgbe: DCB, return max for IEEE traffic classes
  ixgbe: fix reading of the buffer returned by the firmware
  ixgbe: Fix compiler warnings
  ixgbe: fix smatch splat due to missing NULL check
  ixgbe: fix disabling of Tx laser at probe
  ixgbe: Fix link issues caused by a reset while interface is down
  igb: Fix for I347AT4 PHY cable length unit detection
  e100: make sure vlan support isn't advertised on old adapters
  e1000e: demote a debugging WARN to a debug log message
  net: fix typo in drivers/net/ethernet/xilinx/ll_temac_main.c
  ...

77 files changed:
Documentation/networking/ipvs-sysctl.txt
MAINTAINERS
drivers/isdn/hisax/l3dss1.c
drivers/net/bonding/bond_main.c
drivers/net/bonding/bond_procfs.c
drivers/net/ethernet/Kconfig
drivers/net/ethernet/Makefile
drivers/net/ethernet/apple/Kconfig
drivers/net/ethernet/apple/Makefile
drivers/net/ethernet/cirrus/Kconfig
drivers/net/ethernet/cirrus/Makefile
drivers/net/ethernet/cirrus/mac89x0.c [moved from drivers/net/ethernet/apple/mac89x0.c with 100% similarity]
drivers/net/ethernet/emulex/benet/be_cmds.c
drivers/net/ethernet/emulex/benet/be_hw.h
drivers/net/ethernet/emulex/benet/be_main.c
drivers/net/ethernet/i825xx/3c505.c
drivers/net/ethernet/intel/e100.c
drivers/net/ethernet/intel/e1000e/ich8lan.c
drivers/net/ethernet/intel/igb/e1000_phy.c
drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
drivers/net/ethernet/realtek/Kconfig
drivers/net/ethernet/realtek/Makefile
drivers/net/ethernet/silan/Kconfig [new file with mode: 0644]
drivers/net/ethernet/silan/Makefile [new file with mode: 0644]
drivers/net/ethernet/silan/sc92031.c [moved from drivers/net/ethernet/realtek/sc92031.c with 100% similarity]
drivers/net/ethernet/xilinx/ll_temac_main.c
include/linux/netfilter_ipv4/Kbuild
include/linux/netfilter_ipv4/nf_nat.h [new file with mode: 0644]
include/linux/skbuff.h
include/net/ip_vs.h
include/net/netfilter/nf_conntrack_tuple.h
include/net/netfilter/nf_nat.h
include/net/tcp.h
include/net/udp.h
net/8021q/vlan_dev.c
net/bridge/netfilter/ebt_ulog.c
net/core/neighbour.c
net/core/skbuff.c
net/dccp/ipv4.c
net/ipv4/netfilter/ipt_CLUSTERIP.c
net/ipv4/netfilter/ipt_ULOG.c
net/ipv4/netfilter/nf_nat_snmp_basic.c
net/ipv4/tcp_ipv4.c
net/ipv4/udp.c
net/ipv4/udplite.c
net/ipv6/netfilter.c
net/ipv6/netfilter/nf_conntrack_reasm.c
net/ipv6/tcp_ipv6.c
net/ipv6/udp.c
net/ipv6/udplite.c
net/l2tp/l2tp_core.c
net/netfilter/core.c
net/netfilter/ipset/ip_set_core.c
net/netfilter/ipvs/ip_vs_core.c
net/netfilter/ipvs/ip_vs_ctl.c
net/netfilter/ipvs/ip_vs_dh.c
net/netfilter/ipvs/ip_vs_ftp.c
net/netfilter/ipvs/ip_vs_lblc.c
net/netfilter/ipvs/ip_vs_lblcr.c
net/netfilter/ipvs/ip_vs_nfct.c
net/netfilter/ipvs/ip_vs_proto.c
net/netfilter/ipvs/ip_vs_proto_sctp.c
net/netfilter/ipvs/ip_vs_proto_tcp.c
net/netfilter/ipvs/ip_vs_proto_udp.c
net/netfilter/ipvs/ip_vs_sh.c
net/netfilter/ipvs/ip_vs_wrr.c
net/netfilter/ipvs/ip_vs_xmit.c
net/netfilter/nf_conntrack_core.c
net/netfilter/nfnetlink_log.c
net/netfilter/xt_IDLETIMER.c
net/netfilter/xt_hashlimit.c
net/packet/af_packet.c
net/x25/af_x25.c

index 4ccdbca038115140a4aa95d668065935b29cdd8a..f2a2488f1bf33d8290384c4823fccee2b39afe36 100644 (file)
@@ -15,6 +15,23 @@ amemthresh - INTEGER
         enabled and the variable is automatically set to 2, otherwise
         the strategy is disabled and the variable is  set  to 1.
 
+conntrack - BOOLEAN
+       0 - disabled (default)
+       not 0 - enabled
+
+       If set, maintain connection tracking entries for
+       connections handled by IPVS.
+
+       This should be enabled if connections handled by IPVS are to be
+       also handled by stateful firewall rules. That is, iptables rules
+       that make use of connection tracking.  It is a performance
+       optimisation to disable this setting otherwise.
+
+       Connections handled by the IPVS FTP application module
+       will have connection tracking entries regardless of this setting.
+
+       Only available when IPVS is compiled with CONFIG_IP_VS_NFCT enabled.
+
 cache_bypass - BOOLEAN
         0 - disabled (default)
         not 0 - enabled
@@ -39,7 +56,7 @@ debug_level - INTEGER
        11         - IPVS packet handling (ip_vs_in/ip_vs_out)
        12 or more - packet traversal
 
-       Only available when IPVS is compiled with the CONFIG_IPVS_DEBUG
+       Only available when IPVS is compiled with CONFIG_IP_VS_DEBUG enabled.
 
        Higher debugging levels include the messages for lower debugging
        levels, so setting debug level 2, includes level 0, 1 and 2
@@ -123,13 +140,11 @@ nat_icmp_send - BOOLEAN
 secure_tcp - INTEGER
         0  - disabled (default)
 
-        The secure_tcp defense is to use a more complicated state
-        transition table and some possible short timeouts of each
-        state. In the VS/NAT, it delays the entering the ESTABLISHED
-        until the real server starts to send data and ACK packet
-        (after 3-way handshake).
+       The secure_tcp defense is to use a more complicated TCP state
+       transition table. For VS/NAT, it also delays entering the
+       TCP ESTABLISHED state until the three way handshake is completed.
 
-        The value definition is the same as that of drop_entry or
+        The value definition is the same as that of drop_entry and
         drop_packet.
 
 sync_threshold - INTEGER
@@ -141,3 +156,36 @@ sync_threshold - INTEGER
         synchronized, every time the number of its incoming packets
         modulus 50 equals the threshold. The range of the threshold is
         from 0 to 49.
+
+snat_reroute - BOOLEAN
+       0 - disabled
+       not 0 - enabled (default)
+
+       If enabled, recalculate the route of SNATed packets from
+       realservers so that they are routed as if they originate from the
+       director. Otherwise they are routed as if they are forwarded by the
+       director.
+
+       If policy routing is in effect then it is possible that the route
+       of a packet originating from a director is routed differently to a
+       packet being forwarded by the director.
+
+       If policy routing is not in effect then the recalculated route will
+       always be the same as the original route so it is an optimisation
+       to disable snat_reroute and avoid the recalculation.
+
+sync_version - INTEGER
+       default 1
+
+       The version of the synchronisation protocol used when sending
+       synchronisation messages.
+
+       0 selects the original synchronisation protocol (version 0). This
+       should be used when sending synchronisation messages to a legacy
+       system that only understands the original synchronisation protocol.
+
+       1 selects the current synchronisation protocol (version 1). This
+       should be used where possible.
+
+       Kernels with this sync_version entry are able to receive messages
+       of both version 1 and version 2 of the synchronisation protocol.
index ab7767001286b2ae658a69475bdddab31e39aeaa..a6afe342f0fc767fb4b90bb48a37786bc1ade371 100644 (file)
@@ -1716,6 +1716,7 @@ F:        include/linux/can.h
 F:     include/linux/can/core.h
 F:     include/linux/can/bcm.h
 F:     include/linux/can/raw.h
+F:     include/linux/can/gw.h
 
 CAN NETWORK DRIVERS
 M:     Wolfgang Grandegger <wg@grandegger.com>
@@ -4476,11 +4477,9 @@ F:       Documentation/networking/vxge.txt
 F:     drivers/net/ethernet/neterion/
 
 NETFILTER/IPTABLES/IPCHAINS
-P:     Rusty Russell
-P:     Marc Boucher
-P:     James Morris
 P:     Harald Welte
 P:     Jozsef Kadlecsik
+M:     Pablo Neira Ayuso <pablo@netfilter.org>
 M:     Patrick McHardy <kaber@trash.net>
 L:     netfilter-devel@vger.kernel.org
 L:     netfilter@vger.kernel.org
index b0d9ab1f21c07b22b1a770ebaab18a87b43202e2..6a8acf65777da9447aa4388b2893fe43328769a3 100644 (file)
@@ -353,7 +353,7 @@ l3dss1_parse_facility(struct PStack *st, struct l3_process *pc,
                                 { l3dss1_dummy_invoke(st, cr, id, ident, p, nlen);
                                    return;
                                  } 
-#ifdef HISAX_DE_AOC
+#ifdef CONFIG_DE_AOC
                        {
 
 #define FOO1(s,a,b) \
@@ -422,9 +422,9 @@ l3dss1_parse_facility(struct PStack *st, struct l3_process *pc,
 #undef FOO1
 
                        }
-#else  /* not HISAX_DE_AOC */
+#else  /* not CONFIG_DE_AOC */
                         l3_debug(st, "invoke break");
-#endif /* not HISAX_DE_AOC */
+#endif /* not CONFIG_DE_AOC */
                        break;
                case 2: /* return result */
                         /* if no process available handle separately */ 
index c34cc1e7c6f6d9b413b899cc66a6356066155d32..b2b9109b6712ef63212600811d3b879687dbc215 100644 (file)
@@ -550,7 +550,7 @@ down:
 /*
  * Get link speed and duplex from the slave's base driver
  * using ethtool. If for some reason the call fails or the
- * values are invalid, fake speed and duplex to 100/Full
+ * values are invalid, set speed and duplex to -1,
  * and return error.
  */
 static int bond_update_speed_duplex(struct slave *slave)
@@ -560,9 +560,8 @@ static int bond_update_speed_duplex(struct slave *slave)
        u32 slave_speed;
        int res;
 
-       /* Fake speed and duplex */
-       slave->speed = SPEED_100;
-       slave->duplex = DUPLEX_FULL;
+       slave->speed = -1;
+       slave->duplex = -1;
 
        res = __ethtool_get_settings(slave_dev, &ecmd);
        if (res < 0)
@@ -1751,16 +1750,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
                new_slave->link  = BOND_LINK_DOWN;
        }
 
-       if (bond_update_speed_duplex(new_slave) &&
-           (new_slave->link != BOND_LINK_DOWN)) {
-               pr_warning("%s: Warning: failed to get speed and duplex from %s, assumed to be 100Mb/sec and Full.\n",
-                          bond_dev->name, new_slave->dev->name);
-
-               if (bond->params.mode == BOND_MODE_8023AD) {
-                       pr_warning("%s: Warning: Operation of 802.3ad mode requires ETHTOOL support in base driver for proper aggregator selection.\n",
-                                  bond_dev->name);
-               }
-       }
+       bond_update_speed_duplex(new_slave);
 
        if (USES_PRIMARY(bond->params.mode) && bond->params.primary[0]) {
                /* if there is a primary slave, remember it */
@@ -3220,6 +3210,7 @@ static int bond_slave_netdev_event(unsigned long event,
 {
        struct net_device *bond_dev = slave_dev->master;
        struct bonding *bond = netdev_priv(bond_dev);
+       struct slave *slave = NULL;
 
        switch (event) {
        case NETDEV_UNREGISTER:
@@ -3230,20 +3221,16 @@ static int bond_slave_netdev_event(unsigned long event,
                                bond_release(bond_dev, slave_dev);
                }
                break;
+       case NETDEV_UP:
        case NETDEV_CHANGE:
-               if (bond->params.mode == BOND_MODE_8023AD || bond_is_lb(bond)) {
-                       struct slave *slave;
+               slave = bond_get_slave_by_dev(bond, slave_dev);
+               if (slave) {
+                       u32 old_speed = slave->speed;
+                       u8  old_duplex = slave->duplex;
 
-                       slave = bond_get_slave_by_dev(bond, slave_dev);
-                       if (slave) {
-                               u32 old_speed = slave->speed;
-                               u8  old_duplex = slave->duplex;
-
-                               bond_update_speed_duplex(slave);
-
-                               if (bond_is_lb(bond))
-                                       break;
+                       bond_update_speed_duplex(slave);
 
+                       if (bond->params.mode == BOND_MODE_8023AD) {
                                if (old_speed != slave->speed)
                                        bond_3ad_adapter_speed_changed(slave);
                                if (old_duplex != slave->duplex)
index 95de93b9038675994e66622eff5423ae082583c0..d2ff52e63cbb614ea01c817a1342a6195a4de91d 100644 (file)
@@ -157,8 +157,16 @@ static void bond_info_show_slave(struct seq_file *seq,
        seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name);
        seq_printf(seq, "MII Status: %s\n",
                   (slave->link == BOND_LINK_UP) ?  "up" : "down");
-       seq_printf(seq, "Speed: %d Mbps\n", slave->speed);
-       seq_printf(seq, "Duplex: %s\n", slave->duplex ? "full" : "half");
+       if (slave->speed == -1)
+               seq_printf(seq, "Speed: %s\n", "Unknown");
+       else
+               seq_printf(seq, "Speed: %d Mbps\n", slave->speed);
+
+       if (slave->duplex == -1)
+               seq_printf(seq, "Duplex: %s\n", "Unknown");
+       else
+               seq_printf(seq, "Duplex: %s\n", slave->duplex ? "full" : "half");
+
        seq_printf(seq, "Link Failure Count: %u\n",
                   slave->link_failure_count);
 
index 6dff5a0e733f6f56246569f41094f1ceca88a4f5..597f4d45c632944840c0c5949b1f76d8600131e9 100644 (file)
@@ -159,6 +159,7 @@ config S6GMAC
          will be called s6gmac.
 
 source "drivers/net/ethernet/seeq/Kconfig"
+source "drivers/net/ethernet/silan/Kconfig"
 source "drivers/net/ethernet/sis/Kconfig"
 source "drivers/net/ethernet/sfc/Kconfig"
 source "drivers/net/ethernet/sgi/Kconfig"
index c53ad3afc9917e19ceba34d3a99599ae056d34f1..be5dde040261b748e75535e4521cc5974f946b75 100644 (file)
@@ -58,6 +58,7 @@ obj-$(CONFIG_SH_ETH) += renesas/
 obj-$(CONFIG_NET_VENDOR_RDC) += rdc/
 obj-$(CONFIG_S6GMAC) += s6gmac.o
 obj-$(CONFIG_NET_VENDOR_SEEQ) += seeq/
+obj-$(CONFIG_NET_VENDOR_SILAN) += silan/
 obj-$(CONFIG_NET_VENDOR_SIS) += sis/
 obj-$(CONFIG_SFC) += sfc/
 obj-$(CONFIG_NET_VENDOR_SGI) += sgi/
index a759d5483ab9372d33630c3c1a756f8fe7b9411a..1375e2dc94687d56bac084ad9901e53037bef31a 100644 (file)
@@ -52,18 +52,6 @@ config BMAC
          To compile this driver as a module, choose M here: the module
          will be called bmac.
 
-config MAC89x0
-       tristate "Macintosh CS89x0 based ethernet cards"
-       depends on MAC
-       ---help---
-         Support for CS89x0 chipset based Ethernet cards.  If you have a
-         Nubus or LC-PDS network (Ethernet) card of this type, say Y and
-         read the Ethernet-HOWTO, available from
-         <http://www.tldp.org/docs.html#howto>.
-
-         To compile this driver as a module, choose M here. This module will
-         be called mac89x0.
-
 config MACMACE
        bool "Macintosh (AV) onboard MACE ethernet"
        depends on MAC
index 0d3a5919c95b494ed7b8c7b70848ac7b3584600e..86eaa17af0f4f5ca8ebed6ce3c492daff57f0d9c 100644 (file)
@@ -4,5 +4,4 @@
 
 obj-$(CONFIG_MACE) += mace.o
 obj-$(CONFIG_BMAC) += bmac.o
-obj-$(CONFIG_MAC89x0) += mac89x0.o
 obj-$(CONFIG_MACMACE) += macmace.o
index 6cbb81ccc02ef6bd0a85ab13bbc5ca2cb91b6ec4..1f8648f099c7328d3c8334375d324b413ddb3543 100644 (file)
@@ -6,7 +6,7 @@ config NET_VENDOR_CIRRUS
        bool "Cirrus devices"
        default y
        depends on ISA || EISA || MACH_IXDP2351 || ARCH_IXDP2X01 \
-               || MACH_MX31ADS || MACH_QQ2440 || (ARM && ARCH_EP93XX)
+               || MACH_MX31ADS || MACH_QQ2440 || (ARM && ARCH_EP93XX) || MAC
        ---help---
          If you have a network (Ethernet) card belonging to this class, say Y
          and read the Ethernet-HOWTO, available from
@@ -47,4 +47,16 @@ config EP93XX_ETH
          This is a driver for the ethernet hardware included in EP93xx CPUs.
          Say Y if you are building a kernel for EP93xx based devices.
 
+config MAC89x0
+       tristate "Macintosh CS89x0 based ethernet cards"
+       depends on MAC
+       ---help---
+         Support for CS89x0 chipset based Ethernet cards.  If you have a
+         Nubus or LC-PDS network (Ethernet) card of this type, say Y and
+         read the Ethernet-HOWTO, available from
+         <http://www.tldp.org/docs.html#howto>.
+
+         To compile this driver as a module, choose M here. This module will
+         be called mac89x0.
+
 endif # NET_VENDOR_CIRRUS
index 14bd77e0cb57a464094d04856fa50a5fb5a279fc..ca245e2b5d985fbe8fccc95086891e8f61ec1068 100644 (file)
@@ -4,3 +4,4 @@
 
 obj-$(CONFIG_CS89x0) += cs89x0.o
 obj-$(CONFIG_EP93XX_ETH) += ep93xx_eth.o
+obj-$(CONFIG_MAC89x0) += mac89x0.o
index 824b8e6021f6eff17299350a1e6e9af05380b448..2c7b36673dfc27bbae1c94a033ff702a2a928be4 100644 (file)
@@ -318,8 +318,7 @@ static int be_mbox_db_ready_wait(struct be_adapter *adapter, void __iomem *db)
 
                if (msecs > 4000) {
                        dev_err(&adapter->pdev->dev, "mbox poll timed out\n");
-                       if (!lancer_chip(adapter))
-                               be_detect_dump_ue(adapter);
+                       be_detect_dump_ue(adapter);
                        return -1;
                }
 
@@ -1540,7 +1539,14 @@ int be_cmd_rx_filter(struct be_adapter *adapter, u32 flags, u32 value)
 
                req->if_flags_mask = req->if_flags =
                                cpu_to_le32(BE_IF_FLAGS_MULTICAST);
-               req->mcast_num = cpu_to_le16(netdev_mc_count(adapter->netdev));
+
+               /* Reset mcast promisc mode if already set by setting mask
+                * and not setting flags field
+                */
+               req->if_flags_mask |=
+                               cpu_to_le32(BE_IF_FLAGS_MCAST_PROMISCUOUS);
+
+               req->mcast_num = cpu_to_le32(netdev_mc_count(adapter->netdev));
                netdev_for_each_mc_addr(ha, adapter->netdev)
                        memcpy(req->mcast_mac[i++].byte, ha->addr, ETH_ALEN);
        }
index fbc8a915519e57aa36bb2f01f781475a5530ada1..f2c89e3ccabde3bdbae75296f882eca41df18322 100644 (file)
@@ -48,6 +48,8 @@
 /* Lancer SLIPORT_CONTROL SLIPORT_STATUS registers */
 #define SLIPORT_STATUS_OFFSET          0x404
 #define SLIPORT_CONTROL_OFFSET         0x408
+#define SLIPORT_ERROR1_OFFSET          0x40C
+#define SLIPORT_ERROR2_OFFSET          0x410
 
 #define SLIPORT_STATUS_ERR_MASK                0x80000000
 #define SLIPORT_STATUS_RN_MASK         0x01000000
index 21804972fa2f91cc2278823c096f379403a51218..e0aed188c57fd09b714766f0c96aa9e2c3601f43 100644 (file)
@@ -1905,6 +1905,8 @@ loop_continue:
                be_rx_stats_update(rxo, rxcp);
        }
 
+       be_cq_notify(adapter, rx_cq->id, false, work_done);
+
        /* Refill the queue */
        if (work_done && atomic_read(&rxo->q.used) < RX_FRAGS_REFILL_WM)
                be_post_rx_frags(rxo, GFP_ATOMIC);
@@ -1912,10 +1914,8 @@ loop_continue:
        /* All consumed */
        if (work_done < budget) {
                napi_complete(napi);
-               be_cq_notify(adapter, rx_cq->id, true, work_done);
-       } else {
-               /* More to be consumed; continue with interrupts disabled */
-               be_cq_notify(adapter, rx_cq->id, false, work_done);
+               /* Arm CQ */
+               be_cq_notify(adapter, rx_cq->id, true, 0);
        }
        return work_done;
 }
@@ -1977,42 +1977,62 @@ static int be_poll_tx_mcc(struct napi_struct *napi, int budget)
 
 void be_detect_dump_ue(struct be_adapter *adapter)
 {
-       u32 ue_status_lo, ue_status_hi, ue_status_lo_mask, ue_status_hi_mask;
+       u32 ue_lo = 0, ue_hi = 0, ue_lo_mask = 0, ue_hi_mask = 0;
+       u32 sliport_status = 0, sliport_err1 = 0, sliport_err2 = 0;
        u32 i;
 
-       pci_read_config_dword(adapter->pdev,
-                               PCICFG_UE_STATUS_LOW, &ue_status_lo);
-       pci_read_config_dword(adapter->pdev,
-                               PCICFG_UE_STATUS_HIGH, &ue_status_hi);
-       pci_read_config_dword(adapter->pdev,
-                               PCICFG_UE_STATUS_LOW_MASK, &ue_status_lo_mask);
-       pci_read_config_dword(adapter->pdev,
-                               PCICFG_UE_STATUS_HI_MASK, &ue_status_hi_mask);
+       if (lancer_chip(adapter)) {
+               sliport_status = ioread32(adapter->db + SLIPORT_STATUS_OFFSET);
+               if (sliport_status & SLIPORT_STATUS_ERR_MASK) {
+                       sliport_err1 = ioread32(adapter->db +
+                                       SLIPORT_ERROR1_OFFSET);
+                       sliport_err2 = ioread32(adapter->db +
+                                       SLIPORT_ERROR2_OFFSET);
+               }
+       } else {
+               pci_read_config_dword(adapter->pdev,
+                               PCICFG_UE_STATUS_LOW, &ue_lo);
+               pci_read_config_dword(adapter->pdev,
+                               PCICFG_UE_STATUS_HIGH, &ue_hi);
+               pci_read_config_dword(adapter->pdev,
+                               PCICFG_UE_STATUS_LOW_MASK, &ue_lo_mask);
+               pci_read_config_dword(adapter->pdev,
+                               PCICFG_UE_STATUS_HI_MASK, &ue_hi_mask);
 
-       ue_status_lo = (ue_status_lo & (~ue_status_lo_mask));
-       ue_status_hi = (ue_status_hi & (~ue_status_hi_mask));
+               ue_lo = (ue_lo & (~ue_lo_mask));
+               ue_hi = (ue_hi & (~ue_hi_mask));
+       }
 
-       if (ue_status_lo || ue_status_hi) {
+       if (ue_lo || ue_hi ||
+               sliport_status & SLIPORT_STATUS_ERR_MASK) {
                adapter->ue_detected = true;
                adapter->eeh_err = true;
                dev_err(&adapter->pdev->dev, "UE Detected!!\n");
        }
 
-       if (ue_status_lo) {
-               for (i = 0; ue_status_lo; ue_status_lo >>= 1, i++) {
-                       if (ue_status_lo & 1)
+       if (ue_lo) {
+               for (i = 0; ue_lo; ue_lo >>= 1, i++) {
+                       if (ue_lo & 1)
                                dev_err(&adapter->pdev->dev,
                                "UE: %s bit set\n", ue_status_low_desc[i]);
                }
        }
-       if (ue_status_hi) {
-               for (i = 0; ue_status_hi; ue_status_hi >>= 1, i++) {
-                       if (ue_status_hi & 1)
+       if (ue_hi) {
+               for (i = 0; ue_hi; ue_hi >>= 1, i++) {
+                       if (ue_hi & 1)
                                dev_err(&adapter->pdev->dev,
                                "UE: %s bit set\n", ue_status_hi_desc[i]);
                }
        }
 
+       if (sliport_status & SLIPORT_STATUS_ERR_MASK) {
+               dev_err(&adapter->pdev->dev,
+                       "sliport status 0x%x\n", sliport_status);
+               dev_err(&adapter->pdev->dev,
+                       "sliport error1 0x%x\n", sliport_err1);
+               dev_err(&adapter->pdev->dev,
+                       "sliport error2 0x%x\n", sliport_err2);
+       }
 }
 
 static void be_worker(struct work_struct *work)
@@ -2022,7 +2042,7 @@ static void be_worker(struct work_struct *work)
        struct be_rx_obj *rxo;
        int i;
 
-       if (!adapter->ue_detected && !lancer_chip(adapter))
+       if (!adapter->ue_detected)
                be_detect_dump_ue(adapter);
 
        /* when interrupts are not yet enabled, just reap any pending
index 40e1a175fcebcc5668cb9e137336dfd1cdc21f42..ba82a266051ddfa6a22a84412f79b1f64455de16 100644 (file)
  *
  *********************************************************/
 
-#define filename __FILE__
-
 #define timeout_msg "*** timeout at %s:%s (line %d) ***\n"
 #define TIMEOUT_MSG(lineno) \
-       pr_notice(timeout_msg, filename, __func__, (lineno))
+       pr_notice(timeout_msg, __FILE__, __func__, (lineno))
 
 #define invalid_pcb_msg "*** invalid pcb length %d at %s:%s (line %d) ***\n"
 #define INVALID_PCB_MSG(len) \
-       pr_notice(invalid_pcb_msg, (len), filename, __func__, __LINE__)
+       pr_notice(invalid_pcb_msg, (len), __FILE__, __func__, __LINE__)
 
 #define search_msg "%s: Looking for 3c505 adapter at address %#x..."
 
index ae17cd1a907fb80749227cb79f6c6c407a5fc3be..5a2fdf7a00c8bbbe9a8f9f7a3a7abf8fd1be180f 100644 (file)
@@ -2810,6 +2810,10 @@ static int __devinit e100_probe(struct pci_dev *pdev,
 
        e100_get_defaults(nic);
 
+       /* D100 MAC doesn't allow rx of vlan packets with normal MTU */
+       if (nic->mac < mac_82558_D101_A4)
+               netdev->features |= NETIF_F_VLAN_CHALLENGED;
+
        /* locks must be initialized before calling hw_reset */
        spin_lock_init(&nic->cb_lock);
        spin_lock_init(&nic->cmd_lock);
index 6a17c62cb86f5ad5210d9b5a1452b00995e7da7d..e2a80a283fd313e0e76fa87a8470c09b37415f27 100644 (file)
@@ -866,8 +866,7 @@ static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw)
 
        if (test_and_set_bit(__E1000_ACCESS_SHARED_RESOURCE,
                             &hw->adapter->state)) {
-               WARN(1, "e1000e: %s: contention for Phy access\n",
-                    hw->adapter->netdev->name);
+               e_dbg("contention for Phy access\n");
                return -E1000_ERR_PHY;
        }
 
index 7edf31efe756a45bc56844eb672bd025a1dd7fb6..b17d7c20f8177816434f914f15635b3624361d5e 100644 (file)
@@ -1687,7 +1687,7 @@ s32 igb_get_cable_length_m88_gen2(struct e1000_hw *hw)
                if (ret_val)
                        goto out;
 
-               is_cm = !(phy_data & I347AT4_PCDC_CABLE_LENGTH_UNIT);
+               is_cm = !(phy_data2 & I347AT4_PCDC_CABLE_LENGTH_UNIT);
 
                /* Populate the phy structure with cable length in meters */
                phy->min_cable_length = phy_data / (is_cm ? 100 : 1);
index 834f044be4c3d7fe15febecca9fcd8d8d44c0a59..f1365fef4ed2b7b4e9e3050dce1715ac41c63edc 100644 (file)
@@ -3344,7 +3344,7 @@ static u8 ixgbe_calculate_checksum(u8 *buffer, u32 length)
 static s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,
                                        u32 length)
 {
-       u32 hicr, i;
+       u32 hicr, i, bi;
        u32 hdr_size = sizeof(struct ixgbe_hic_hdr);
        u8 buf_len, dword_len;
 
@@ -3398,9 +3398,9 @@ static s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,
        dword_len = hdr_size >> 2;
 
        /* first pull in the header so we know the buffer length */
-       for (i = 0; i < dword_len; i++) {
-               buffer[i] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, i);
-               le32_to_cpus(&buffer[i]);
+       for (bi = 0; bi < dword_len; bi++) {
+               buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi);
+               le32_to_cpus(&buffer[bi]);
        }
 
        /* If there is any thing in data position pull it in */
@@ -3414,12 +3414,14 @@ static s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,
                goto out;
        }
 
-       /* Calculate length in DWORDs, add one for odd lengths */
-       dword_len = (buf_len + 1) >> 2;
+       /* Calculate length in DWORDs, add 3 for odd lengths */
+       dword_len = (buf_len + 3) >> 2;
 
-       /* Pull in the rest of the buffer (i is where we left off)*/
-       for (; i < buf_len; i++)
-               buffer[i] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, i);
+       /* Pull in the rest of the buffer (bi is where we left off)*/
+       for (; bi <= dword_len; bi++) {
+               buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi);
+               le32_to_cpus(&buffer[bi]);
+       }
 
 out:
        return ret_val;
index 3631d639d86a596cf023f3f7f9474508c10ebc93..33b93ffb87cb1e348a16115913b6d5d1ef0623a5 100644 (file)
@@ -561,11 +561,12 @@ static int ixgbe_dcbnl_ieee_getets(struct net_device *dev,
        struct ixgbe_adapter *adapter = netdev_priv(dev);
        struct ieee_ets *my_ets = adapter->ixgbe_ieee_ets;
 
+       ets->ets_cap = adapter->dcb_cfg.num_tcs.pg_tcs;
+
        /* No IEEE PFC settings available */
        if (!my_ets)
-               return -EINVAL;
+               return 0;
 
-       ets->ets_cap = adapter->dcb_cfg.num_tcs.pg_tcs;
        ets->cbs = my_ets->cbs;
        memcpy(ets->tc_tx_bw, my_ets->tc_tx_bw, sizeof(ets->tc_tx_bw));
        memcpy(ets->tc_rx_bw, my_ets->tc_rx_bw, sizeof(ets->tc_rx_bw));
@@ -621,11 +622,12 @@ static int ixgbe_dcbnl_ieee_getpfc(struct net_device *dev,
        struct ieee_pfc *my_pfc = adapter->ixgbe_ieee_pfc;
        int i;
 
+       pfc->pfc_cap = adapter->dcb_cfg.num_tcs.pfc_tcs;
+
        /* No IEEE PFC settings available */
        if (!my_pfc)
-               return -EINVAL;
+               return 0;
 
-       pfc->pfc_cap = adapter->dcb_cfg.num_tcs.pfc_tcs;
        pfc->pfc_en = my_pfc->pfc_en;
        pfc->mbc = my_pfc->mbc;
        pfc->delay = my_pfc->delay;
index 09b8e88b299940071d49ae3e349133c0178adb62..8ef92d1a6aa126037c3ce9d1049a7fde3f766790 100644 (file)
@@ -3345,34 +3345,25 @@ static void ixgbe_configure_dcb(struct ixgbe_adapter *adapter)
 
        hw->mac.ops.set_vfta(&adapter->hw, 0, 0, true);
 
-       /* reconfigure the hardware */
-       if (adapter->dcbx_cap & DCB_CAP_DCBX_VER_CEE) {
 #ifdef IXGBE_FCOE
-               if (adapter->netdev->features & NETIF_F_FCOE_MTU)
-                       max_frame = max(max_frame, IXGBE_FCOE_JUMBO_FRAME_SIZE);
+       if (adapter->netdev->features & NETIF_F_FCOE_MTU)
+               max_frame = max(max_frame, IXGBE_FCOE_JUMBO_FRAME_SIZE);
 #endif
+
+       /* reconfigure the hardware */
+       if (adapter->dcbx_cap & DCB_CAP_DCBX_VER_CEE) {
                ixgbe_dcb_calculate_tc_credits(hw, &adapter->dcb_cfg, max_frame,
                                                DCB_TX_CONFIG);
                ixgbe_dcb_calculate_tc_credits(hw, &adapter->dcb_cfg, max_frame,
                                                DCB_RX_CONFIG);
                ixgbe_dcb_hw_config(hw, &adapter->dcb_cfg);
-       } else {
-               struct net_device *dev = adapter->netdev;
-
-               if (adapter->ixgbe_ieee_ets) {
-                       struct ieee_ets *ets = adapter->ixgbe_ieee_ets;
-                       int max_frame = dev->mtu + ETH_HLEN + ETH_FCS_LEN;
-
-                       ixgbe_dcb_hw_ets(&adapter->hw, ets, max_frame);
-               }
-
-               if (adapter->ixgbe_ieee_pfc) {
-                       struct ieee_pfc *pfc = adapter->ixgbe_ieee_pfc;
-                       u8 *prio_tc = adapter->ixgbe_ieee_ets->prio_tc;
-
-                       ixgbe_dcb_hw_pfc_config(&adapter->hw, pfc->pfc_en,
-                                               prio_tc);
-               }
+       } else if (adapter->ixgbe_ieee_ets && adapter->ixgbe_ieee_pfc) {
+               ixgbe_dcb_hw_ets(&adapter->hw,
+                                adapter->ixgbe_ieee_ets,
+                                max_frame);
+               ixgbe_dcb_hw_pfc_config(&adapter->hw,
+                                       adapter->ixgbe_ieee_pfc->pfc_en,
+                                       adapter->ixgbe_ieee_ets->prio_tc);
        }
 
        /* Enable RSS Hash per TC */
@@ -6125,7 +6116,6 @@ static void ixgbe_sfp_link_config_subtask(struct ixgbe_adapter *adapter)
        autoneg = hw->phy.autoneg_advertised;
        if ((!autoneg) && (hw->mac.ops.get_link_capabilities))
                hw->mac.ops.get_link_capabilities(hw, &autoneg, &negotiation);
-       hw->mac.autotry_restart = false;
        if (hw->mac.ops.setup_link)
                hw->mac.ops.setup_link(hw, autoneg, negotiation, true);
 
@@ -7589,13 +7579,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
                goto err_eeprom;
        }
 
-       /* power down the optics for multispeed fiber and 82599 SFP+ fiber */
-       if (hw->mac.ops.disable_tx_laser &&
-           ((hw->phy.multispeed_fiber) ||
-            ((hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) &&
-             (hw->mac.type == ixgbe_mac_82599EB))))
-               hw->mac.ops.disable_tx_laser(hw);
-
        setup_timer(&adapter->service_timer, &ixgbe_service_timer,
                    (unsigned long) adapter);
 
@@ -7693,6 +7676,13 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
        if (err)
                goto err_register;
 
+       /* power down the optics for multispeed fiber and 82599 SFP+ fiber */
+       if (hw->mac.ops.disable_tx_laser &&
+           ((hw->phy.multispeed_fiber) ||
+            ((hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) &&
+             (hw->mac.type == ixgbe_mac_82599EB))))
+               hw->mac.ops.disable_tx_laser(hw);
+
        /* carrier off reporting is important to ethtool even BEFORE open */
        netif_carrier_off(netdev);
 
index 5a7e1eb3359996b5930b0e4cd5808e911b34ed21..4a5d8897faab47ec93358c7a7d16c4b44d983b83 100644 (file)
@@ -42,10 +42,12 @@ int ixgbe_ndo_set_vf_spoofchk(struct net_device *netdev, int vf, bool setting);
 int ixgbe_ndo_get_vf_config(struct net_device *netdev,
                            int vf, struct ifla_vf_info *ivi);
 void ixgbe_check_vf_rate_limit(struct ixgbe_adapter *adapter);
+#ifdef CONFIG_PCI_IOV
 void ixgbe_disable_sriov(struct ixgbe_adapter *adapter);
 void ixgbe_enable_sriov(struct ixgbe_adapter *adapter,
                        const struct ixgbe_info *ii);
 int ixgbe_check_vf_assignment(struct ixgbe_adapter *adapter);
+#endif
 
 
 #endif /* _IXGBE_SRIOV_H_ */
index 5e92cc2079bd2f64de50a3f361042f4f521db6f3..4c8e19951d57e58d53dedd3249c72d976413d020 100644 (file)
@@ -54,7 +54,7 @@ char ixgbevf_driver_name[] = "ixgbevf";
 static const char ixgbevf_driver_string[] =
        "Intel(R) 10 Gigabit PCI Express Virtual Function Network Driver";
 
-#define DRV_VERSION "2.1.0-k"
+#define DRV_VERSION "2.2.0-k"
 const char ixgbevf_driver_version[] = DRV_VERSION;
 static char ixgbevf_copyright[] =
        "Copyright (c) 2009 - 2010 Intel Corporation.";
index 84083ec6e612774c1c026c48295e216db85a3bf6..0578859a3c73e6ab4952a4b925c64ffee07fab7b 100644 (file)
@@ -115,16 +115,4 @@ config R8169
          To compile this driver as a module, choose M here: the module
          will be called r8169.  This is recommended.
 
-config SC92031
-       tristate "Silan SC92031 PCI Fast Ethernet Adapter driver (EXPERIMENTAL)"
-       depends on PCI && EXPERIMENTAL
-       select CRC32
-       ---help---
-         This is a driver for the Fast Ethernet PCI network cards based on
-         the Silan SC92031 chip (sometimes also called Rsltek 8139D). If you
-         have one of these, say Y here.
-
-         To compile this driver as a module, choose M here: the module
-         will be called sc92031.  This is recommended.
-
 endif # NET_VENDOR_REALTEK
index e48cfb6ac42defd17a2a9a69cc9b52094bc1cc07..71b1da30ecb5b380cab2cfb0baf6b372b4a75fc0 100644 (file)
@@ -6,4 +6,3 @@ obj-$(CONFIG_8139CP) += 8139cp.o
 obj-$(CONFIG_8139TOO) += 8139too.o
 obj-$(CONFIG_ATP) += atp.o
 obj-$(CONFIG_R8169) += r8169.o
-obj-$(CONFIG_SC92031) += sc92031.o
diff --git a/drivers/net/ethernet/silan/Kconfig b/drivers/net/ethernet/silan/Kconfig
new file mode 100644 (file)
index 0000000..ae1ce17
--- /dev/null
@@ -0,0 +1,33 @@
+#
+# Silan device configuration
+#
+
+config NET_VENDOR_SILAN
+       bool "Silan devices"
+       default y
+       depends on PCI && EXPERIMENTAL
+       ---help---
+         If you have a network (Ethernet) card belonging to this class, say Y
+         and read the Ethernet-HOWTO, available from
+         <http://www.tldp.org/docs.html#howto>.
+
+         Note that the answer to this question doesn't directly affect the
+         kernel: saying N will just cause the configurator to skip all
+         the questions about Silan devices. If you say Y, you will be asked for
+         your specific card in the following questions.
+
+if NET_VENDOR_SILAN
+
+config SC92031
+       tristate "Silan SC92031 PCI Fast Ethernet Adapter driver (EXPERIMENTAL)"
+       depends on PCI && EXPERIMENTAL
+       select CRC32
+       ---help---
+         This is a driver for the Fast Ethernet PCI network cards based on
+         the Silan SC92031 chip (sometimes also called Rsltek 8139D). If you
+         have one of these, say Y here.
+
+         To compile this driver as a module, choose M here: the module
+         will be called sc92031.  This is recommended.
+
+endif # NET_VENDOR_SILAN
diff --git a/drivers/net/ethernet/silan/Makefile b/drivers/net/ethernet/silan/Makefile
new file mode 100644 (file)
index 0000000..4ad3523
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Makefile for the Silan network device drivers.
+#
+
+obj-$(CONFIG_SC92031) += sc92031.o
index 4d1658e78dee50e8493994d4d5d421fe176362a9..caf3659e173cda3a04735cb1ecad7cfd94de27c7 100644 (file)
@@ -716,8 +716,8 @@ static int temac_start_xmit(struct sk_buff *skb, struct net_device *ndev)
                cur_p = &lp->tx_bd_v[lp->tx_bd_tail];
                cur_p->phys = dma_map_single(ndev->dev.parent,
                                             skb_frag_address(frag),
-                                            frag_size(frag), DMA_TO_DEVICE);
-               cur_p->len = frag_size(frag);
+                                            skb_frag_size(frag), DMA_TO_DEVICE);
+               cur_p->len = skb_frag_size(frag);
                cur_p->app0 = 0;
                frag++;
        }
index f9930c87fff3a7beb35f558a788909ee1f27c5df..c3b45480ecf75e79c41b34e078732221204b0eec 100644 (file)
@@ -12,3 +12,4 @@ header-y += ipt_ah.h
 header-y += ipt_ecn.h
 header-y += ipt_realm.h
 header-y += ipt_ttl.h
+header-y += nf_nat.h
diff --git a/include/linux/netfilter_ipv4/nf_nat.h b/include/linux/netfilter_ipv4/nf_nat.h
new file mode 100644 (file)
index 0000000..7a861d0
--- /dev/null
@@ -0,0 +1,58 @@
+#ifndef _LINUX_NF_NAT_H
+#define _LINUX_NF_NAT_H
+
+#include <linux/types.h>
+
+#define IP_NAT_RANGE_MAP_IPS 1
+#define IP_NAT_RANGE_PROTO_SPECIFIED 2
+#define IP_NAT_RANGE_PROTO_RANDOM 4
+#define IP_NAT_RANGE_PERSISTENT 8
+
+/* The protocol-specific manipulable parts of the tuple. */
+union nf_conntrack_man_proto {
+       /* Add other protocols here. */
+       __be16 all;
+
+       struct {
+               __be16 port;
+       } tcp;
+       struct {
+               __be16 port;
+       } udp;
+       struct {
+               __be16 id;
+       } icmp;
+       struct {
+               __be16 port;
+       } dccp;
+       struct {
+               __be16 port;
+       } sctp;
+       struct {
+               __be16 key;     /* GRE key is 32bit, PPtP only uses 16bit */
+       } gre;
+};
+
+/* Single range specification. */
+struct nf_nat_range {
+       /* Set to OR of flags above. */
+       unsigned int flags;
+
+       /* Inclusive: network order. */
+       __be32 min_ip, max_ip;
+
+       /* Inclusive: network order */
+       union nf_conntrack_man_proto min, max;
+};
+
+/* For backwards compat: don't use in modern code. */
+struct nf_nat_multi_range_compat {
+       unsigned int rangesize; /* Must be 1. */
+
+       /* hangs off end. */
+       struct nf_nat_range range[1];
+};
+
+#define nf_nat_multi_range nf_nat_multi_range_compat
+
+#endif
index 6a6b352326d7002197158f7ade024fffec3b07ae..fe864885c1edd5edbebc0504544e4950ebf2962f 100644 (file)
@@ -1806,12 +1806,12 @@ static inline void skb_frag_set_page(struct sk_buff *skb, int f,
 
 /**
  * skb_frag_dma_map - maps a paged fragment via the DMA API
- * @device: the device to map the fragment to
+ * @dev: the device to map the fragment to
  * @frag: the paged fragment to map
  * @offset: the offset within the fragment (starting at the
  *          fragment's own offset)
  * @size: the number of bytes to map
- * @direction: the direction of the mapping (%PCI_DMA_*)
+ * @dir: the direction of the mapping (%PCI_DMA_*)
  *
  * Maps the page associated with @frag to @device.
  */
index 8fa4430f99c14e025ad6a189a1116f72ae831317..05b08c926aded3927f5532a63f6d5a78ee058f2c 100644 (file)
@@ -425,9 +425,9 @@ struct ip_vs_protocol {
 
        const char *(*state_name)(int state);
 
-       int (*state_transition)(struct ip_vs_conn *cp, int direction,
-                               const struct sk_buff *skb,
-                               struct ip_vs_proto_data *pd);
+       void (*state_transition)(struct ip_vs_conn *cp, int direction,
+                                const struct sk_buff *skb,
+                                struct ip_vs_proto_data *pd);
 
        int (*register_app)(struct net *net, struct ip_vs_app *inc);
 
@@ -1378,7 +1378,7 @@ static inline int ip_vs_conntrack_enabled(struct netns_ipvs *ipvs)
 
 extern void ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp,
                                   int outin);
-extern int ip_vs_confirm_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp);
+extern int ip_vs_confirm_conntrack(struct sk_buff *skb);
 extern void ip_vs_nfct_expect_related(struct sk_buff *skb, struct nf_conn *ct,
                                      struct ip_vs_conn *cp, u_int8_t proto,
                                      const __be16 port, int from_rs);
@@ -1396,8 +1396,7 @@ static inline void ip_vs_update_conntrack(struct sk_buff *skb,
 {
 }
 
-static inline int ip_vs_confirm_conntrack(struct sk_buff *skb,
-                                         struct ip_vs_conn *cp)
+static inline int ip_vs_confirm_conntrack(struct sk_buff *skb)
 {
        return NF_ACCEPT;
 }
index 7ca6bdd5bae64182056b20b0d782b9bb501dc63f..2f8fb77bfdd1f7d9583e42ddbee7cf0240228e17 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <linux/netfilter/x_tables.h>
 #include <linux/netfilter/nf_conntrack_tuple_common.h>
+#include <linux/netfilter_ipv4/nf_nat.h>
 #include <linux/list_nulls.h>
 
 /* A `tuple' is a structure containing the information to uniquely
 
 #define NF_CT_TUPLE_L3SIZE     ARRAY_SIZE(((union nf_inet_addr *)NULL)->all)
 
-/* The protocol-specific manipulable parts of the tuple: always in
-   network order! */
-union nf_conntrack_man_proto {
-       /* Add other protocols here. */
-       __be16 all;
-
-       struct {
-               __be16 port;
-       } tcp;
-       struct {
-               __be16 port;
-       } udp;
-       struct {
-               __be16 id;
-       } icmp;
-       struct {
-               __be16 port;
-       } dccp;
-       struct {
-               __be16 port;
-       } sctp;
-       struct {
-               __be16 key;     /* GRE key is 32bit, PPtP only uses 16bit */
-       } gre;
-};
-
 /* The manipulable part of the tuple. */
 struct nf_conntrack_man {
        union nf_inet_addr u3;
index 0346b0070864c34c3bf4eaa89ca16a708ad72b88..b8872df7285f064e95679c64da141356f84de590 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _NF_NAT_H
 #define _NF_NAT_H
 #include <linux/netfilter_ipv4.h>
+#include <linux/netfilter_ipv4/nf_nat.h>
 #include <net/netfilter/nf_conntrack_tuple.h>
 
 #define NF_NAT_MAPPING_TYPE_MAX_NAMELEN 16
@@ -14,11 +15,6 @@ enum nf_nat_manip_type {
 #define HOOK2MANIP(hooknum) ((hooknum) != NF_INET_POST_ROUTING && \
                             (hooknum) != NF_INET_LOCAL_IN)
 
-#define IP_NAT_RANGE_MAP_IPS 1
-#define IP_NAT_RANGE_PROTO_SPECIFIED 2
-#define IP_NAT_RANGE_PROTO_RANDOM 4
-#define IP_NAT_RANGE_PERSISTENT 8
-
 /* NAT sequence number modifications */
 struct nf_nat_seq {
        /* position of the last TCP sequence number modification (if any) */
@@ -28,26 +24,6 @@ struct nf_nat_seq {
        int16_t offset_before, offset_after;
 };
 
-/* Single range specification. */
-struct nf_nat_range {
-       /* Set to OR of flags above. */
-       unsigned int flags;
-
-       /* Inclusive: network order. */
-       __be32 min_ip, max_ip;
-
-       /* Inclusive: network order */
-       union nf_conntrack_man_proto min, max;
-};
-
-/* For backwards compat: don't use in modern code. */
-struct nf_nat_multi_range_compat {
-       unsigned int rangesize; /* Must be 1. */
-
-       /* hangs off end. */
-       struct nf_nat_range range[1];
-};
-
 #include <linux/list.h>
 #include <linux/netfilter/nf_conntrack_pptp.h>
 #include <net/netfilter/nf_conntrack_extend.h>
index e147f42d643d16caad50e971e57e7b879a0bffbb..bb18c4d69aba1da89488af60999f03341648ee61 100644 (file)
@@ -1403,11 +1403,13 @@ enum tcp_seq_states {
        TCP_SEQ_STATE_TIME_WAIT,
 };
 
+int tcp_seq_open(struct inode *inode, struct file *file);
+
 struct tcp_seq_afinfo {
-       char                    *name;
-       sa_family_t             family;
-       struct file_operations  seq_fops;
-       struct seq_operations   seq_ops;
+       char                            *name;
+       sa_family_t                     family;
+       const struct file_operations    *seq_fops;
+       struct seq_operations           seq_ops;
 };
 
 struct tcp_iter_state {
index 67ea6fcb3ec063165bf0e4fe69a33834b18a8e9f..3b285f402f480e76aa9b69136447df9f6d66bb65 100644 (file)
@@ -230,12 +230,14 @@ extern struct sock *udp6_lib_lookup(struct net *net, const struct in6_addr *sadd
 #endif
 
 /* /proc */
+int udp_seq_open(struct inode *inode, struct file *file);
+
 struct udp_seq_afinfo {
-       char                    *name;
-       sa_family_t             family;
-       struct udp_table        *udp_table;
-       struct file_operations  seq_fops;
-       struct seq_operations   seq_ops;
+       char                            *name;
+       sa_family_t                     family;
+       struct udp_table                *udp_table;
+       const struct file_operations    *seq_fops;
+       struct seq_operations           seq_ops;
 };
 
 struct udp_iter_state {
index c8cf9391417ec9442b47f31e3c3cde891cfeaf1d..bc252862458385ef5d37367a643fcdf9ef5ad9af 100644 (file)
@@ -470,10 +470,12 @@ static void vlan_dev_change_rx_flags(struct net_device *dev, int change)
 {
        struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
 
-       if (change & IFF_ALLMULTI)
-               dev_set_allmulti(real_dev, dev->flags & IFF_ALLMULTI ? 1 : -1);
-       if (change & IFF_PROMISC)
-               dev_set_promiscuity(real_dev, dev->flags & IFF_PROMISC ? 1 : -1);
+       if (dev->flags & IFF_UP) {
+               if (change & IFF_ALLMULTI)
+                       dev_set_allmulti(real_dev, dev->flags & IFF_ALLMULTI ? 1 : -1);
+               if (change & IFF_PROMISC)
+                       dev_set_promiscuity(real_dev, dev->flags & IFF_PROMISC ? 1 : -1);
+       }
 }
 
 static void vlan_dev_set_rx_mode(struct net_device *vlan_dev)
index bf2a333ca7c7651812f5318d644d19d185efff61..5449294bdd5e7babc41b20d5bfcb523d97b74e1d 100644 (file)
@@ -102,16 +102,15 @@ static struct sk_buff *ulog_alloc_skb(unsigned int size)
        unsigned int n;
 
        n = max(size, nlbufsiz);
-       skb = alloc_skb(n, GFP_ATOMIC);
+       skb = alloc_skb(n, GFP_ATOMIC | __GFP_NOWARN);
        if (!skb) {
-               pr_debug("cannot alloc whole buffer of size %ub!\n", n);
                if (n > size) {
                        /* try to allocate only as much as we need for
                         * current packet */
                        skb = alloc_skb(size, GFP_ATOMIC);
                        if (!skb)
-                               pr_debug("cannot even allocate "
-                                        "buffer of size %ub\n", size);
+                               pr_debug("cannot even allocate buffer of size %ub\n",
+                                        size);
                }
        }
 
index 909ecb3c2a3344077332bfc9fb66fd7f0bfa8031..039d51e6c284e7ab655319d399b9d40060357dcf 100644 (file)
@@ -872,12 +872,8 @@ static void neigh_timer_handler(unsigned long arg)
        now = jiffies;
        next = now + HZ;
 
-       if (!(state & NUD_IN_TIMER)) {
-#ifndef CONFIG_SMP
-               printk(KERN_WARNING "neigh: timer & !nud_in_timer\n");
-#endif
+       if (!(state & NUD_IN_TIMER))
                goto out;
-       }
 
        if (state & NUD_REACHABLE) {
                if (time_before_eq(now,
index ca4db40e75b84becaab9c9acef48e5677d202a6c..18a3cebb753d39d57b2962f991f32fb048d76c29 100644 (file)
@@ -189,6 +189,7 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask,
         * aligned memory blocks, unless SLUB/SLAB debug is enabled.
         * Both skb->head and skb_shared_info are cache line aligned.
         */
+       size = SKB_DATA_ALIGN(size);
        size += SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
        data = kmalloc_node_track_caller(size, gfp_mask, node);
        if (!data)
index 332639b56f4d76e93888006aedf6832df4ef47c3..90a919afbed79ee5998f510badfaaa199a441086 100644 (file)
@@ -433,6 +433,7 @@ exit:
        NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS);
        return NULL;
 put_and_exit:
+       bh_unlock_sock(newsk);
        sock_put(newsk);
        goto exit;
 }
index db8d22db425f6917b23d8d31661905ab58d3ef2d..a639967eb727284a668354374d9bc4103a7ca1d9 100644 (file)
@@ -395,7 +395,6 @@ static int clusterip_tg_check(const struct xt_tgchk_param *par)
                        config = clusterip_config_init(cipinfo,
                                                        e->ip.dst.s_addr, dev);
                        if (!config) {
-                               pr_info("cannot allocate config\n");
                                dev_put(dev);
                                return -ENOMEM;
                        }
index 446e0f467a17eed968b7a9cba12b001b05de1154..b5508151e5476a23d3285b2bf919dba3132bc322 100644 (file)
@@ -135,10 +135,8 @@ static struct sk_buff *ulog_alloc_skb(unsigned int size)
         * due to slab allocator restrictions */
 
        n = max(size, nlbufsiz);
-       skb = alloc_skb(n, GFP_ATOMIC);
+       skb = alloc_skb(n, GFP_ATOMIC | __GFP_NOWARN);
        if (!skb) {
-               pr_debug("cannot alloc whole buffer %ub!\n", n);
-
                if (n > size) {
                        /* try to allocate only as much as we need for
                         * current packet */
index d1cb412c18e02665db35e95021f29ecae38bf35c..2133c30a4a5f4799be74c729dac78a9b579c6101 100644 (file)
@@ -400,11 +400,8 @@ static unsigned char asn1_octets_decode(struct asn1_ctx *ctx,
        *len = 0;
 
        *octets = kmalloc(eoc - ctx->pointer, GFP_ATOMIC);
-       if (*octets == NULL) {
-               if (net_ratelimit())
-                       pr_notice("OOM in bsalg (%d)\n", __LINE__);
+       if (*octets == NULL)
                return 0;
-       }
 
        ptr = *octets;
        while (ctx->pointer < eoc) {
@@ -451,11 +448,8 @@ static unsigned char asn1_oid_decode(struct asn1_ctx *ctx,
                return 0;
 
        *oid = kmalloc(size * sizeof(unsigned long), GFP_ATOMIC);
-       if (*oid == NULL) {
-               if (net_ratelimit())
-                       pr_notice("OOM in bsalg (%d)\n", __LINE__);
+       if (*oid == NULL)
                return 0;
-       }
 
        optr = *oid;
 
@@ -728,8 +722,6 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
                *obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC);
                if (*obj == NULL) {
                        kfree(id);
-                       if (net_ratelimit())
-                               pr_notice("OOM in bsalg (%d)\n", __LINE__);
                        return 0;
                }
                (*obj)->syntax.l[0] = l;
@@ -744,8 +736,6 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
                if (*obj == NULL) {
                        kfree(p);
                        kfree(id);
-                       if (net_ratelimit())
-                               pr_notice("OOM in bsalg (%d)\n", __LINE__);
                        return 0;
                }
                memcpy((*obj)->syntax.c, p, len);
@@ -759,8 +749,6 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
                *obj = kmalloc(sizeof(struct snmp_object), GFP_ATOMIC);
                if (*obj == NULL) {
                        kfree(id);
-                       if (net_ratelimit())
-                               pr_notice("OOM in bsalg (%d)\n", __LINE__);
                        return 0;
                }
                if (!asn1_null_decode(ctx, end)) {
@@ -780,8 +768,6 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
                if (*obj == NULL) {
                        kfree(lp);
                        kfree(id);
-                       if (net_ratelimit())
-                               pr_notice("OOM in bsalg (%d)\n", __LINE__);
                        return 0;
                }
                memcpy((*obj)->syntax.ul, lp, len);
@@ -801,8 +787,6 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
                if (*obj == NULL) {
                        kfree(p);
                        kfree(id);
-                       if (net_ratelimit())
-                               pr_notice("OOM in bsalg (%d)\n", __LINE__);
                        return 0;
                }
                memcpy((*obj)->syntax.uc, p, len);
@@ -819,8 +803,6 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
                *obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC);
                if (*obj == NULL) {
                        kfree(id);
-                       if (net_ratelimit())
-                               pr_notice("OOM in bsalg (%d)\n", __LINE__);
                        return 0;
                }
                (*obj)->syntax.ul[0] = ul;
index 0ea10eefa60f005911b0849dd14218a1eb9ccf1d..a7443159c400450e73ff9b83230fe40a48d0da39 100644 (file)
@@ -1510,6 +1510,7 @@ exit:
        NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS);
        return NULL;
 put_and_exit:
+       bh_unlock_sock(newsk);
        sock_put(newsk);
        goto exit;
 }
@@ -2339,7 +2340,7 @@ static void tcp_seq_stop(struct seq_file *seq, void *v)
        }
 }
 
-static int tcp_seq_open(struct inode *inode, struct file *file)
+int tcp_seq_open(struct inode *inode, struct file *file)
 {
        struct tcp_seq_afinfo *afinfo = PDE(inode)->data;
        struct tcp_iter_state *s;
@@ -2355,23 +2356,19 @@ static int tcp_seq_open(struct inode *inode, struct file *file)
        s->last_pos             = 0;
        return 0;
 }
+EXPORT_SYMBOL(tcp_seq_open);
 
 int tcp_proc_register(struct net *net, struct tcp_seq_afinfo *afinfo)
 {
        int rc = 0;
        struct proc_dir_entry *p;
 
-       afinfo->seq_fops.open           = tcp_seq_open;
-       afinfo->seq_fops.read           = seq_read;
-       afinfo->seq_fops.llseek         = seq_lseek;
-       afinfo->seq_fops.release        = seq_release_net;
-
        afinfo->seq_ops.start           = tcp_seq_start;
        afinfo->seq_ops.next            = tcp_seq_next;
        afinfo->seq_ops.stop            = tcp_seq_stop;
 
        p = proc_create_data(afinfo->name, S_IRUGO, net->proc_net,
-                            &afinfo->seq_fops, afinfo);
+                            afinfo->seq_fops, afinfo);
        if (!p)
                rc = -ENOMEM;
        return rc;
@@ -2520,12 +2517,18 @@ out:
        return 0;
 }
 
+static const struct file_operations tcp_afinfo_seq_fops = {
+       .owner   = THIS_MODULE,
+       .open    = tcp_seq_open,
+       .read    = seq_read,
+       .llseek  = seq_lseek,
+       .release = seq_release_net
+};
+
 static struct tcp_seq_afinfo tcp4_seq_afinfo = {
        .name           = "tcp",
        .family         = AF_INET,
-       .seq_fops       = {
-               .owner          = THIS_MODULE,
-       },
+       .seq_fops       = &tcp_afinfo_seq_fops,
        .seq_ops        = {
                .show           = tcp4_seq_show,
        },
index ebaa96bd346475dd550baadc9e32dd7a4e5d8ef6..ab0966df1e2a8aec9e4ecb40e77332cbebbde466 100644 (file)
@@ -1397,6 +1397,8 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
        nf_reset(skb);
 
        if (up->encap_type) {
+               int (*encap_rcv)(struct sock *sk, struct sk_buff *skb);
+
                /*
                 * This is an encapsulation socket so pass the skb to
                 * the socket's udp_encap_rcv() hook. Otherwise, just
@@ -1409,11 +1411,11 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
                 */
 
                /* if we're overly short, let UDP handle it */
-               if (skb->len > sizeof(struct udphdr) &&
-                   up->encap_rcv != NULL) {
+               encap_rcv = ACCESS_ONCE(up->encap_rcv);
+               if (skb->len > sizeof(struct udphdr) && encap_rcv != NULL) {
                        int ret;
 
-                       ret = (*up->encap_rcv)(sk, skb);
+                       ret = encap_rcv(sk, skb);
                        if (ret <= 0) {
                                UDP_INC_STATS_BH(sock_net(sk),
                                                 UDP_MIB_INDATAGRAMS,
@@ -2037,7 +2039,7 @@ static void udp_seq_stop(struct seq_file *seq, void *v)
                spin_unlock_bh(&state->udp_table->hash[state->bucket].lock);
 }
 
-static int udp_seq_open(struct inode *inode, struct file *file)
+int udp_seq_open(struct inode *inode, struct file *file)
 {
        struct udp_seq_afinfo *afinfo = PDE(inode)->data;
        struct udp_iter_state *s;
@@ -2053,6 +2055,7 @@ static int udp_seq_open(struct inode *inode, struct file *file)
        s->udp_table            = afinfo->udp_table;
        return err;
 }
+EXPORT_SYMBOL(udp_seq_open);
 
 /* ------------------------------------------------------------------------ */
 int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo)
@@ -2060,17 +2063,12 @@ int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo)
        struct proc_dir_entry *p;
        int rc = 0;
 
-       afinfo->seq_fops.open           = udp_seq_open;
-       afinfo->seq_fops.read           = seq_read;
-       afinfo->seq_fops.llseek         = seq_lseek;
-       afinfo->seq_fops.release        = seq_release_net;
-
        afinfo->seq_ops.start           = udp_seq_start;
        afinfo->seq_ops.next            = udp_seq_next;
        afinfo->seq_ops.stop            = udp_seq_stop;
 
        p = proc_create_data(afinfo->name, S_IRUGO, net->proc_net,
-                            &afinfo->seq_fops, afinfo);
+                            afinfo->seq_fops, afinfo);
        if (!p)
                rc = -ENOMEM;
        return rc;
@@ -2120,14 +2118,20 @@ int udp4_seq_show(struct seq_file *seq, void *v)
        return 0;
 }
 
+static const struct file_operations udp_afinfo_seq_fops = {
+       .owner    = THIS_MODULE,
+       .open     = udp_seq_open,
+       .read     = seq_read,
+       .llseek   = seq_lseek,
+       .release  = seq_release_net
+};
+
 /* ------------------------------------------------------------------------ */
 static struct udp_seq_afinfo udp4_seq_afinfo = {
        .name           = "udp",
        .family         = AF_INET,
        .udp_table      = &udp_table,
-       .seq_fops       = {
-               .owner  =       THIS_MODULE,
-       },
+       .seq_fops       = &udp_afinfo_seq_fops,
        .seq_ops        = {
                .show           = udp4_seq_show,
        },
index aee9963f7f5a497efc06429d3ab730e9f3efc999..08383eb542087a9de6699bc5179291b446d37b79 100644 (file)
@@ -71,13 +71,20 @@ static struct inet_protosw udplite4_protosw = {
 };
 
 #ifdef CONFIG_PROC_FS
+
+static const struct file_operations udplite_afinfo_seq_fops = {
+       .owner    = THIS_MODULE,
+       .open     = udp_seq_open,
+       .read     = seq_read,
+       .llseek   = seq_lseek,
+       .release  = seq_release_net
+};
+
 static struct udp_seq_afinfo udplite4_seq_afinfo = {
        .name           = "udplite",
        .family         = AF_INET,
        .udp_table      = &udplite_table,
-       .seq_fops       = {
-               .owner  =       THIS_MODULE,
-       },
+       .seq_fops       = &udplite_afinfo_seq_fops,
        .seq_ops        = {
                .show           = udp4_seq_show,
        },
index 30fcee465448618b326f8cb9172deeadfc055e62..8992cf6651d47da90de5d3c76832672de50f547c 100644 (file)
@@ -100,9 +100,16 @@ static int nf_ip6_route(struct net *net, struct dst_entry **dst,
                .pinet6 = (struct ipv6_pinfo *) &fake_pinfo,
        };
        const void *sk = strict ? &fake_sk : NULL;
-
-       *dst = ip6_route_output(net, sk, &fl->u.ip6);
-       return (*dst)->error;
+       struct dst_entry *result;
+       int err;
+
+       result = ip6_route_output(net, sk, &fl->u.ip6);
+       err = result->error;
+       if (err)
+               dst_release(result);
+       else
+               *dst = result;
+       return err;
 }
 
 __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook,
index e8762c73b170f3c73f675e7b49d6a13c5d3a6174..38f00b0298d3f53327f2e35447e8ab97a1568e83 100644 (file)
@@ -182,7 +182,6 @@ fq_find(__be32 id, u32 user, struct in6_addr *src, struct in6_addr *dst)
        return container_of(q, struct nf_ct_frag6_queue, q);
 
 oom:
-       pr_debug("Can't alloc new queue\n");
        return NULL;
 }
 
@@ -370,10 +369,10 @@ nf_ct_frag6_reasm(struct nf_ct_frag6_queue *fq, struct net_device *dev)
                struct sk_buff *clone;
                int i, plen = 0;
 
-               if ((clone = alloc_skb(0, GFP_ATOMIC)) == NULL) {
-                       pr_debug("Can't alloc skb\n");
+               clone = alloc_skb(0, GFP_ATOMIC);
+               if (clone == NULL)
                        goto out_oom;
-               }
+
                clone->next = head->next;
                head->next = clone;
                skb_shinfo(clone)->frag_list = skb_shinfo(head)->frag_list;
index 10b2b3165a1aff4ebc6cde947aae64a687b11a5b..36131d122a6f3f9007776ff343a9197bd0430b0a 100644 (file)
@@ -2161,12 +2161,18 @@ out:
        return 0;
 }
 
+static const struct file_operations tcp6_afinfo_seq_fops = {
+       .owner   = THIS_MODULE,
+       .open    = tcp_seq_open,
+       .read    = seq_read,
+       .llseek  = seq_lseek,
+       .release = seq_release_net
+};
+
 static struct tcp_seq_afinfo tcp6_seq_afinfo = {
        .name           = "tcp6",
        .family         = AF_INET6,
-       .seq_fops       = {
-               .owner          = THIS_MODULE,
-       },
+       .seq_fops       = &tcp6_afinfo_seq_fops,
        .seq_ops        = {
                .show           = tcp6_seq_show,
        },
index f4ca0a5b3457d857ce810b78f2d7f890d11470f8..846f4757eb8d46394a604595be0698d485ae1ab0 100644 (file)
@@ -1424,13 +1424,19 @@ int udp6_seq_show(struct seq_file *seq, void *v)
        return 0;
 }
 
+static const struct file_operations udp6_afinfo_seq_fops = {
+       .owner    = THIS_MODULE,
+       .open     = udp_seq_open,
+       .read     = seq_read,
+       .llseek   = seq_lseek,
+       .release  = seq_release_net
+};
+
 static struct udp_seq_afinfo udp6_seq_afinfo = {
        .name           = "udp6",
        .family         = AF_INET6,
        .udp_table      = &udp_table,
-       .seq_fops       = {
-               .owner  =       THIS_MODULE,
-       },
+       .seq_fops       = &udp6_afinfo_seq_fops,
        .seq_ops        = {
                .show           = udp6_seq_show,
        },
index 986c4de5292eedf715b25b8bae98ee640917d97e..8889aa22ed47197129c9ceb6585d9c2d4a06bb5b 100644 (file)
@@ -93,13 +93,20 @@ void udplitev6_exit(void)
 }
 
 #ifdef CONFIG_PROC_FS
+
+static const struct file_operations udplite6_afinfo_seq_fops = {
+       .owner    = THIS_MODULE,
+       .open     = udp_seq_open,
+       .read     = seq_read,
+       .llseek   = seq_lseek,
+       .release  = seq_release_net
+};
+
 static struct udp_seq_afinfo udplite6_seq_afinfo = {
        .name           = "udplite6",
        .family         = AF_INET6,
        .udp_table      = &udplite_table,
-       .seq_fops       = {
-               .owner  =       THIS_MODULE,
-       },
+       .seq_fops       = &udplite6_afinfo_seq_fops,
        .seq_ops        = {
                .show           = udp6_seq_show,
        },
index 34b2ddeacb673b3b8d4f3e92bf726fc567c49a81..bf8d50c67931e8e588520b7c49ad49fca51b40b3 100644 (file)
@@ -397,6 +397,7 @@ static void l2tp_recv_dequeue(struct l2tp_session *session)
         * expect to send up next, dequeue it and any other
         * in-sequence packets behind it.
         */
+start:
        spin_lock_bh(&session->reorder_q.lock);
        skb_queue_walk_safe(&session->reorder_q, skb, tmp) {
                if (time_after(jiffies, L2TP_SKB_CB(skb)->expires)) {
@@ -433,7 +434,7 @@ static void l2tp_recv_dequeue(struct l2tp_session *session)
                 */
                spin_unlock_bh(&session->reorder_q.lock);
                l2tp_recv_dequeue_skb(session, skb);
-               spin_lock_bh(&session->reorder_q.lock);
+               goto start;
        }
 
 out:
index 3346829ea07f09e28107c4b227d8b5d5763be30b..afca6c78948cfd77a1ad8b429f733482c4b11c1a 100644 (file)
@@ -180,17 +180,16 @@ next_hook:
                if (ret == 0)
                        ret = -EPERM;
        } else if ((verdict & NF_VERDICT_MASK) == NF_QUEUE) {
-               ret = nf_queue(skb, elem, pf, hook, indev, outdev, okfn,
-                              verdict >> NF_VERDICT_QBITS);
-               if (ret < 0) {
-                       if (ret == -ECANCELED)
+               int err = nf_queue(skb, elem, pf, hook, indev, outdev, okfn,
+                                               verdict >> NF_VERDICT_QBITS);
+               if (err < 0) {
+                       if (err == -ECANCELED)
                                goto next_hook;
-                       if (ret == -ESRCH &&
+                       if (err == -ESRCH &&
                           (verdict & NF_VERDICT_FLAG_QUEUE_BYPASS))
                                goto next_hook;
                        kfree_skb(skb);
                }
-               ret = 0;
        }
        rcu_read_unlock();
        return ret;
index d7e86ef9d23aa0a11fbd5d80a8f64e4a01c7a8ea..86137b558f455d9e1740a977aa09ea1e294bb241 100644 (file)
@@ -1699,10 +1699,8 @@ ip_set_init(void)
 
        ip_set_list = kzalloc(sizeof(struct ip_set *) * ip_set_max,
                              GFP_KERNEL);
-       if (!ip_set_list) {
-               pr_err("ip_set: Unable to create ip_set_list\n");
+       if (!ip_set_list)
                return -ENOMEM;
-       }
 
        ret = nfnetlink_subsys_register(&ip_set_netlink_subsys);
        if (ret != 0) {
index 4f77bb16d22abea2f60ea479318329bbab769a49..093cc327020fba6f09a6b4bfcabfc9386d892d02 100644 (file)
@@ -188,14 +188,13 @@ ip_vs_conn_stats(struct ip_vs_conn *cp, struct ip_vs_service *svc)
 }
 
 
-static inline int
+static inline void
 ip_vs_set_state(struct ip_vs_conn *cp, int direction,
                const struct sk_buff *skb,
                struct ip_vs_proto_data *pd)
 {
-       if (unlikely(!pd->pp->state_transition))
-               return 0;
-       return pd->pp->state_transition(cp, direction, skb, pd);
+       if (likely(pd->pp->state_transition))
+               pd->pp->state_transition(cp, direction, skb, pd);
 }
 
 static inline int
@@ -530,7 +529,7 @@ int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,
           a cache_bypass connection entry */
        ipvs = net_ipvs(net);
        if (ipvs->sysctl_cache_bypass && svc->fwmark && unicast) {
-               int ret, cs;
+               int ret;
                struct ip_vs_conn *cp;
                unsigned int flags = (svc->flags & IP_VS_SVC_F_ONEPACKET &&
                                      iph.protocol == IPPROTO_UDP)?
@@ -557,7 +556,7 @@ int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,
                ip_vs_in_stats(cp, skb);
 
                /* set state */
-               cs = ip_vs_set_state(cp, IP_VS_DIR_INPUT, skb, pd);
+               ip_vs_set_state(cp, IP_VS_DIR_INPUT, skb, pd);
 
                /* transmit the first SYN packet */
                ret = cp->packet_xmit(skb, cp, pd->pp);
@@ -1490,7 +1489,7 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af)
        struct ip_vs_protocol *pp;
        struct ip_vs_proto_data *pd;
        struct ip_vs_conn *cp;
-       int ret, restart, pkts;
+       int ret, pkts;
        struct netns_ipvs *ipvs;
 
        /* Already marked as IPVS request or reply? */
@@ -1591,7 +1590,7 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af)
        }
 
        ip_vs_in_stats(cp, skb);
-       restart = ip_vs_set_state(cp, IP_VS_DIR_INPUT, skb, pd);
+       ip_vs_set_state(cp, IP_VS_DIR_INPUT, skb, pd);
        if (cp->packet_xmit)
                ret = cp->packet_xmit(skb, cp, pp);
                /* do not touch skb anymore */
@@ -1878,10 +1877,9 @@ static int __net_init __ip_vs_init(struct net *net)
        struct netns_ipvs *ipvs;
 
        ipvs = net_generic(net, ip_vs_net_id);
-       if (ipvs == NULL) {
-               pr_err("%s(): no memory.\n", __func__);
+       if (ipvs == NULL)
                return -ENOMEM;
-       }
+
        /* Hold the beast until a service is registerd */
        ipvs->enable = 0;
        ipvs->net = net;
index e3be48bf4dcdb0779c0a20072e43839b8e01d9fc..008bf97cc91a58b14a0ef9fd6924eb6f71063f11 100644 (file)
@@ -856,15 +856,12 @@ ip_vs_new_dest(struct ip_vs_service *svc, struct ip_vs_dest_user_kern *udest,
        }
 
        dest = kzalloc(sizeof(struct ip_vs_dest), GFP_KERNEL);
-       if (dest == NULL) {
-               pr_err("%s(): no memory.\n", __func__);
+       if (dest == NULL)
                return -ENOMEM;
-       }
+
        dest->stats.cpustats = alloc_percpu(struct ip_vs_cpu_stats);
-       if (!dest->stats.cpustats) {
-               pr_err("%s() alloc_percpu failed\n", __func__);
+       if (!dest->stats.cpustats)
                goto err_alloc;
-       }
 
        dest->af = svc->af;
        dest->protocol = svc->protocol;
@@ -1168,10 +1165,8 @@ ip_vs_add_service(struct net *net, struct ip_vs_service_user_kern *u,
                goto out_err;
        }
        svc->stats.cpustats = alloc_percpu(struct ip_vs_cpu_stats);
-       if (!svc->stats.cpustats) {
-               pr_err("%s() alloc_percpu failed\n", __func__);
+       if (!svc->stats.cpustats)
                goto out_err;
-       }
 
        /* I'm the first user of the service */
        atomic_set(&svc->usecnt, 0);
@@ -3326,10 +3321,8 @@ static int ip_vs_genl_set_cmd(struct sk_buff *skb, struct genl_info *info)
        int ret = 0, cmd;
        int need_full_svc = 0, need_full_dest = 0;
        struct net *net;
-       struct netns_ipvs *ipvs;
 
        net = skb_sknet(skb);
-       ipvs = net_ipvs(net);
        cmd = info->genlhdr->cmd;
 
        mutex_lock(&__ip_vs_mutex);
@@ -3421,10 +3414,8 @@ static int ip_vs_genl_get_cmd(struct sk_buff *skb, struct genl_info *info)
        void *reply;
        int ret, cmd, reply_cmd;
        struct net *net;
-       struct netns_ipvs *ipvs;
 
        net = skb_sknet(skb);
-       ipvs = net_ipvs(net);
        cmd = info->genlhdr->cmd;
 
        if (cmd == IPVS_CMD_GET_SERVICE)
@@ -3720,10 +3711,9 @@ int __net_init ip_vs_control_net_init(struct net *net)
 
        /* procfs stats */
        ipvs->tot_stats.cpustats = alloc_percpu(struct ip_vs_cpu_stats);
-       if (!ipvs->tot_stats.cpustats) {
-               pr_err("%s(): alloc_percpu.\n", __func__);
+       if (!ipvs->tot_stats.cpustats)
                return -ENOMEM;
-       }
+
        spin_lock_init(&ipvs->tot_stats.lock);
 
        proc_net_fops_create(net, "ip_vs", 0, &ip_vs_info_fops);
index 95fd0d14200b338a41e0a580e890e85ea5ec5e1e..1c269e56200ad2e67b49cf97dd7a04d78aa019dc 100644 (file)
@@ -150,10 +150,9 @@ static int ip_vs_dh_init_svc(struct ip_vs_service *svc)
        /* allocate the DH table for this service */
        tbl = kmalloc(sizeof(struct ip_vs_dh_bucket)*IP_VS_DH_TAB_SIZE,
                      GFP_ATOMIC);
-       if (tbl == NULL) {
-               pr_err("%s(): no memory\n", __func__);
+       if (tbl == NULL)
                return -ENOMEM;
-       }
+
        svc->sched_data = tbl;
        IP_VS_DBG(6, "DH hash table (memory=%Zdbytes) allocated for "
                  "current service\n",
index 4490a32ad5b2fbfb3b47f3df0b21e54b30020597..538d74ee4f68bc18e7bb379d7432388aba305425 100644 (file)
@@ -52,8 +52,9 @@
  * List of ports (up to IP_VS_APP_MAX_PORTS) to be handled by helper
  * First port is set to the default port.
  */
+static unsigned int ports_count = 1;
 static unsigned short ports[IP_VS_APP_MAX_PORTS] = {21, 0};
-module_param_array(ports, ushort, NULL, 0);
+module_param_array(ports, ushort, &ports_count, 0444);
 MODULE_PARM_DESC(ports, "Ports to monitor for FTP control commands");
 
 
@@ -449,7 +450,7 @@ static int __net_init __ip_vs_ftp_init(struct net *net)
        if (ret)
                goto err_exit;
 
-       for (i=0; i<IP_VS_APP_MAX_PORTS; i++) {
+       for (i = 0; i < ports_count; i++) {
                if (!ports[i])
                        continue;
                ret = register_ip_vs_app_inc(net, app, app->protocol, ports[i]);
index 87e40ea77a95244e6ca94c21c9475ed296e21d1b..0f16283fd05854fccc68fad349c7f29509926252 100644 (file)
@@ -202,10 +202,8 @@ ip_vs_lblc_new(struct ip_vs_lblc_table *tbl, const union nf_inet_addr *daddr,
        en = ip_vs_lblc_get(dest->af, tbl, daddr);
        if (!en) {
                en = kmalloc(sizeof(*en), GFP_ATOMIC);
-               if (!en) {
-                       pr_err("%s(): no memory\n", __func__);
+               if (!en)
                        return NULL;
-               }
 
                en->af = dest->af;
                ip_vs_addr_copy(dest->af, &en->addr, daddr);
@@ -345,10 +343,9 @@ static int ip_vs_lblc_init_svc(struct ip_vs_service *svc)
         *    Allocate the ip_vs_lblc_table for this service
         */
        tbl = kmalloc(sizeof(*tbl), GFP_ATOMIC);
-       if (tbl == NULL) {
-               pr_err("%s(): no memory\n", __func__);
+       if (tbl == NULL)
                return -ENOMEM;
-       }
+
        svc->sched_data = tbl;
        IP_VS_DBG(6, "LBLC hash table (memory=%Zdbytes) allocated for "
                  "current service\n", sizeof(*tbl));
index 90f618ab6ddac3b04fe118c3573cf0fad779f744..eec797f8cce705a1676caeb3c3078053ddcdf523 100644 (file)
@@ -112,10 +112,8 @@ ip_vs_dest_set_insert(struct ip_vs_dest_set *set, struct ip_vs_dest *dest)
        }
 
        e = kmalloc(sizeof(*e), GFP_ATOMIC);
-       if (e == NULL) {
-               pr_err("%s(): no memory\n", __func__);
+       if (e == NULL)
                return NULL;
-       }
 
        atomic_inc(&dest->refcnt);
        e->dest = dest;
@@ -373,10 +371,8 @@ ip_vs_lblcr_new(struct ip_vs_lblcr_table *tbl, const union nf_inet_addr *daddr,
        en = ip_vs_lblcr_get(dest->af, tbl, daddr);
        if (!en) {
                en = kmalloc(sizeof(*en), GFP_ATOMIC);
-               if (!en) {
-                       pr_err("%s(): no memory\n", __func__);
+               if (!en)
                        return NULL;
-               }
 
                en->af = dest->af;
                ip_vs_addr_copy(dest->af, &en->addr, daddr);
@@ -516,10 +512,9 @@ static int ip_vs_lblcr_init_svc(struct ip_vs_service *svc)
         *    Allocate the ip_vs_lblcr_table for this service
         */
        tbl = kmalloc(sizeof(*tbl), GFP_ATOMIC);
-       if (tbl == NULL) {
-               pr_err("%s(): no memory\n", __func__);
+       if (tbl == NULL)
                return -ENOMEM;
-       }
+
        svc->sched_data = tbl;
        IP_VS_DBG(6, "LBLCR hash table (memory=%Zdbytes) allocated for "
                  "current service\n", sizeof(*tbl));
index f454c80df0a7868d29f639fed1555225462a36d6..022e77e1e766450136340710a0e6c4b063e9a212 100644 (file)
@@ -127,7 +127,7 @@ ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp, int outin)
        nf_conntrack_alter_reply(ct, &new_tuple);
 }
 
-int ip_vs_confirm_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp)
+int ip_vs_confirm_conntrack(struct sk_buff *skb)
 {
        return nf_conntrack_confirm(skb);
 }
index 52d073c105e9ee7af155b1a9439017e9bc74b414..85312939695f86f59357039799cb14364e1f638e 100644 (file)
@@ -74,10 +74,9 @@ register_ip_vs_proto_netns(struct net *net, struct ip_vs_protocol *pp)
        struct ip_vs_proto_data *pd =
                        kzalloc(sizeof(struct ip_vs_proto_data), GFP_ATOMIC);
 
-       if (!pd) {
-               pr_err("%s(): no memory.\n", __func__);
+       if (!pd)
                return -ENOMEM;
-       }
+
        pd->pp = pp;    /* For speed issues */
        pd->next = ipvs->proto_data_table[hash];
        ipvs->proto_data_table[hash] = pd;
index d12ed53ec95ff6a67950ce39b902e6816d40b249..1fbf7a2816f5ade317a747737840588d41621bf0 100644 (file)
@@ -906,7 +906,7 @@ static const char *sctp_state_name(int state)
        return "?";
 }
 
-static inline int
+static inline void
 set_sctp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
                int direction, const struct sk_buff *skb)
 {
@@ -924,7 +924,7 @@ set_sctp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
        sch = skb_header_pointer(skb, ihl + sizeof(sctp_sctphdr_t),
                                sizeof(_sctpch), &_sctpch);
        if (sch == NULL)
-               return 0;
+               return;
 
        chunk_type = sch->type;
        /*
@@ -993,21 +993,15 @@ set_sctp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
                cp->timeout = pd->timeout_table[cp->state = next_state];
        else    /* What to do ? */
                cp->timeout = sctp_timeouts[cp->state = next_state];
-
-       return 1;
 }
 
-static int
+static void
 sctp_state_transition(struct ip_vs_conn *cp, int direction,
                const struct sk_buff *skb, struct ip_vs_proto_data *pd)
 {
-       int ret = 0;
-
        spin_lock(&cp->lock);
-       ret = set_sctp_state(pd, cp, direction, skb);
+       set_sctp_state(pd, cp, direction, skb);
        spin_unlock(&cp->lock);
-
-       return ret;
 }
 
 static inline __u16 sctp_app_hashkey(__be16 port)
index c0cc341b840d38180a948c51694d3e4d877e10fb..ef8641f7af8300efae329a3a74cb4325eba1761f 100644 (file)
@@ -546,7 +546,7 @@ set_tcp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
 /*
  *     Handle state transitions
  */
-static int
+static void
 tcp_state_transition(struct ip_vs_conn *cp, int direction,
                     const struct sk_buff *skb,
                     struct ip_vs_proto_data *pd)
@@ -561,13 +561,11 @@ tcp_state_transition(struct ip_vs_conn *cp, int direction,
 
        th = skb_header_pointer(skb, ihl, sizeof(_tcph), &_tcph);
        if (th == NULL)
-               return 0;
+               return;
 
        spin_lock(&cp->lock);
        set_tcp_state(pd, cp, direction, th);
        spin_unlock(&cp->lock);
-
-       return 1;
 }
 
 static inline __u16 tcp_app_hashkey(__be16 port)
index f1282cbe6fe3f92d9ff74bf5fe8fbe9ed4e31176..f4b7262896bbd272fb8d3cff5298455b1deff703 100644 (file)
@@ -454,18 +454,17 @@ static const char * udp_state_name(int state)
        return udp_state_name_table[state] ? udp_state_name_table[state] : "?";
 }
 
-static int
+static void
 udp_state_transition(struct ip_vs_conn *cp, int direction,
                     const struct sk_buff *skb,
                     struct ip_vs_proto_data *pd)
 {
        if (unlikely(!pd)) {
                pr_err("UDP no ns data\n");
-               return 0;
+               return;
        }
 
        cp->timeout = pd->timeout_table[IP_VS_UDP_S_NORMAL];
-       return 1;
 }
 
 static void __udp_init(struct net *net, struct ip_vs_proto_data *pd)
index b5e2556c581ad4c7ddabad5807d6af2d50add98f..33815f4fb451c42aeb0dad99cf157c37cc32dfbf 100644 (file)
@@ -147,10 +147,9 @@ static int ip_vs_sh_init_svc(struct ip_vs_service *svc)
        /* allocate the SH table for this service */
        tbl = kmalloc(sizeof(struct ip_vs_sh_bucket)*IP_VS_SH_TAB_SIZE,
                      GFP_ATOMIC);
-       if (tbl == NULL) {
-               pr_err("%s(): no memory\n", __func__);
+       if (tbl == NULL)
                return -ENOMEM;
-       }
+
        svc->sched_data = tbl;
        IP_VS_DBG(6, "SH hash table (memory=%Zdbytes) allocated for "
                  "current service\n",
index 1ef41f50723c04c13cfcff46ac1ca387aa6def7a..fd0d4e09876a6177d167af378ef503f6ca64d6a8 100644 (file)
@@ -85,10 +85,9 @@ static int ip_vs_wrr_init_svc(struct ip_vs_service *svc)
         *    Allocate the mark variable for WRR scheduling
         */
        mark = kmalloc(sizeof(struct ip_vs_wrr_mark), GFP_ATOMIC);
-       if (mark == NULL) {
-               pr_err("%s(): no memory\n", __func__);
+       if (mark == NULL)
                return -ENOMEM;
-       }
+
        mark->cl = &svc->destinations;
        mark->cw = 0;
        mark->mw = ip_vs_wrr_max_weight(svc);
index ee319a4338b0f72cd9deb10ce2223cca2bf0b367..aa2d7206ee8a064a5fbc57e88f655fb42e7fe21f 100644 (file)
@@ -339,7 +339,7 @@ ip_vs_dst_reset(struct ip_vs_dest *dest)
                                                                \
        (skb)->ipvs_property = 1;                               \
        if (unlikely((cp)->flags & IP_VS_CONN_F_NFCT))          \
-               __ret = ip_vs_confirm_conntrack(skb, cp);       \
+               __ret = ip_vs_confirm_conntrack(skb);           \
        if (__ret == NF_ACCEPT) {                               \
                nf_reset(skb);                                  \
                skb_forward_csum(skb);                          \
index 5acfaf59a9c3c26547f001d453ebd9a00a912f77..7202b0631cd6eb725debc17062a0d1f4a1087f41 100644 (file)
@@ -661,7 +661,6 @@ __nf_conntrack_alloc(struct net *net, u16 zone,
         */
        ct = kmem_cache_alloc(net->ct.nf_conntrack_cachep, gfp);
        if (ct == NULL) {
-               pr_debug("nf_conntrack_alloc: Can't alloc conntrack.\n");
                atomic_dec(&net->ct.count);
                return ERR_PTR(-ENOMEM);
        }
@@ -749,10 +748,8 @@ init_conntrack(struct net *net, struct nf_conn *tmpl,
 
        ct = __nf_conntrack_alloc(net, zone, tuple, &repl_tuple, GFP_ATOMIC,
                                  hash);
-       if (IS_ERR(ct)) {
-               pr_debug("Can't allocate conntrack.\n");
+       if (IS_ERR(ct))
                return (struct nf_conntrack_tuple_hash *)ct;
-       }
 
        if (!l4proto->new(ct, skb, dataoff)) {
                nf_conntrack_free(ct);
index 2d8158acf6faf5298c84e4fdabc6d8f9847b737b..66b2c54c544f6bbf87c20500d97452122f2b2fcf 100644 (file)
@@ -307,17 +307,14 @@ nfulnl_alloc_skb(unsigned int inst_size, unsigned int pkt_size)
        n = max(inst_size, pkt_size);
        skb = alloc_skb(n, GFP_ATOMIC);
        if (!skb) {
-               pr_notice("nfnetlink_log: can't alloc whole buffer (%u bytes)\n",
-                       inst_size);
-
                if (n > pkt_size) {
                        /* try to allocate only as much as we need for current
                         * packet */
 
                        skb = alloc_skb(pkt_size, GFP_ATOMIC);
                        if (!skb)
-                               pr_err("nfnetlink_log: can't even alloc %u "
-                                      "bytes\n", pkt_size);
+                               pr_err("nfnetlink_log: can't even alloc %u bytes\n",
+                                      pkt_size);
                }
        }
 
index 3bdd443aaf154d7946abdd802bd080df4e2c8fad..f407ebc13481ae5caa0f634db643d034c7af7e6a 100644 (file)
@@ -122,14 +122,12 @@ static int idletimer_tg_create(struct idletimer_tg_info *info)
 
        info->timer = kmalloc(sizeof(*info->timer), GFP_KERNEL);
        if (!info->timer) {
-               pr_debug("couldn't alloc timer\n");
                ret = -ENOMEM;
                goto out;
        }
 
        info->timer->attr.attr.name = kstrdup(info->label, GFP_KERNEL);
        if (!info->timer->attr.attr.name) {
-               pr_debug("couldn't alloc attribute name\n");
                ret = -ENOMEM;
                goto out_free_timer;
        }
index 9228ee0dc11a307a49d131e7f879c738351dcef5..dfd52bad1523f73535110e0d1b2c9f4a87c6545a 100644 (file)
@@ -176,10 +176,7 @@ dsthash_alloc_init(struct xt_hashlimit_htable *ht,
                ent = NULL;
        } else
                ent = kmem_cache_alloc(hashlimit_cachep, GFP_ATOMIC);
-       if (!ent) {
-               if (net_ratelimit())
-                       pr_err("cannot allocate dsthash_ent\n");
-       } else {
+       if (ent) {
                memcpy(&ent->dst, dst, sizeof(ent->dst));
                spin_lock_init(&ent->lock);
 
index 03bb45adf2fcf5f76ff5540e8722fdf95726cc9b..82a6f34d39d012fb35d9a0d490503fcc2048e6e2 100644 (file)
@@ -335,7 +335,7 @@ struct packet_skb_cb {
        (((x)->kactive_blk_num < ((x)->knum_blocks-1)) ? \
        ((x)->kactive_blk_num+1) : 0)
 
-static inline struct packet_sock *pkt_sk(struct sock *sk)
+static struct packet_sock *pkt_sk(struct sock *sk)
 {
        return (struct packet_sock *)sk;
 }
@@ -477,7 +477,7 @@ static void *packet_lookup_frame(struct packet_sock *po,
        return h.raw;
 }
 
-static inline void *packet_current_frame(struct packet_sock *po,
+static void *packet_current_frame(struct packet_sock *po,
                struct packet_ring_buffer *rb,
                int status)
 {
@@ -715,7 +715,7 @@ out:
        spin_unlock(&po->sk.sk_receive_queue.lock);
 }
 
-static inline void prb_flush_block(struct tpacket_kbdq_core *pkc1,
+static void prb_flush_block(struct tpacket_kbdq_core *pkc1,
                struct tpacket_block_desc *pbd1, __u32 status)
 {
        /* Flush everything minus the block header */
@@ -793,7 +793,7 @@ static void prb_close_block(struct tpacket_kbdq_core *pkc1,
        pkc1->kactive_blk_num = GET_NEXT_PRB_BLK_NUM(pkc1);
 }
 
-static inline void prb_thaw_queue(struct tpacket_kbdq_core *pkc)
+static void prb_thaw_queue(struct tpacket_kbdq_core *pkc)
 {
        pkc->reset_pending_on_curr_blk = 0;
 }
@@ -869,7 +869,7 @@ static void prb_open_block(struct tpacket_kbdq_core *pkc1,
  *         case and __packet_lookup_frame_in_block will check if block-0
  *         is free and can now be re-used.
  */
-static inline void prb_freeze_queue(struct tpacket_kbdq_core *pkc,
+static void prb_freeze_queue(struct tpacket_kbdq_core *pkc,
                                  struct packet_sock *po)
 {
        pkc->reset_pending_on_curr_blk = 1;
@@ -940,36 +940,36 @@ static void prb_retire_current_block(struct tpacket_kbdq_core *pkc,
        BUG();
 }
 
-static inline int prb_curr_blk_in_use(struct tpacket_kbdq_core *pkc,
+static int prb_curr_blk_in_use(struct tpacket_kbdq_core *pkc,
                                      struct tpacket_block_desc *pbd)
 {
        return TP_STATUS_USER & BLOCK_STATUS(pbd);
 }
 
-static inline int prb_queue_frozen(struct tpacket_kbdq_core *pkc)
+static int prb_queue_frozen(struct tpacket_kbdq_core *pkc)
 {
        return pkc->reset_pending_on_curr_blk;
 }
 
-static inline void prb_clear_blk_fill_status(struct packet_ring_buffer *rb)
+static void prb_clear_blk_fill_status(struct packet_ring_buffer *rb)
 {
        struct tpacket_kbdq_core *pkc  = GET_PBDQC_FROM_RB(rb);
        atomic_dec(&pkc->blk_fill_in_prog);
 }
 
-static inline void prb_fill_rxhash(struct tpacket_kbdq_core *pkc,
+static void prb_fill_rxhash(struct tpacket_kbdq_core *pkc,
                        struct tpacket3_hdr *ppd)
 {
        ppd->hv1.tp_rxhash = skb_get_rxhash(pkc->skb);
 }
 
-static inline void prb_clear_rxhash(struct tpacket_kbdq_core *pkc,
+static void prb_clear_rxhash(struct tpacket_kbdq_core *pkc,
                        struct tpacket3_hdr *ppd)
 {
        ppd->hv1.tp_rxhash = 0;
 }
 
-static inline void prb_fill_vlan_info(struct tpacket_kbdq_core *pkc,
+static void prb_fill_vlan_info(struct tpacket_kbdq_core *pkc,
                        struct tpacket3_hdr *ppd)
 {
        if (vlan_tx_tag_present(pkc->skb)) {
@@ -991,7 +991,7 @@ static void prb_run_all_ft_ops(struct tpacket_kbdq_core *pkc,
                prb_clear_rxhash(pkc, ppd);
 }
 
-static inline void prb_fill_curr_block(char *curr,
+static void prb_fill_curr_block(char *curr,
                                struct tpacket_kbdq_core *pkc,
                                struct tpacket_block_desc *pbd,
                                unsigned int len)
@@ -1071,7 +1071,7 @@ static void *__packet_lookup_frame_in_block(struct packet_sock *po,
        return NULL;
 }
 
-static inline void *packet_current_rx_frame(struct packet_sock *po,
+static void *packet_current_rx_frame(struct packet_sock *po,
                                            struct sk_buff *skb,
                                            int status, unsigned int len)
 {
@@ -1091,7 +1091,7 @@ static inline void *packet_current_rx_frame(struct packet_sock *po,
        }
 }
 
-static inline void *prb_lookup_block(struct packet_sock *po,
+static void *prb_lookup_block(struct packet_sock *po,
                                     struct packet_ring_buffer *rb,
                                     unsigned int previous,
                                     int status)
@@ -1104,7 +1104,7 @@ static inline void *prb_lookup_block(struct packet_sock *po,
        return pbd;
 }
 
-static inline int prb_previous_blk_num(struct packet_ring_buffer *rb)
+static int prb_previous_blk_num(struct packet_ring_buffer *rb)
 {
        unsigned int prev;
        if (rb->prb_bdqc.kactive_blk_num)
@@ -1115,7 +1115,7 @@ static inline int prb_previous_blk_num(struct packet_ring_buffer *rb)
 }
 
 /* Assumes caller has held the rx_queue.lock */
-static inline void *__prb_previous_block(struct packet_sock *po,
+static void *__prb_previous_block(struct packet_sock *po,
                                         struct packet_ring_buffer *rb,
                                         int status)
 {
@@ -1123,7 +1123,7 @@ static inline void *__prb_previous_block(struct packet_sock *po,
        return prb_lookup_block(po, rb, previous, status);
 }
 
-static inline void *packet_previous_rx_frame(struct packet_sock *po,
+static void *packet_previous_rx_frame(struct packet_sock *po,
                                             struct packet_ring_buffer *rb,
                                             int status)
 {
@@ -1133,7 +1133,7 @@ static inline void *packet_previous_rx_frame(struct packet_sock *po,
        return __prb_previous_block(po, rb, status);
 }
 
-static inline void packet_increment_rx_head(struct packet_sock *po,
+static void packet_increment_rx_head(struct packet_sock *po,
                                            struct packet_ring_buffer *rb)
 {
        switch (po->tp_version) {
@@ -1148,7 +1148,7 @@ static inline void packet_increment_rx_head(struct packet_sock *po,
        }
 }
 
-static inline void *packet_previous_frame(struct packet_sock *po,
+static void *packet_previous_frame(struct packet_sock *po,
                struct packet_ring_buffer *rb,
                int status)
 {
@@ -1156,7 +1156,7 @@ static inline void *packet_previous_frame(struct packet_sock *po,
        return packet_lookup_frame(po, rb, previous, status);
 }
 
-static inline void packet_increment_head(struct packet_ring_buffer *buff)
+static void packet_increment_head(struct packet_ring_buffer *buff)
 {
        buff->head = buff->head != buff->frame_max ? buff->head+1 : 0;
 }
@@ -1558,7 +1558,7 @@ out_free:
        return err;
 }
 
-static inline unsigned int run_filter(const struct sk_buff *skb,
+static unsigned int run_filter(const struct sk_buff *skb,
                                      const struct sock *sk,
                                      unsigned int res)
 {
@@ -2167,10 +2167,10 @@ out:
        return err;
 }
 
-static inline struct sk_buff *packet_alloc_skb(struct sock *sk, size_t prepad,
-                                              size_t reserve, size_t len,
-                                              size_t linear, int noblock,
-                                              int *err)
+static struct sk_buff *packet_alloc_skb(struct sock *sk, size_t prepad,
+                                       size_t reserve, size_t len,
+                                       size_t linear, int noblock,
+                                       int *err)
 {
        struct sk_buff *skb;
 
@@ -3494,7 +3494,7 @@ static void free_pg_vec(struct pgv *pg_vec, unsigned int order,
        kfree(pg_vec);
 }
 
-static inline char *alloc_one_pg_vec_page(unsigned long order)
+static char *alloc_one_pg_vec_page(unsigned long order)
 {
        char *buffer = NULL;
        gfp_t gfp_flags = GFP_KERNEL | __GFP_COMP |
index 5f03e4ea65bff5f137aebe122f843fb7e5c6a4ca..3e16c6abde4f4bea8a800dbecfd2d98068d37cf8 100644 (file)
@@ -1261,14 +1261,19 @@ static int x25_recvmsg(struct kiocb *iocb, struct socket *sock,
        struct x25_sock *x25 = x25_sk(sk);
        struct sockaddr_x25 *sx25 = (struct sockaddr_x25 *)msg->msg_name;
        size_t copied;
-       int qbit, header_len = x25->neighbour->extended ?
-               X25_EXT_MIN_LEN : X25_STD_MIN_LEN;
-
+       int qbit, header_len;
        struct sk_buff *skb;
        unsigned char *asmptr;
        int rc = -ENOTCONN;
 
        lock_sock(sk);
+
+       if (x25->neighbour == NULL)
+               goto out;
+
+       header_len = x25->neighbour->extended ?
+               X25_EXT_MIN_LEN : X25_STD_MIN_LEN;
+
        /*
         * This works for seqpacket too. The receiver has ordered the queue for
         * us! We do one quick check first though