diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-04 00:05:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-04 00:05:43 -0400 |
commit | 6dbbd92522a13bcd5003829cbed30bc38a3d0362 (patch) | |
tree | b486642d7392b81d89f159d65fd556a432e78d16 | |
parent | d6748066ad0e8b2514545998f8367ebb3906f299 (diff) | |
parent | e1cfb67acd5e890bbad695000d2c997bfb7f1756 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
* 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, 505 insertions, 421 deletions
diff --git a/Documentation/networking/ipvs-sysctl.txt b/Documentation/networking/ipvs-sysctl.txt index 4ccdbca03811..f2a2488f1bf3 100644 --- a/Documentation/networking/ipvs-sysctl.txt +++ b/Documentation/networking/ipvs-sysctl.txt | |||
@@ -15,6 +15,23 @@ amemthresh - INTEGER | |||
15 | enabled and the variable is automatically set to 2, otherwise | 15 | enabled and the variable is automatically set to 2, otherwise |
16 | the strategy is disabled and the variable is set to 1. | 16 | the strategy is disabled and the variable is set to 1. |
17 | 17 | ||
18 | conntrack - BOOLEAN | ||
19 | 0 - disabled (default) | ||
20 | not 0 - enabled | ||
21 | |||
22 | If set, maintain connection tracking entries for | ||
23 | connections handled by IPVS. | ||
24 | |||
25 | This should be enabled if connections handled by IPVS are to be | ||
26 | also handled by stateful firewall rules. That is, iptables rules | ||
27 | that make use of connection tracking. It is a performance | ||
28 | optimisation to disable this setting otherwise. | ||
29 | |||
30 | Connections handled by the IPVS FTP application module | ||
31 | will have connection tracking entries regardless of this setting. | ||
32 | |||
33 | Only available when IPVS is compiled with CONFIG_IP_VS_NFCT enabled. | ||
34 | |||
18 | cache_bypass - BOOLEAN | 35 | cache_bypass - BOOLEAN |
19 | 0 - disabled (default) | 36 | 0 - disabled (default) |
20 | not 0 - enabled | 37 | not 0 - enabled |
@@ -39,7 +56,7 @@ debug_level - INTEGER | |||
39 | 11 - IPVS packet handling (ip_vs_in/ip_vs_out) | 56 | 11 - IPVS packet handling (ip_vs_in/ip_vs_out) |
40 | 12 or more - packet traversal | 57 | 12 or more - packet traversal |
41 | 58 | ||
42 | Only available when IPVS is compiled with the CONFIG_IPVS_DEBUG | 59 | Only available when IPVS is compiled with CONFIG_IP_VS_DEBUG enabled. |
43 | 60 | ||
44 | Higher debugging levels include the messages for lower debugging | 61 | Higher debugging levels include the messages for lower debugging |
45 | levels, so setting debug level 2, includes level 0, 1 and 2 | 62 | levels, so setting debug level 2, includes level 0, 1 and 2 |
@@ -123,13 +140,11 @@ nat_icmp_send - BOOLEAN | |||
123 | secure_tcp - INTEGER | 140 | secure_tcp - INTEGER |
124 | 0 - disabled (default) | 141 | 0 - disabled (default) |
125 | 142 | ||
126 | The secure_tcp defense is to use a more complicated state | 143 | The secure_tcp defense is to use a more complicated TCP state |
127 | transition table and some possible short timeouts of each | 144 | transition table. For VS/NAT, it also delays entering the |
128 | state. In the VS/NAT, it delays the entering the ESTABLISHED | 145 | TCP ESTABLISHED state until the three way handshake is completed. |
129 | until the real server starts to send data and ACK packet | ||
130 | (after 3-way handshake). | ||
131 | 146 | ||
132 | The value definition is the same as that of drop_entry or | 147 | The value definition is the same as that of drop_entry and |
133 | drop_packet. | 148 | drop_packet. |
134 | 149 | ||
135 | sync_threshold - INTEGER | 150 | sync_threshold - INTEGER |
@@ -141,3 +156,36 @@ sync_threshold - INTEGER | |||
141 | synchronized, every time the number of its incoming packets | 156 | synchronized, every time the number of its incoming packets |
142 | modulus 50 equals the threshold. The range of the threshold is | 157 | modulus 50 equals the threshold. The range of the threshold is |
143 | from 0 to 49. | 158 | from 0 to 49. |
159 | |||
160 | snat_reroute - BOOLEAN | ||
161 | 0 - disabled | ||
162 | not 0 - enabled (default) | ||
163 | |||
164 | If enabled, recalculate the route of SNATed packets from | ||
165 | realservers so that they are routed as if they originate from the | ||
166 | director. Otherwise they are routed as if they are forwarded by the | ||
167 | director. | ||
168 | |||
169 | If policy routing is in effect then it is possible that the route | ||
170 | of a packet originating from a director is routed differently to a | ||
171 | packet being forwarded by the director. | ||
172 | |||
173 | If policy routing is not in effect then the recalculated route will | ||
174 | always be the same as the original route so it is an optimisation | ||
175 | to disable snat_reroute and avoid the recalculation. | ||
176 | |||
177 | sync_version - INTEGER | ||
178 | default 1 | ||
179 | |||
180 | The version of the synchronisation protocol used when sending | ||
181 | synchronisation messages. | ||
182 | |||
183 | 0 selects the original synchronisation protocol (version 0). This | ||
184 | should be used when sending synchronisation messages to a legacy | ||
185 | system that only understands the original synchronisation protocol. | ||
186 | |||
187 | 1 selects the current synchronisation protocol (version 1). This | ||
188 | should be used where possible. | ||
189 | |||
190 | Kernels with this sync_version entry are able to receive messages | ||
191 | of both version 1 and version 2 of the synchronisation protocol. | ||
diff --git a/MAINTAINERS b/MAINTAINERS index ab7767001286..a6afe342f0fc 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -1716,6 +1716,7 @@ F: include/linux/can.h | |||
1716 | F: include/linux/can/core.h | 1716 | F: include/linux/can/core.h |
1717 | F: include/linux/can/bcm.h | 1717 | F: include/linux/can/bcm.h |
1718 | F: include/linux/can/raw.h | 1718 | F: include/linux/can/raw.h |
1719 | F: include/linux/can/gw.h | ||
1719 | 1720 | ||
1720 | CAN NETWORK DRIVERS | 1721 | CAN NETWORK DRIVERS |
1721 | M: Wolfgang Grandegger <wg@grandegger.com> | 1722 | M: Wolfgang Grandegger <wg@grandegger.com> |
@@ -4476,11 +4477,9 @@ F: Documentation/networking/vxge.txt | |||
4476 | F: drivers/net/ethernet/neterion/ | 4477 | F: drivers/net/ethernet/neterion/ |
4477 | 4478 | ||
4478 | NETFILTER/IPTABLES/IPCHAINS | 4479 | NETFILTER/IPTABLES/IPCHAINS |
4479 | P: Rusty Russell | ||
4480 | P: Marc Boucher | ||
4481 | P: James Morris | ||
4482 | P: Harald Welte | 4480 | P: Harald Welte |
4483 | P: Jozsef Kadlecsik | 4481 | P: Jozsef Kadlecsik |
4482 | M: Pablo Neira Ayuso <pablo@netfilter.org> | ||
4484 | M: Patrick McHardy <kaber@trash.net> | 4483 | M: Patrick McHardy <kaber@trash.net> |
4485 | L: netfilter-devel@vger.kernel.org | 4484 | L: netfilter-devel@vger.kernel.org |
4486 | L: netfilter@vger.kernel.org | 4485 | L: netfilter@vger.kernel.org |
diff --git a/drivers/isdn/hisax/l3dss1.c b/drivers/isdn/hisax/l3dss1.c index b0d9ab1f21c0..6a8acf65777d 100644 --- a/drivers/isdn/hisax/l3dss1.c +++ b/drivers/isdn/hisax/l3dss1.c | |||
@@ -353,7 +353,7 @@ l3dss1_parse_facility(struct PStack *st, struct l3_process *pc, | |||
353 | { l3dss1_dummy_invoke(st, cr, id, ident, p, nlen); | 353 | { l3dss1_dummy_invoke(st, cr, id, ident, p, nlen); |
354 | return; | 354 | return; |
355 | } | 355 | } |
356 | #ifdef HISAX_DE_AOC | 356 | #ifdef CONFIG_DE_AOC |
357 | { | 357 | { |
358 | 358 | ||
359 | #define FOO1(s,a,b) \ | 359 | #define FOO1(s,a,b) \ |
@@ -422,9 +422,9 @@ l3dss1_parse_facility(struct PStack *st, struct l3_process *pc, | |||
422 | #undef FOO1 | 422 | #undef FOO1 |
423 | 423 | ||
424 | } | 424 | } |
425 | #else /* not HISAX_DE_AOC */ | 425 | #else /* not CONFIG_DE_AOC */ |
426 | l3_debug(st, "invoke break"); | 426 | l3_debug(st, "invoke break"); |
427 | #endif /* not HISAX_DE_AOC */ | 427 | #endif /* not CONFIG_DE_AOC */ |
428 | break; | 428 | break; |
429 | case 2: /* return result */ | 429 | case 2: /* return result */ |
430 | /* if no process available handle separately */ | 430 | /* if no process available handle separately */ |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index c34cc1e7c6f6..b2b9109b6712 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -550,7 +550,7 @@ down: | |||
550 | /* | 550 | /* |
551 | * Get link speed and duplex from the slave's base driver | 551 | * Get link speed and duplex from the slave's base driver |
552 | * using ethtool. If for some reason the call fails or the | 552 | * using ethtool. If for some reason the call fails or the |
553 | * values are invalid, fake speed and duplex to 100/Full | 553 | * values are invalid, set speed and duplex to -1, |
554 | * and return error. | 554 | * and return error. |
555 | */ | 555 | */ |
556 | static int bond_update_speed_duplex(struct slave *slave) | 556 | static int bond_update_speed_duplex(struct slave *slave) |
@@ -560,9 +560,8 @@ static int bond_update_speed_duplex(struct slave *slave) | |||
560 | u32 slave_speed; | 560 | u32 slave_speed; |
561 | int res; | 561 | int res; |
562 | 562 | ||
563 | /* Fake speed and duplex */ | 563 | slave->speed = -1; |
564 | slave->speed = SPEED_100; | 564 | slave->duplex = -1; |
565 | slave->duplex = DUPLEX_FULL; | ||
566 | 565 | ||
567 | res = __ethtool_get_settings(slave_dev, &ecmd); | 566 | res = __ethtool_get_settings(slave_dev, &ecmd); |
568 | if (res < 0) | 567 | if (res < 0) |
@@ -1751,16 +1750,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1751 | new_slave->link = BOND_LINK_DOWN; | 1750 | new_slave->link = BOND_LINK_DOWN; |
1752 | } | 1751 | } |
1753 | 1752 | ||
1754 | if (bond_update_speed_duplex(new_slave) && | 1753 | bond_update_speed_duplex(new_slave); |
1755 | (new_slave->link != BOND_LINK_DOWN)) { | ||
1756 | pr_warning("%s: Warning: failed to get speed and duplex from %s, assumed to be 100Mb/sec and Full.\n", | ||
1757 | bond_dev->name, new_slave->dev->name); | ||
1758 | |||
1759 | if (bond->params.mode == BOND_MODE_8023AD) { | ||
1760 | pr_warning("%s: Warning: Operation of 802.3ad mode requires ETHTOOL support in base driver for proper aggregator selection.\n", | ||
1761 | bond_dev->name); | ||
1762 | } | ||
1763 | } | ||
1764 | 1754 | ||
1765 | if (USES_PRIMARY(bond->params.mode) && bond->params.primary[0]) { | 1755 | if (USES_PRIMARY(bond->params.mode) && bond->params.primary[0]) { |
1766 | /* if there is a primary slave, remember it */ | 1756 | /* if there is a primary slave, remember it */ |
@@ -3220,6 +3210,7 @@ static int bond_slave_netdev_event(unsigned long event, | |||
3220 | { | 3210 | { |
3221 | struct net_device *bond_dev = slave_dev->master; | 3211 | struct net_device *bond_dev = slave_dev->master; |
3222 | struct bonding *bond = netdev_priv(bond_dev); | 3212 | struct bonding *bond = netdev_priv(bond_dev); |
3213 | struct slave *slave = NULL; | ||
3223 | 3214 | ||
3224 | switch (event) { | 3215 | switch (event) { |
3225 | case NETDEV_UNREGISTER: | 3216 | case NETDEV_UNREGISTER: |
@@ -3230,20 +3221,16 @@ static int bond_slave_netdev_event(unsigned long event, | |||
3230 | bond_release(bond_dev, slave_dev); | 3221 | bond_release(bond_dev, slave_dev); |
3231 | } | 3222 | } |
3232 | break; | 3223 | break; |
3224 | case NETDEV_UP: | ||
3233 | case NETDEV_CHANGE: | 3225 | case NETDEV_CHANGE: |
3234 | if (bond->params.mode == BOND_MODE_8023AD || bond_is_lb(bond)) { | 3226 | slave = bond_get_slave_by_dev(bond, slave_dev); |
3235 | struct slave *slave; | 3227 | if (slave) { |
3228 | u32 old_speed = slave->speed; | ||
3229 | u8 old_duplex = slave->duplex; | ||
3236 | 3230 | ||
3237 | slave = bond_get_slave_by_dev(bond, slave_dev); | 3231 | bond_update_speed_duplex(slave); |
3238 | if (slave) { | ||
3239 | u32 old_speed = slave->speed; | ||
3240 | u8 old_duplex = slave->duplex; | ||
3241 | |||
3242 | bond_update_speed_duplex(slave); | ||
3243 | |||
3244 | if (bond_is_lb(bond)) | ||
3245 | break; | ||
3246 | 3232 | ||
3233 | if (bond->params.mode == BOND_MODE_8023AD) { | ||
3247 | if (old_speed != slave->speed) | 3234 | if (old_speed != slave->speed) |
3248 | bond_3ad_adapter_speed_changed(slave); | 3235 | bond_3ad_adapter_speed_changed(slave); |
3249 | if (old_duplex != slave->duplex) | 3236 | if (old_duplex != slave->duplex) |
diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c index 95de93b90386..d2ff52e63cbb 100644 --- a/drivers/net/bonding/bond_procfs.c +++ b/drivers/net/bonding/bond_procfs.c | |||
@@ -157,8 +157,16 @@ static void bond_info_show_slave(struct seq_file *seq, | |||
157 | seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name); | 157 | seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name); |
158 | seq_printf(seq, "MII Status: %s\n", | 158 | seq_printf(seq, "MII Status: %s\n", |
159 | (slave->link == BOND_LINK_UP) ? "up" : "down"); | 159 | (slave->link == BOND_LINK_UP) ? "up" : "down"); |
160 | seq_printf(seq, "Speed: %d Mbps\n", slave->speed); | 160 | if (slave->speed == -1) |
161 | seq_printf(seq, "Duplex: %s\n", slave->duplex ? "full" : "half"); | 161 | seq_printf(seq, "Speed: %s\n", "Unknown"); |
162 | else | ||
163 | seq_printf(seq, "Speed: %d Mbps\n", slave->speed); | ||
164 | |||
165 | if (slave->duplex == -1) | ||
166 | seq_printf(seq, "Duplex: %s\n", "Unknown"); | ||
167 | else | ||
168 | seq_printf(seq, "Duplex: %s\n", slave->duplex ? "full" : "half"); | ||
169 | |||
162 | seq_printf(seq, "Link Failure Count: %u\n", | 170 | seq_printf(seq, "Link Failure Count: %u\n", |
163 | slave->link_failure_count); | 171 | slave->link_failure_count); |
164 | 172 | ||
diff --git a/drivers/net/ethernet/Kconfig b/drivers/net/ethernet/Kconfig index 6dff5a0e733f..597f4d45c632 100644 --- a/drivers/net/ethernet/Kconfig +++ b/drivers/net/ethernet/Kconfig | |||
@@ -159,6 +159,7 @@ config S6GMAC | |||
159 | will be called s6gmac. | 159 | will be called s6gmac. |
160 | 160 | ||
161 | source "drivers/net/ethernet/seeq/Kconfig" | 161 | source "drivers/net/ethernet/seeq/Kconfig" |
162 | source "drivers/net/ethernet/silan/Kconfig" | ||
162 | source "drivers/net/ethernet/sis/Kconfig" | 163 | source "drivers/net/ethernet/sis/Kconfig" |
163 | source "drivers/net/ethernet/sfc/Kconfig" | 164 | source "drivers/net/ethernet/sfc/Kconfig" |
164 | source "drivers/net/ethernet/sgi/Kconfig" | 165 | source "drivers/net/ethernet/sgi/Kconfig" |
diff --git a/drivers/net/ethernet/Makefile b/drivers/net/ethernet/Makefile index c53ad3afc991..be5dde040261 100644 --- a/drivers/net/ethernet/Makefile +++ b/drivers/net/ethernet/Makefile | |||
@@ -58,6 +58,7 @@ obj-$(CONFIG_SH_ETH) += renesas/ | |||
58 | obj-$(CONFIG_NET_VENDOR_RDC) += rdc/ | 58 | obj-$(CONFIG_NET_VENDOR_RDC) += rdc/ |
59 | obj-$(CONFIG_S6GMAC) += s6gmac.o | 59 | obj-$(CONFIG_S6GMAC) += s6gmac.o |
60 | obj-$(CONFIG_NET_VENDOR_SEEQ) += seeq/ | 60 | obj-$(CONFIG_NET_VENDOR_SEEQ) += seeq/ |
61 | obj-$(CONFIG_NET_VENDOR_SILAN) += silan/ | ||
61 | obj-$(CONFIG_NET_VENDOR_SIS) += sis/ | 62 | obj-$(CONFIG_NET_VENDOR_SIS) += sis/ |
62 | obj-$(CONFIG_SFC) += sfc/ | 63 | obj-$(CONFIG_SFC) += sfc/ |
63 | obj-$(CONFIG_NET_VENDOR_SGI) += sgi/ | 64 | obj-$(CONFIG_NET_VENDOR_SGI) += sgi/ |
diff --git a/drivers/net/ethernet/apple/Kconfig b/drivers/net/ethernet/apple/Kconfig index a759d5483ab9..1375e2dc9468 100644 --- a/drivers/net/ethernet/apple/Kconfig +++ b/drivers/net/ethernet/apple/Kconfig | |||
@@ -52,18 +52,6 @@ config BMAC | |||
52 | To compile this driver as a module, choose M here: the module | 52 | To compile this driver as a module, choose M here: the module |
53 | will be called bmac. | 53 | will be called bmac. |
54 | 54 | ||
55 | config MAC89x0 | ||
56 | tristate "Macintosh CS89x0 based ethernet cards" | ||
57 | depends on MAC | ||
58 | ---help--- | ||
59 | Support for CS89x0 chipset based Ethernet cards. If you have a | ||
60 | Nubus or LC-PDS network (Ethernet) card of this type, say Y and | ||
61 | read the Ethernet-HOWTO, available from | ||
62 | <http://www.tldp.org/docs.html#howto>. | ||
63 | |||
64 | To compile this driver as a module, choose M here. This module will | ||
65 | be called mac89x0. | ||
66 | |||
67 | config MACMACE | 55 | config MACMACE |
68 | bool "Macintosh (AV) onboard MACE ethernet" | 56 | bool "Macintosh (AV) onboard MACE ethernet" |
69 | depends on MAC | 57 | depends on MAC |
diff --git a/drivers/net/ethernet/apple/Makefile b/drivers/net/ethernet/apple/Makefile index 0d3a5919c95b..86eaa17af0f4 100644 --- a/drivers/net/ethernet/apple/Makefile +++ b/drivers/net/ethernet/apple/Makefile | |||
@@ -4,5 +4,4 @@ | |||
4 | 4 | ||
5 | obj-$(CONFIG_MACE) += mace.o | 5 | obj-$(CONFIG_MACE) += mace.o |
6 | obj-$(CONFIG_BMAC) += bmac.o | 6 | obj-$(CONFIG_BMAC) += bmac.o |
7 | obj-$(CONFIG_MAC89x0) += mac89x0.o | ||
8 | obj-$(CONFIG_MACMACE) += macmace.o | 7 | obj-$(CONFIG_MACMACE) += macmace.o |
diff --git a/drivers/net/ethernet/cirrus/Kconfig b/drivers/net/ethernet/cirrus/Kconfig index 6cbb81ccc02e..1f8648f099c7 100644 --- a/drivers/net/ethernet/cirrus/Kconfig +++ b/drivers/net/ethernet/cirrus/Kconfig | |||
@@ -6,7 +6,7 @@ config NET_VENDOR_CIRRUS | |||
6 | bool "Cirrus devices" | 6 | bool "Cirrus devices" |
7 | default y | 7 | default y |
8 | depends on ISA || EISA || MACH_IXDP2351 || ARCH_IXDP2X01 \ | 8 | depends on ISA || EISA || MACH_IXDP2351 || ARCH_IXDP2X01 \ |
9 | || MACH_MX31ADS || MACH_QQ2440 || (ARM && ARCH_EP93XX) | 9 | || MACH_MX31ADS || MACH_QQ2440 || (ARM && ARCH_EP93XX) || MAC |
10 | ---help--- | 10 | ---help--- |
11 | If you have a network (Ethernet) card belonging to this class, say Y | 11 | If you have a network (Ethernet) card belonging to this class, say Y |
12 | and read the Ethernet-HOWTO, available from | 12 | and read the Ethernet-HOWTO, available from |
@@ -47,4 +47,16 @@ config EP93XX_ETH | |||
47 | This is a driver for the ethernet hardware included in EP93xx CPUs. | 47 | This is a driver for the ethernet hardware included in EP93xx CPUs. |
48 | Say Y if you are building a kernel for EP93xx based devices. | 48 | Say Y if you are building a kernel for EP93xx based devices. |
49 | 49 | ||
50 | config MAC89x0 | ||
51 | tristate "Macintosh CS89x0 based ethernet cards" | ||
52 | depends on MAC | ||
53 | ---help--- | ||
54 | Support for CS89x0 chipset based Ethernet cards. If you have a | ||
55 | Nubus or LC-PDS network (Ethernet) card of this type, say Y and | ||
56 | read the Ethernet-HOWTO, available from | ||
57 | <http://www.tldp.org/docs.html#howto>. | ||
58 | |||
59 | To compile this driver as a module, choose M here. This module will | ||
60 | be called mac89x0. | ||
61 | |||
50 | endif # NET_VENDOR_CIRRUS | 62 | endif # NET_VENDOR_CIRRUS |
diff --git a/drivers/net/ethernet/cirrus/Makefile b/drivers/net/ethernet/cirrus/Makefile index 14bd77e0cb57..ca245e2b5d98 100644 --- a/drivers/net/ethernet/cirrus/Makefile +++ b/drivers/net/ethernet/cirrus/Makefile | |||
@@ -4,3 +4,4 @@ | |||
4 | 4 | ||
5 | obj-$(CONFIG_CS89x0) += cs89x0.o | 5 | obj-$(CONFIG_CS89x0) += cs89x0.o |
6 | obj-$(CONFIG_EP93XX_ETH) += ep93xx_eth.o | 6 | obj-$(CONFIG_EP93XX_ETH) += ep93xx_eth.o |
7 | obj-$(CONFIG_MAC89x0) += mac89x0.o | ||
diff --git a/drivers/net/ethernet/apple/mac89x0.c b/drivers/net/ethernet/cirrus/mac89x0.c index 83781f316d1f..83781f316d1f 100644 --- a/drivers/net/ethernet/apple/mac89x0.c +++ b/drivers/net/ethernet/cirrus/mac89x0.c | |||
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c index 824b8e6021f6..2c7b36673dfc 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.c +++ b/drivers/net/ethernet/emulex/benet/be_cmds.c | |||
@@ -318,8 +318,7 @@ static int be_mbox_db_ready_wait(struct be_adapter *adapter, void __iomem *db) | |||
318 | 318 | ||
319 | if (msecs > 4000) { | 319 | if (msecs > 4000) { |
320 | dev_err(&adapter->pdev->dev, "mbox poll timed out\n"); | 320 | dev_err(&adapter->pdev->dev, "mbox poll timed out\n"); |
321 | if (!lancer_chip(adapter)) | 321 | be_detect_dump_ue(adapter); |
322 | be_detect_dump_ue(adapter); | ||
323 | return -1; | 322 | return -1; |
324 | } | 323 | } |
325 | 324 | ||
@@ -1540,7 +1539,14 @@ int be_cmd_rx_filter(struct be_adapter *adapter, u32 flags, u32 value) | |||
1540 | 1539 | ||
1541 | req->if_flags_mask = req->if_flags = | 1540 | req->if_flags_mask = req->if_flags = |
1542 | cpu_to_le32(BE_IF_FLAGS_MULTICAST); | 1541 | cpu_to_le32(BE_IF_FLAGS_MULTICAST); |
1543 | req->mcast_num = cpu_to_le16(netdev_mc_count(adapter->netdev)); | 1542 | |
1543 | /* Reset mcast promisc mode if already set by setting mask | ||
1544 | * and not setting flags field | ||
1545 | */ | ||
1546 | req->if_flags_mask |= | ||
1547 | cpu_to_le32(BE_IF_FLAGS_MCAST_PROMISCUOUS); | ||
1548 | |||
1549 | req->mcast_num = cpu_to_le32(netdev_mc_count(adapter->netdev)); | ||
1544 | netdev_for_each_mc_addr(ha, adapter->netdev) | 1550 | netdev_for_each_mc_addr(ha, adapter->netdev) |
1545 | memcpy(req->mcast_mac[i++].byte, ha->addr, ETH_ALEN); | 1551 | memcpy(req->mcast_mac[i++].byte, ha->addr, ETH_ALEN); |
1546 | } | 1552 | } |
diff --git a/drivers/net/ethernet/emulex/benet/be_hw.h b/drivers/net/ethernet/emulex/benet/be_hw.h index fbc8a915519e..f2c89e3ccabd 100644 --- a/drivers/net/ethernet/emulex/benet/be_hw.h +++ b/drivers/net/ethernet/emulex/benet/be_hw.h | |||
@@ -48,6 +48,8 @@ | |||
48 | /* Lancer SLIPORT_CONTROL SLIPORT_STATUS registers */ | 48 | /* Lancer SLIPORT_CONTROL SLIPORT_STATUS registers */ |
49 | #define SLIPORT_STATUS_OFFSET 0x404 | 49 | #define SLIPORT_STATUS_OFFSET 0x404 |
50 | #define SLIPORT_CONTROL_OFFSET 0x408 | 50 | #define SLIPORT_CONTROL_OFFSET 0x408 |
51 | #define SLIPORT_ERROR1_OFFSET 0x40C | ||
52 | #define SLIPORT_ERROR2_OFFSET 0x410 | ||
51 | 53 | ||
52 | #define SLIPORT_STATUS_ERR_MASK 0x80000000 | 54 | #define SLIPORT_STATUS_ERR_MASK 0x80000000 |
53 | #define SLIPORT_STATUS_RN_MASK 0x01000000 | 55 | #define SLIPORT_STATUS_RN_MASK 0x01000000 |
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 21804972fa2f..e0aed188c57f 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -1905,6 +1905,8 @@ loop_continue: | |||
1905 | be_rx_stats_update(rxo, rxcp); | 1905 | be_rx_stats_update(rxo, rxcp); |
1906 | } | 1906 | } |
1907 | 1907 | ||
1908 | be_cq_notify(adapter, rx_cq->id, false, work_done); | ||
1909 | |||
1908 | /* Refill the queue */ | 1910 | /* Refill the queue */ |
1909 | if (work_done && atomic_read(&rxo->q.used) < RX_FRAGS_REFILL_WM) | 1911 | if (work_done && atomic_read(&rxo->q.used) < RX_FRAGS_REFILL_WM) |
1910 | be_post_rx_frags(rxo, GFP_ATOMIC); | 1912 | be_post_rx_frags(rxo, GFP_ATOMIC); |
@@ -1912,10 +1914,8 @@ loop_continue: | |||
1912 | /* All consumed */ | 1914 | /* All consumed */ |
1913 | if (work_done < budget) { | 1915 | if (work_done < budget) { |
1914 | napi_complete(napi); | 1916 | napi_complete(napi); |
1915 | be_cq_notify(adapter, rx_cq->id, true, work_done); | 1917 | /* Arm CQ */ |
1916 | } else { | 1918 | be_cq_notify(adapter, rx_cq->id, true, 0); |
1917 | /* More to be consumed; continue with interrupts disabled */ | ||
1918 | be_cq_notify(adapter, rx_cq->id, false, work_done); | ||
1919 | } | 1919 | } |
1920 | return work_done; | 1920 | return work_done; |
1921 | } | 1921 | } |
@@ -1977,42 +1977,62 @@ static int be_poll_tx_mcc(struct napi_struct *napi, int budget) | |||
1977 | 1977 | ||
1978 | void be_detect_dump_ue(struct be_adapter *adapter) | 1978 | void be_detect_dump_ue(struct be_adapter *adapter) |
1979 | { | 1979 | { |
1980 | u32 ue_status_lo, ue_status_hi, ue_status_lo_mask, ue_status_hi_mask; | 1980 | u32 ue_lo = 0, ue_hi = 0, ue_lo_mask = 0, ue_hi_mask = 0; |
1981 | u32 sliport_status = 0, sliport_err1 = 0, sliport_err2 = 0; | ||
1981 | u32 i; | 1982 | u32 i; |
1982 | 1983 | ||
1983 | pci_read_config_dword(adapter->pdev, | 1984 | if (lancer_chip(adapter)) { |
1984 | PCICFG_UE_STATUS_LOW, &ue_status_lo); | 1985 | sliport_status = ioread32(adapter->db + SLIPORT_STATUS_OFFSET); |
1985 | pci_read_config_dword(adapter->pdev, | 1986 | if (sliport_status & SLIPORT_STATUS_ERR_MASK) { |
1986 | PCICFG_UE_STATUS_HIGH, &ue_status_hi); | 1987 | sliport_err1 = ioread32(adapter->db + |
1987 | pci_read_config_dword(adapter->pdev, | 1988 | SLIPORT_ERROR1_OFFSET); |
1988 | PCICFG_UE_STATUS_LOW_MASK, &ue_status_lo_mask); | 1989 | sliport_err2 = ioread32(adapter->db + |
1989 | pci_read_config_dword(adapter->pdev, | 1990 | SLIPORT_ERROR2_OFFSET); |
1990 | PCICFG_UE_STATUS_HI_MASK, &ue_status_hi_mask); | 1991 | } |
1992 | } else { | ||
1993 | pci_read_config_dword(adapter->pdev, | ||
1994 | PCICFG_UE_STATUS_LOW, &ue_lo); | ||
1995 | pci_read_config_dword(adapter->pdev, | ||
1996 | PCICFG_UE_STATUS_HIGH, &ue_hi); | ||
1997 | pci_read_config_dword(adapter->pdev, | ||
1998 | PCICFG_UE_STATUS_LOW_MASK, &ue_lo_mask); | ||
1999 | pci_read_config_dword(adapter->pdev, | ||
2000 | PCICFG_UE_STATUS_HI_MASK, &ue_hi_mask); | ||
1991 | 2001 | ||
1992 | ue_status_lo = (ue_status_lo & (~ue_status_lo_mask)); | 2002 | ue_lo = (ue_lo & (~ue_lo_mask)); |
1993 | ue_status_hi = (ue_status_hi & (~ue_status_hi_mask)); | 2003 | ue_hi = (ue_hi & (~ue_hi_mask)); |
2004 | } | ||
1994 | 2005 | ||
1995 | if (ue_status_lo || ue_status_hi) { | 2006 | if (ue_lo || ue_hi || |
2007 | sliport_status & SLIPORT_STATUS_ERR_MASK) { | ||
1996 | adapter->ue_detected = true; | 2008 | adapter->ue_detected = true; |
1997 | adapter->eeh_err = true; | 2009 | adapter->eeh_err = true; |
1998 | dev_err(&adapter->pdev->dev, "UE Detected!!\n"); | 2010 | dev_err(&adapter->pdev->dev, "UE Detected!!\n"); |
1999 | } | 2011 | } |
2000 | 2012 | ||
2001 | if (ue_status_lo) { | 2013 | if (ue_lo) { |
2002 | for (i = 0; ue_status_lo; ue_status_lo >>= 1, i++) { | 2014 | for (i = 0; ue_lo; ue_lo >>= 1, i++) { |
2003 | if (ue_status_lo & 1) | 2015 | if (ue_lo & 1) |
2004 | dev_err(&adapter->pdev->dev, | 2016 | dev_err(&adapter->pdev->dev, |
2005 | "UE: %s bit set\n", ue_status_low_desc[i]); | 2017 | "UE: %s bit set\n", ue_status_low_desc[i]); |
2006 | } | 2018 | } |
2007 | } | 2019 | } |
2008 | if (ue_status_hi) { | 2020 | if (ue_hi) { |
2009 | for (i = 0; ue_status_hi; ue_status_hi >>= 1, i++) { | 2021 | for (i = 0; ue_hi; ue_hi >>= 1, i++) { |
2010 | if (ue_status_hi & 1) | 2022 | if (ue_hi & 1) |
2011 | dev_err(&adapter->pdev->dev, | 2023 | dev_err(&adapter->pdev->dev, |
2012 | "UE: %s bit set\n", ue_status_hi_desc[i]); | 2024 | "UE: %s bit set\n", ue_status_hi_desc[i]); |
2013 | } | 2025 | } |
2014 | } | 2026 | } |
2015 | 2027 | ||
2028 | if (sliport_status & SLIPORT_STATUS_ERR_MASK) { | ||
2029 | dev_err(&adapter->pdev->dev, | ||
2030 | "sliport status 0x%x\n", sliport_status); | ||
2031 | dev_err(&adapter->pdev->dev, | ||
2032 | "sliport error1 0x%x\n", sliport_err1); | ||
2033 | dev_err(&adapter->pdev->dev, | ||
2034 | "sliport error2 0x%x\n", sliport_err2); | ||
2035 | } | ||
2016 | } | 2036 | } |
2017 | 2037 | ||
2018 | static void be_worker(struct work_struct *work) | 2038 | static void be_worker(struct work_struct *work) |
@@ -2022,7 +2042,7 @@ static void be_worker(struct work_struct *work) | |||
2022 | struct be_rx_obj *rxo; | 2042 | struct be_rx_obj *rxo; |
2023 | int i; | 2043 | int i; |
2024 | 2044 | ||
2025 | if (!adapter->ue_detected && !lancer_chip(adapter)) | 2045 | if (!adapter->ue_detected) |
2026 | be_detect_dump_ue(adapter); | 2046 | be_detect_dump_ue(adapter); |
2027 | 2047 | ||
2028 | /* when interrupts are not yet enabled, just reap any pending | 2048 | /* when interrupts are not yet enabled, just reap any pending |
diff --git a/drivers/net/ethernet/i825xx/3c505.c b/drivers/net/ethernet/i825xx/3c505.c index 40e1a175fceb..ba82a266051d 100644 --- a/drivers/net/ethernet/i825xx/3c505.c +++ b/drivers/net/ethernet/i825xx/3c505.c | |||
@@ -126,15 +126,13 @@ | |||
126 | * | 126 | * |
127 | *********************************************************/ | 127 | *********************************************************/ |
128 | 128 | ||
129 | #define filename __FILE__ | ||
130 | |||
131 | #define timeout_msg "*** timeout at %s:%s (line %d) ***\n" | 129 | #define timeout_msg "*** timeout at %s:%s (line %d) ***\n" |
132 | #define TIMEOUT_MSG(lineno) \ | 130 | #define TIMEOUT_MSG(lineno) \ |
133 | pr_notice(timeout_msg, filename, __func__, (lineno)) | 131 | pr_notice(timeout_msg, __FILE__, __func__, (lineno)) |
134 | 132 | ||
135 | #define invalid_pcb_msg "*** invalid pcb length %d at %s:%s (line %d) ***\n" | 133 | #define invalid_pcb_msg "*** invalid pcb length %d at %s:%s (line %d) ***\n" |
136 | #define INVALID_PCB_MSG(len) \ | 134 | #define INVALID_PCB_MSG(len) \ |
137 | pr_notice(invalid_pcb_msg, (len), filename, __func__, __LINE__) | 135 | pr_notice(invalid_pcb_msg, (len), __FILE__, __func__, __LINE__) |
138 | 136 | ||
139 | #define search_msg "%s: Looking for 3c505 adapter at address %#x..." | 137 | #define search_msg "%s: Looking for 3c505 adapter at address %#x..." |
140 | 138 | ||
diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c index ae17cd1a907f..5a2fdf7a00c8 100644 --- a/drivers/net/ethernet/intel/e100.c +++ b/drivers/net/ethernet/intel/e100.c | |||
@@ -2810,6 +2810,10 @@ static int __devinit e100_probe(struct pci_dev *pdev, | |||
2810 | 2810 | ||
2811 | e100_get_defaults(nic); | 2811 | e100_get_defaults(nic); |
2812 | 2812 | ||
2813 | /* D100 MAC doesn't allow rx of vlan packets with normal MTU */ | ||
2814 | if (nic->mac < mac_82558_D101_A4) | ||
2815 | netdev->features |= NETIF_F_VLAN_CHALLENGED; | ||
2816 | |||
2813 | /* locks must be initialized before calling hw_reset */ | 2817 | /* locks must be initialized before calling hw_reset */ |
2814 | spin_lock_init(&nic->cb_lock); | 2818 | spin_lock_init(&nic->cb_lock); |
2815 | spin_lock_init(&nic->cmd_lock); | 2819 | spin_lock_init(&nic->cmd_lock); |
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c index 6a17c62cb86f..e2a80a283fd3 100644 --- a/drivers/net/ethernet/intel/e1000e/ich8lan.c +++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c | |||
@@ -866,8 +866,7 @@ static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw) | |||
866 | 866 | ||
867 | if (test_and_set_bit(__E1000_ACCESS_SHARED_RESOURCE, | 867 | if (test_and_set_bit(__E1000_ACCESS_SHARED_RESOURCE, |
868 | &hw->adapter->state)) { | 868 | &hw->adapter->state)) { |
869 | WARN(1, "e1000e: %s: contention for Phy access\n", | 869 | e_dbg("contention for Phy access\n"); |
870 | hw->adapter->netdev->name); | ||
871 | return -E1000_ERR_PHY; | 870 | return -E1000_ERR_PHY; |
872 | } | 871 | } |
873 | 872 | ||
diff --git a/drivers/net/ethernet/intel/igb/e1000_phy.c b/drivers/net/ethernet/intel/igb/e1000_phy.c index 7edf31efe756..b17d7c20f817 100644 --- a/drivers/net/ethernet/intel/igb/e1000_phy.c +++ b/drivers/net/ethernet/intel/igb/e1000_phy.c | |||
@@ -1687,7 +1687,7 @@ s32 igb_get_cable_length_m88_gen2(struct e1000_hw *hw) | |||
1687 | if (ret_val) | 1687 | if (ret_val) |
1688 | goto out; | 1688 | goto out; |
1689 | 1689 | ||
1690 | is_cm = !(phy_data & I347AT4_PCDC_CABLE_LENGTH_UNIT); | 1690 | is_cm = !(phy_data2 & I347AT4_PCDC_CABLE_LENGTH_UNIT); |
1691 | 1691 | ||
1692 | /* Populate the phy structure with cable length in meters */ | 1692 | /* Populate the phy structure with cable length in meters */ |
1693 | phy->min_cable_length = phy_data / (is_cm ? 100 : 1); | 1693 | phy->min_cable_length = phy_data / (is_cm ? 100 : 1); |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c index 834f044be4c3..f1365fef4ed2 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | |||
@@ -3344,7 +3344,7 @@ static u8 ixgbe_calculate_checksum(u8 *buffer, u32 length) | |||
3344 | static s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer, | 3344 | static s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer, |
3345 | u32 length) | 3345 | u32 length) |
3346 | { | 3346 | { |
3347 | u32 hicr, i; | 3347 | u32 hicr, i, bi; |
3348 | u32 hdr_size = sizeof(struct ixgbe_hic_hdr); | 3348 | u32 hdr_size = sizeof(struct ixgbe_hic_hdr); |
3349 | u8 buf_len, dword_len; | 3349 | u8 buf_len, dword_len; |
3350 | 3350 | ||
@@ -3398,9 +3398,9 @@ static s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer, | |||
3398 | dword_len = hdr_size >> 2; | 3398 | dword_len = hdr_size >> 2; |
3399 | 3399 | ||
3400 | /* first pull in the header so we know the buffer length */ | 3400 | /* first pull in the header so we know the buffer length */ |
3401 | for (i = 0; i < dword_len; i++) { | 3401 | for (bi = 0; bi < dword_len; bi++) { |
3402 | buffer[i] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, i); | 3402 | buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi); |
3403 | le32_to_cpus(&buffer[i]); | 3403 | le32_to_cpus(&buffer[bi]); |
3404 | } | 3404 | } |
3405 | 3405 | ||
3406 | /* If there is any thing in data position pull it in */ | 3406 | /* 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, | |||
3414 | goto out; | 3414 | goto out; |
3415 | } | 3415 | } |
3416 | 3416 | ||
3417 | /* Calculate length in DWORDs, add one for odd lengths */ | 3417 | /* Calculate length in DWORDs, add 3 for odd lengths */ |
3418 | dword_len = (buf_len + 1) >> 2; | 3418 | dword_len = (buf_len + 3) >> 2; |
3419 | 3419 | ||
3420 | /* Pull in the rest of the buffer (i is where we left off)*/ | 3420 | /* Pull in the rest of the buffer (bi is where we left off)*/ |
3421 | for (; i < buf_len; i++) | 3421 | for (; bi <= dword_len; bi++) { |
3422 | buffer[i] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, i); | 3422 | buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi); |
3423 | le32_to_cpus(&buffer[bi]); | ||
3424 | } | ||
3423 | 3425 | ||
3424 | out: | 3426 | out: |
3425 | return ret_val; | 3427 | return ret_val; |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c index 3631d639d86a..33b93ffb87cb 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c | |||
@@ -561,11 +561,12 @@ static int ixgbe_dcbnl_ieee_getets(struct net_device *dev, | |||
561 | struct ixgbe_adapter *adapter = netdev_priv(dev); | 561 | struct ixgbe_adapter *adapter = netdev_priv(dev); |
562 | struct ieee_ets *my_ets = adapter->ixgbe_ieee_ets; | 562 | struct ieee_ets *my_ets = adapter->ixgbe_ieee_ets; |
563 | 563 | ||
564 | ets->ets_cap = adapter->dcb_cfg.num_tcs.pg_tcs; | ||
565 | |||
564 | /* No IEEE PFC settings available */ | 566 | /* No IEEE PFC settings available */ |
565 | if (!my_ets) | 567 | if (!my_ets) |
566 | return -EINVAL; | 568 | return 0; |
567 | 569 | ||
568 | ets->ets_cap = adapter->dcb_cfg.num_tcs.pg_tcs; | ||
569 | ets->cbs = my_ets->cbs; | 570 | ets->cbs = my_ets->cbs; |
570 | memcpy(ets->tc_tx_bw, my_ets->tc_tx_bw, sizeof(ets->tc_tx_bw)); | 571 | memcpy(ets->tc_tx_bw, my_ets->tc_tx_bw, sizeof(ets->tc_tx_bw)); |
571 | memcpy(ets->tc_rx_bw, my_ets->tc_rx_bw, sizeof(ets->tc_rx_bw)); | 572 | 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, | |||
621 | struct ieee_pfc *my_pfc = adapter->ixgbe_ieee_pfc; | 622 | struct ieee_pfc *my_pfc = adapter->ixgbe_ieee_pfc; |
622 | int i; | 623 | int i; |
623 | 624 | ||
625 | pfc->pfc_cap = adapter->dcb_cfg.num_tcs.pfc_tcs; | ||
626 | |||
624 | /* No IEEE PFC settings available */ | 627 | /* No IEEE PFC settings available */ |
625 | if (!my_pfc) | 628 | if (!my_pfc) |
626 | return -EINVAL; | 629 | return 0; |
627 | 630 | ||
628 | pfc->pfc_cap = adapter->dcb_cfg.num_tcs.pfc_tcs; | ||
629 | pfc->pfc_en = my_pfc->pfc_en; | 631 | pfc->pfc_en = my_pfc->pfc_en; |
630 | pfc->mbc = my_pfc->mbc; | 632 | pfc->mbc = my_pfc->mbc; |
631 | pfc->delay = my_pfc->delay; | 633 | pfc->delay = my_pfc->delay; |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 09b8e88b2999..8ef92d1a6aa1 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -3345,34 +3345,25 @@ static void ixgbe_configure_dcb(struct ixgbe_adapter *adapter) | |||
3345 | 3345 | ||
3346 | hw->mac.ops.set_vfta(&adapter->hw, 0, 0, true); | 3346 | hw->mac.ops.set_vfta(&adapter->hw, 0, 0, true); |
3347 | 3347 | ||
3348 | /* reconfigure the hardware */ | ||
3349 | if (adapter->dcbx_cap & DCB_CAP_DCBX_VER_CEE) { | ||
3350 | #ifdef IXGBE_FCOE | 3348 | #ifdef IXGBE_FCOE |
3351 | if (adapter->netdev->features & NETIF_F_FCOE_MTU) | 3349 | if (adapter->netdev->features & NETIF_F_FCOE_MTU) |
3352 | max_frame = max(max_frame, IXGBE_FCOE_JUMBO_FRAME_SIZE); | 3350 | max_frame = max(max_frame, IXGBE_FCOE_JUMBO_FRAME_SIZE); |
3353 | #endif | 3351 | #endif |
3352 | |||
3353 | /* reconfigure the hardware */ | ||
3354 | if (adapter->dcbx_cap & DCB_CAP_DCBX_VER_CEE) { | ||
3354 | ixgbe_dcb_calculate_tc_credits(hw, &adapter->dcb_cfg, max_frame, | 3355 | ixgbe_dcb_calculate_tc_credits(hw, &adapter->dcb_cfg, max_frame, |
3355 | DCB_TX_CONFIG); | 3356 | DCB_TX_CONFIG); |
3356 | ixgbe_dcb_calculate_tc_credits(hw, &adapter->dcb_cfg, max_frame, | 3357 | ixgbe_dcb_calculate_tc_credits(hw, &adapter->dcb_cfg, max_frame, |
3357 | DCB_RX_CONFIG); | 3358 | DCB_RX_CONFIG); |
3358 | ixgbe_dcb_hw_config(hw, &adapter->dcb_cfg); | 3359 | ixgbe_dcb_hw_config(hw, &adapter->dcb_cfg); |
3359 | } else { | 3360 | } else if (adapter->ixgbe_ieee_ets && adapter->ixgbe_ieee_pfc) { |
3360 | struct net_device *dev = adapter->netdev; | 3361 | ixgbe_dcb_hw_ets(&adapter->hw, |
3361 | 3362 | adapter->ixgbe_ieee_ets, | |
3362 | if (adapter->ixgbe_ieee_ets) { | 3363 | max_frame); |
3363 | struct ieee_ets *ets = adapter->ixgbe_ieee_ets; | 3364 | ixgbe_dcb_hw_pfc_config(&adapter->hw, |
3364 | int max_frame = dev->mtu + ETH_HLEN + ETH_FCS_LEN; | 3365 | adapter->ixgbe_ieee_pfc->pfc_en, |
3365 | 3366 | adapter->ixgbe_ieee_ets->prio_tc); | |
3366 | ixgbe_dcb_hw_ets(&adapter->hw, ets, max_frame); | ||
3367 | } | ||
3368 | |||
3369 | if (adapter->ixgbe_ieee_pfc) { | ||
3370 | struct ieee_pfc *pfc = adapter->ixgbe_ieee_pfc; | ||
3371 | u8 *prio_tc = adapter->ixgbe_ieee_ets->prio_tc; | ||
3372 | |||
3373 | ixgbe_dcb_hw_pfc_config(&adapter->hw, pfc->pfc_en, | ||
3374 | prio_tc); | ||
3375 | } | ||
3376 | } | 3367 | } |
3377 | 3368 | ||
3378 | /* Enable RSS Hash per TC */ | 3369 | /* Enable RSS Hash per TC */ |
@@ -6125,7 +6116,6 @@ static void ixgbe_sfp_link_config_subtask(struct ixgbe_adapter *adapter) | |||
6125 | autoneg = hw->phy.autoneg_advertised; | 6116 | autoneg = hw->phy.autoneg_advertised; |
6126 | if ((!autoneg) && (hw->mac.ops.get_link_capabilities)) | 6117 | if ((!autoneg) && (hw->mac.ops.get_link_capabilities)) |
6127 | hw->mac.ops.get_link_capabilities(hw, &autoneg, &negotiation); | 6118 | hw->mac.ops.get_link_capabilities(hw, &autoneg, &negotiation); |
6128 | hw->mac.autotry_restart = false; | ||
6129 | if (hw->mac.ops.setup_link) | 6119 | if (hw->mac.ops.setup_link) |
6130 | hw->mac.ops.setup_link(hw, autoneg, negotiation, true); | 6120 | hw->mac.ops.setup_link(hw, autoneg, negotiation, true); |
6131 | 6121 | ||
@@ -7589,13 +7579,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
7589 | goto err_eeprom; | 7579 | goto err_eeprom; |
7590 | } | 7580 | } |
7591 | 7581 | ||
7592 | /* power down the optics for multispeed fiber and 82599 SFP+ fiber */ | ||
7593 | if (hw->mac.ops.disable_tx_laser && | ||
7594 | ((hw->phy.multispeed_fiber) || | ||
7595 | ((hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) && | ||
7596 | (hw->mac.type == ixgbe_mac_82599EB)))) | ||
7597 | hw->mac.ops.disable_tx_laser(hw); | ||
7598 | |||
7599 | setup_timer(&adapter->service_timer, &ixgbe_service_timer, | 7582 | setup_timer(&adapter->service_timer, &ixgbe_service_timer, |
7600 | (unsigned long) adapter); | 7583 | (unsigned long) adapter); |
7601 | 7584 | ||
@@ -7693,6 +7676,13 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
7693 | if (err) | 7676 | if (err) |
7694 | goto err_register; | 7677 | goto err_register; |
7695 | 7678 | ||
7679 | /* power down the optics for multispeed fiber and 82599 SFP+ fiber */ | ||
7680 | if (hw->mac.ops.disable_tx_laser && | ||
7681 | ((hw->phy.multispeed_fiber) || | ||
7682 | ((hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) && | ||
7683 | (hw->mac.type == ixgbe_mac_82599EB)))) | ||
7684 | hw->mac.ops.disable_tx_laser(hw); | ||
7685 | |||
7696 | /* carrier off reporting is important to ethtool even BEFORE open */ | 7686 | /* carrier off reporting is important to ethtool even BEFORE open */ |
7697 | netif_carrier_off(netdev); | 7687 | netif_carrier_off(netdev); |
7698 | 7688 | ||
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h index 5a7e1eb33599..4a5d8897faab 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h | |||
@@ -42,10 +42,12 @@ int ixgbe_ndo_set_vf_spoofchk(struct net_device *netdev, int vf, bool setting); | |||
42 | int ixgbe_ndo_get_vf_config(struct net_device *netdev, | 42 | int ixgbe_ndo_get_vf_config(struct net_device *netdev, |
43 | int vf, struct ifla_vf_info *ivi); | 43 | int vf, struct ifla_vf_info *ivi); |
44 | void ixgbe_check_vf_rate_limit(struct ixgbe_adapter *adapter); | 44 | void ixgbe_check_vf_rate_limit(struct ixgbe_adapter *adapter); |
45 | #ifdef CONFIG_PCI_IOV | ||
45 | void ixgbe_disable_sriov(struct ixgbe_adapter *adapter); | 46 | void ixgbe_disable_sriov(struct ixgbe_adapter *adapter); |
46 | void ixgbe_enable_sriov(struct ixgbe_adapter *adapter, | 47 | void ixgbe_enable_sriov(struct ixgbe_adapter *adapter, |
47 | const struct ixgbe_info *ii); | 48 | const struct ixgbe_info *ii); |
48 | int ixgbe_check_vf_assignment(struct ixgbe_adapter *adapter); | 49 | int ixgbe_check_vf_assignment(struct ixgbe_adapter *adapter); |
50 | #endif | ||
49 | 51 | ||
50 | 52 | ||
51 | #endif /* _IXGBE_SRIOV_H_ */ | 53 | #endif /* _IXGBE_SRIOV_H_ */ |
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index 5e92cc2079bd..4c8e19951d57 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | |||
@@ -54,7 +54,7 @@ char ixgbevf_driver_name[] = "ixgbevf"; | |||
54 | static const char ixgbevf_driver_string[] = | 54 | static const char ixgbevf_driver_string[] = |
55 | "Intel(R) 10 Gigabit PCI Express Virtual Function Network Driver"; | 55 | "Intel(R) 10 Gigabit PCI Express Virtual Function Network Driver"; |
56 | 56 | ||
57 | #define DRV_VERSION "2.1.0-k" | 57 | #define DRV_VERSION "2.2.0-k" |
58 | const char ixgbevf_driver_version[] = DRV_VERSION; | 58 | const char ixgbevf_driver_version[] = DRV_VERSION; |
59 | static char ixgbevf_copyright[] = | 59 | static char ixgbevf_copyright[] = |
60 | "Copyright (c) 2009 - 2010 Intel Corporation."; | 60 | "Copyright (c) 2009 - 2010 Intel Corporation."; |
diff --git a/drivers/net/ethernet/realtek/Kconfig b/drivers/net/ethernet/realtek/Kconfig index 84083ec6e612..0578859a3c73 100644 --- a/drivers/net/ethernet/realtek/Kconfig +++ b/drivers/net/ethernet/realtek/Kconfig | |||
@@ -115,16 +115,4 @@ config R8169 | |||
115 | To compile this driver as a module, choose M here: the module | 115 | To compile this driver as a module, choose M here: the module |
116 | will be called r8169. This is recommended. | 116 | will be called r8169. This is recommended. |
117 | 117 | ||
118 | config SC92031 | ||
119 | tristate "Silan SC92031 PCI Fast Ethernet Adapter driver (EXPERIMENTAL)" | ||
120 | depends on PCI && EXPERIMENTAL | ||
121 | select CRC32 | ||
122 | ---help--- | ||
123 | This is a driver for the Fast Ethernet PCI network cards based on | ||
124 | the Silan SC92031 chip (sometimes also called Rsltek 8139D). If you | ||
125 | have one of these, say Y here. | ||
126 | |||
127 | To compile this driver as a module, choose M here: the module | ||
128 | will be called sc92031. This is recommended. | ||
129 | |||
130 | endif # NET_VENDOR_REALTEK | 118 | endif # NET_VENDOR_REALTEK |
diff --git a/drivers/net/ethernet/realtek/Makefile b/drivers/net/ethernet/realtek/Makefile index e48cfb6ac42d..71b1da30ecb5 100644 --- a/drivers/net/ethernet/realtek/Makefile +++ b/drivers/net/ethernet/realtek/Makefile | |||
@@ -6,4 +6,3 @@ obj-$(CONFIG_8139CP) += 8139cp.o | |||
6 | obj-$(CONFIG_8139TOO) += 8139too.o | 6 | obj-$(CONFIG_8139TOO) += 8139too.o |
7 | obj-$(CONFIG_ATP) += atp.o | 7 | obj-$(CONFIG_ATP) += atp.o |
8 | obj-$(CONFIG_R8169) += r8169.o | 8 | obj-$(CONFIG_R8169) += r8169.o |
9 | obj-$(CONFIG_SC92031) += sc92031.o | ||
diff --git a/drivers/net/ethernet/silan/Kconfig b/drivers/net/ethernet/silan/Kconfig new file mode 100644 index 000000000000..ae1ce170864d --- /dev/null +++ b/drivers/net/ethernet/silan/Kconfig | |||
@@ -0,0 +1,33 @@ | |||
1 | # | ||
2 | # Silan device configuration | ||
3 | # | ||
4 | |||
5 | config NET_VENDOR_SILAN | ||
6 | bool "Silan devices" | ||
7 | default y | ||
8 | depends on PCI && EXPERIMENTAL | ||
9 | ---help--- | ||
10 | If you have a network (Ethernet) card belonging to this class, say Y | ||
11 | and read the Ethernet-HOWTO, available from | ||
12 | <http://www.tldp.org/docs.html#howto>. | ||
13 | |||
14 | Note that the answer to this question doesn't directly affect the | ||
15 | kernel: saying N will just cause the configurator to skip all | ||
16 | the questions about Silan devices. If you say Y, you will be asked for | ||
17 | your specific card in the following questions. | ||
18 | |||
19 | if NET_VENDOR_SILAN | ||
20 | |||
21 | config SC92031 | ||
22 | tristate "Silan SC92031 PCI Fast Ethernet Adapter driver (EXPERIMENTAL)" | ||
23 | depends on PCI && EXPERIMENTAL | ||
24 | select CRC32 | ||
25 | ---help--- | ||
26 | This is a driver for the Fast Ethernet PCI network cards based on | ||
27 | the Silan SC92031 chip (sometimes also called Rsltek 8139D). If you | ||
28 | have one of these, say Y here. | ||
29 | |||
30 | To compile this driver as a module, choose M here: the module | ||
31 | will be called sc92031. This is recommended. | ||
32 | |||
33 | endif # NET_VENDOR_SILAN | ||
diff --git a/drivers/net/ethernet/silan/Makefile b/drivers/net/ethernet/silan/Makefile new file mode 100644 index 000000000000..4ad3523dcb92 --- /dev/null +++ b/drivers/net/ethernet/silan/Makefile | |||
@@ -0,0 +1,5 @@ | |||
1 | # | ||
2 | # Makefile for the Silan network device drivers. | ||
3 | # | ||
4 | |||
5 | obj-$(CONFIG_SC92031) += sc92031.o | ||
diff --git a/drivers/net/ethernet/realtek/sc92031.c b/drivers/net/ethernet/silan/sc92031.c index a284d6440538..a284d6440538 100644 --- a/drivers/net/ethernet/realtek/sc92031.c +++ b/drivers/net/ethernet/silan/sc92031.c | |||
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c index 4d1658e78dee..caf3659e173c 100644 --- a/drivers/net/ethernet/xilinx/ll_temac_main.c +++ b/drivers/net/ethernet/xilinx/ll_temac_main.c | |||
@@ -716,8 +716,8 @@ static int temac_start_xmit(struct sk_buff *skb, struct net_device *ndev) | |||
716 | cur_p = &lp->tx_bd_v[lp->tx_bd_tail]; | 716 | cur_p = &lp->tx_bd_v[lp->tx_bd_tail]; |
717 | cur_p->phys = dma_map_single(ndev->dev.parent, | 717 | cur_p->phys = dma_map_single(ndev->dev.parent, |
718 | skb_frag_address(frag), | 718 | skb_frag_address(frag), |
719 | frag_size(frag), DMA_TO_DEVICE); | 719 | skb_frag_size(frag), DMA_TO_DEVICE); |
720 | cur_p->len = frag_size(frag); | 720 | cur_p->len = skb_frag_size(frag); |
721 | cur_p->app0 = 0; | 721 | cur_p->app0 = 0; |
722 | frag++; | 722 | frag++; |
723 | } | 723 | } |
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild index f9930c87fff3..c3b45480ecf7 100644 --- a/include/linux/netfilter_ipv4/Kbuild +++ b/include/linux/netfilter_ipv4/Kbuild | |||
@@ -12,3 +12,4 @@ header-y += ipt_ah.h | |||
12 | header-y += ipt_ecn.h | 12 | header-y += ipt_ecn.h |
13 | header-y += ipt_realm.h | 13 | header-y += ipt_realm.h |
14 | header-y += ipt_ttl.h | 14 | header-y += ipt_ttl.h |
15 | 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 index 000000000000..7a861d09fc86 --- /dev/null +++ b/include/linux/netfilter_ipv4/nf_nat.h | |||
@@ -0,0 +1,58 @@ | |||
1 | #ifndef _LINUX_NF_NAT_H | ||
2 | #define _LINUX_NF_NAT_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | #define IP_NAT_RANGE_MAP_IPS 1 | ||
7 | #define IP_NAT_RANGE_PROTO_SPECIFIED 2 | ||
8 | #define IP_NAT_RANGE_PROTO_RANDOM 4 | ||
9 | #define IP_NAT_RANGE_PERSISTENT 8 | ||
10 | |||
11 | /* The protocol-specific manipulable parts of the tuple. */ | ||
12 | union nf_conntrack_man_proto { | ||
13 | /* Add other protocols here. */ | ||
14 | __be16 all; | ||
15 | |||
16 | struct { | ||
17 | __be16 port; | ||
18 | } tcp; | ||
19 | struct { | ||
20 | __be16 port; | ||
21 | } udp; | ||
22 | struct { | ||
23 | __be16 id; | ||
24 | } icmp; | ||
25 | struct { | ||
26 | __be16 port; | ||
27 | } dccp; | ||
28 | struct { | ||
29 | __be16 port; | ||
30 | } sctp; | ||
31 | struct { | ||
32 | __be16 key; /* GRE key is 32bit, PPtP only uses 16bit */ | ||
33 | } gre; | ||
34 | }; | ||
35 | |||
36 | /* Single range specification. */ | ||
37 | struct nf_nat_range { | ||
38 | /* Set to OR of flags above. */ | ||
39 | unsigned int flags; | ||
40 | |||
41 | /* Inclusive: network order. */ | ||
42 | __be32 min_ip, max_ip; | ||
43 | |||
44 | /* Inclusive: network order */ | ||
45 | union nf_conntrack_man_proto min, max; | ||
46 | }; | ||
47 | |||
48 | /* For backwards compat: don't use in modern code. */ | ||
49 | struct nf_nat_multi_range_compat { | ||
50 | unsigned int rangesize; /* Must be 1. */ | ||
51 | |||
52 | /* hangs off end. */ | ||
53 | struct nf_nat_range range[1]; | ||
54 | }; | ||
55 | |||
56 | #define nf_nat_multi_range nf_nat_multi_range_compat | ||
57 | |||
58 | #endif | ||
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 6a6b352326d7..fe864885c1ed 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -1806,12 +1806,12 @@ static inline void skb_frag_set_page(struct sk_buff *skb, int f, | |||
1806 | 1806 | ||
1807 | /** | 1807 | /** |
1808 | * skb_frag_dma_map - maps a paged fragment via the DMA API | 1808 | * skb_frag_dma_map - maps a paged fragment via the DMA API |
1809 | * @device: the device to map the fragment to | 1809 | * @dev: the device to map the fragment to |
1810 | * @frag: the paged fragment to map | 1810 | * @frag: the paged fragment to map |
1811 | * @offset: the offset within the fragment (starting at the | 1811 | * @offset: the offset within the fragment (starting at the |
1812 | * fragment's own offset) | 1812 | * fragment's own offset) |
1813 | * @size: the number of bytes to map | 1813 | * @size: the number of bytes to map |
1814 | * @direction: the direction of the mapping (%PCI_DMA_*) | 1814 | * @dir: the direction of the mapping (%PCI_DMA_*) |
1815 | * | 1815 | * |
1816 | * Maps the page associated with @frag to @device. | 1816 | * Maps the page associated with @frag to @device. |
1817 | */ | 1817 | */ |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 8fa4430f99c1..05b08c926ade 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -425,9 +425,9 @@ struct ip_vs_protocol { | |||
425 | 425 | ||
426 | const char *(*state_name)(int state); | 426 | const char *(*state_name)(int state); |
427 | 427 | ||
428 | int (*state_transition)(struct ip_vs_conn *cp, int direction, | 428 | void (*state_transition)(struct ip_vs_conn *cp, int direction, |
429 | const struct sk_buff *skb, | 429 | const struct sk_buff *skb, |
430 | struct ip_vs_proto_data *pd); | 430 | struct ip_vs_proto_data *pd); |
431 | 431 | ||
432 | int (*register_app)(struct net *net, struct ip_vs_app *inc); | 432 | int (*register_app)(struct net *net, struct ip_vs_app *inc); |
433 | 433 | ||
@@ -1378,7 +1378,7 @@ static inline int ip_vs_conntrack_enabled(struct netns_ipvs *ipvs) | |||
1378 | 1378 | ||
1379 | extern void ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp, | 1379 | extern void ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp, |
1380 | int outin); | 1380 | int outin); |
1381 | extern int ip_vs_confirm_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp); | 1381 | extern int ip_vs_confirm_conntrack(struct sk_buff *skb); |
1382 | extern void ip_vs_nfct_expect_related(struct sk_buff *skb, struct nf_conn *ct, | 1382 | extern void ip_vs_nfct_expect_related(struct sk_buff *skb, struct nf_conn *ct, |
1383 | struct ip_vs_conn *cp, u_int8_t proto, | 1383 | struct ip_vs_conn *cp, u_int8_t proto, |
1384 | const __be16 port, int from_rs); | 1384 | const __be16 port, int from_rs); |
@@ -1396,8 +1396,7 @@ static inline void ip_vs_update_conntrack(struct sk_buff *skb, | |||
1396 | { | 1396 | { |
1397 | } | 1397 | } |
1398 | 1398 | ||
1399 | static inline int ip_vs_confirm_conntrack(struct sk_buff *skb, | 1399 | static inline int ip_vs_confirm_conntrack(struct sk_buff *skb) |
1400 | struct ip_vs_conn *cp) | ||
1401 | { | 1400 | { |
1402 | return NF_ACCEPT; | 1401 | return NF_ACCEPT; |
1403 | } | 1402 | } |
diff --git a/include/net/netfilter/nf_conntrack_tuple.h b/include/net/netfilter/nf_conntrack_tuple.h index 7ca6bdd5bae6..2f8fb77bfdd1 100644 --- a/include/net/netfilter/nf_conntrack_tuple.h +++ b/include/net/netfilter/nf_conntrack_tuple.h | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #include <linux/netfilter/x_tables.h> | 13 | #include <linux/netfilter/x_tables.h> |
14 | #include <linux/netfilter/nf_conntrack_tuple_common.h> | 14 | #include <linux/netfilter/nf_conntrack_tuple_common.h> |
15 | #include <linux/netfilter_ipv4/nf_nat.h> | ||
15 | #include <linux/list_nulls.h> | 16 | #include <linux/list_nulls.h> |
16 | 17 | ||
17 | /* A `tuple' is a structure containing the information to uniquely | 18 | /* A `tuple' is a structure containing the information to uniquely |
@@ -24,32 +25,6 @@ | |||
24 | 25 | ||
25 | #define NF_CT_TUPLE_L3SIZE ARRAY_SIZE(((union nf_inet_addr *)NULL)->all) | 26 | #define NF_CT_TUPLE_L3SIZE ARRAY_SIZE(((union nf_inet_addr *)NULL)->all) |
26 | 27 | ||
27 | /* The protocol-specific manipulable parts of the tuple: always in | ||
28 | network order! */ | ||
29 | union nf_conntrack_man_proto { | ||
30 | /* Add other protocols here. */ | ||
31 | __be16 all; | ||
32 | |||
33 | struct { | ||
34 | __be16 port; | ||
35 | } tcp; | ||
36 | struct { | ||
37 | __be16 port; | ||
38 | } udp; | ||
39 | struct { | ||
40 | __be16 id; | ||
41 | } icmp; | ||
42 | struct { | ||
43 | __be16 port; | ||
44 | } dccp; | ||
45 | struct { | ||
46 | __be16 port; | ||
47 | } sctp; | ||
48 | struct { | ||
49 | __be16 key; /* GRE key is 32bit, PPtP only uses 16bit */ | ||
50 | } gre; | ||
51 | }; | ||
52 | |||
53 | /* The manipulable part of the tuple. */ | 28 | /* The manipulable part of the tuple. */ |
54 | struct nf_conntrack_man { | 29 | struct nf_conntrack_man { |
55 | union nf_inet_addr u3; | 30 | union nf_inet_addr u3; |
diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h index 0346b0070864..b8872df7285f 100644 --- a/include/net/netfilter/nf_nat.h +++ b/include/net/netfilter/nf_nat.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _NF_NAT_H | 1 | #ifndef _NF_NAT_H |
2 | #define _NF_NAT_H | 2 | #define _NF_NAT_H |
3 | #include <linux/netfilter_ipv4.h> | 3 | #include <linux/netfilter_ipv4.h> |
4 | #include <linux/netfilter_ipv4/nf_nat.h> | ||
4 | #include <net/netfilter/nf_conntrack_tuple.h> | 5 | #include <net/netfilter/nf_conntrack_tuple.h> |
5 | 6 | ||
6 | #define NF_NAT_MAPPING_TYPE_MAX_NAMELEN 16 | 7 | #define NF_NAT_MAPPING_TYPE_MAX_NAMELEN 16 |
@@ -14,11 +15,6 @@ enum nf_nat_manip_type { | |||
14 | #define HOOK2MANIP(hooknum) ((hooknum) != NF_INET_POST_ROUTING && \ | 15 | #define HOOK2MANIP(hooknum) ((hooknum) != NF_INET_POST_ROUTING && \ |
15 | (hooknum) != NF_INET_LOCAL_IN) | 16 | (hooknum) != NF_INET_LOCAL_IN) |
16 | 17 | ||
17 | #define IP_NAT_RANGE_MAP_IPS 1 | ||
18 | #define IP_NAT_RANGE_PROTO_SPECIFIED 2 | ||
19 | #define IP_NAT_RANGE_PROTO_RANDOM 4 | ||
20 | #define IP_NAT_RANGE_PERSISTENT 8 | ||
21 | |||
22 | /* NAT sequence number modifications */ | 18 | /* NAT sequence number modifications */ |
23 | struct nf_nat_seq { | 19 | struct nf_nat_seq { |
24 | /* position of the last TCP sequence number modification (if any) */ | 20 | /* position of the last TCP sequence number modification (if any) */ |
@@ -28,26 +24,6 @@ struct nf_nat_seq { | |||
28 | int16_t offset_before, offset_after; | 24 | int16_t offset_before, offset_after; |
29 | }; | 25 | }; |
30 | 26 | ||
31 | /* Single range specification. */ | ||
32 | struct nf_nat_range { | ||
33 | /* Set to OR of flags above. */ | ||
34 | unsigned int flags; | ||
35 | |||
36 | /* Inclusive: network order. */ | ||
37 | __be32 min_ip, max_ip; | ||
38 | |||
39 | /* Inclusive: network order */ | ||
40 | union nf_conntrack_man_proto min, max; | ||
41 | }; | ||
42 | |||
43 | /* For backwards compat: don't use in modern code. */ | ||
44 | struct nf_nat_multi_range_compat { | ||
45 | unsigned int rangesize; /* Must be 1. */ | ||
46 | |||
47 | /* hangs off end. */ | ||
48 | struct nf_nat_range range[1]; | ||
49 | }; | ||
50 | |||
51 | #include <linux/list.h> | 27 | #include <linux/list.h> |
52 | #include <linux/netfilter/nf_conntrack_pptp.h> | 28 | #include <linux/netfilter/nf_conntrack_pptp.h> |
53 | #include <net/netfilter/nf_conntrack_extend.h> | 29 | #include <net/netfilter/nf_conntrack_extend.h> |
diff --git a/include/net/tcp.h b/include/net/tcp.h index e147f42d643d..bb18c4d69aba 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -1403,11 +1403,13 @@ enum tcp_seq_states { | |||
1403 | TCP_SEQ_STATE_TIME_WAIT, | 1403 | TCP_SEQ_STATE_TIME_WAIT, |
1404 | }; | 1404 | }; |
1405 | 1405 | ||
1406 | int tcp_seq_open(struct inode *inode, struct file *file); | ||
1407 | |||
1406 | struct tcp_seq_afinfo { | 1408 | struct tcp_seq_afinfo { |
1407 | char *name; | 1409 | char *name; |
1408 | sa_family_t family; | 1410 | sa_family_t family; |
1409 | struct file_operations seq_fops; | 1411 | const struct file_operations *seq_fops; |
1410 | struct seq_operations seq_ops; | 1412 | struct seq_operations seq_ops; |
1411 | }; | 1413 | }; |
1412 | 1414 | ||
1413 | struct tcp_iter_state { | 1415 | struct tcp_iter_state { |
diff --git a/include/net/udp.h b/include/net/udp.h index 67ea6fcb3ec0..3b285f402f48 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
@@ -230,12 +230,14 @@ extern struct sock *udp6_lib_lookup(struct net *net, const struct in6_addr *sadd | |||
230 | #endif | 230 | #endif |
231 | 231 | ||
232 | /* /proc */ | 232 | /* /proc */ |
233 | int udp_seq_open(struct inode *inode, struct file *file); | ||
234 | |||
233 | struct udp_seq_afinfo { | 235 | struct udp_seq_afinfo { |
234 | char *name; | 236 | char *name; |
235 | sa_family_t family; | 237 | sa_family_t family; |
236 | struct udp_table *udp_table; | 238 | struct udp_table *udp_table; |
237 | struct file_operations seq_fops; | 239 | const struct file_operations *seq_fops; |
238 | struct seq_operations seq_ops; | 240 | struct seq_operations seq_ops; |
239 | }; | 241 | }; |
240 | 242 | ||
241 | struct udp_iter_state { | 243 | struct udp_iter_state { |
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index c8cf9391417e..bc2528624583 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
@@ -470,10 +470,12 @@ static void vlan_dev_change_rx_flags(struct net_device *dev, int change) | |||
470 | { | 470 | { |
471 | struct net_device *real_dev = vlan_dev_info(dev)->real_dev; | 471 | struct net_device *real_dev = vlan_dev_info(dev)->real_dev; |
472 | 472 | ||
473 | if (change & IFF_ALLMULTI) | 473 | if (dev->flags & IFF_UP) { |
474 | dev_set_allmulti(real_dev, dev->flags & IFF_ALLMULTI ? 1 : -1); | 474 | if (change & IFF_ALLMULTI) |
475 | if (change & IFF_PROMISC) | 475 | dev_set_allmulti(real_dev, dev->flags & IFF_ALLMULTI ? 1 : -1); |
476 | dev_set_promiscuity(real_dev, dev->flags & IFF_PROMISC ? 1 : -1); | 476 | if (change & IFF_PROMISC) |
477 | dev_set_promiscuity(real_dev, dev->flags & IFF_PROMISC ? 1 : -1); | ||
478 | } | ||
477 | } | 479 | } |
478 | 480 | ||
479 | static void vlan_dev_set_rx_mode(struct net_device *vlan_dev) | 481 | static void vlan_dev_set_rx_mode(struct net_device *vlan_dev) |
diff --git a/net/bridge/netfilter/ebt_ulog.c b/net/bridge/netfilter/ebt_ulog.c index bf2a333ca7c7..5449294bdd5e 100644 --- a/net/bridge/netfilter/ebt_ulog.c +++ b/net/bridge/netfilter/ebt_ulog.c | |||
@@ -102,16 +102,15 @@ static struct sk_buff *ulog_alloc_skb(unsigned int size) | |||
102 | unsigned int n; | 102 | unsigned int n; |
103 | 103 | ||
104 | n = max(size, nlbufsiz); | 104 | n = max(size, nlbufsiz); |
105 | skb = alloc_skb(n, GFP_ATOMIC); | 105 | skb = alloc_skb(n, GFP_ATOMIC | __GFP_NOWARN); |
106 | if (!skb) { | 106 | if (!skb) { |
107 | pr_debug("cannot alloc whole buffer of size %ub!\n", n); | ||
108 | if (n > size) { | 107 | if (n > size) { |
109 | /* try to allocate only as much as we need for | 108 | /* try to allocate only as much as we need for |
110 | * current packet */ | 109 | * current packet */ |
111 | skb = alloc_skb(size, GFP_ATOMIC); | 110 | skb = alloc_skb(size, GFP_ATOMIC); |
112 | if (!skb) | 111 | if (!skb) |
113 | pr_debug("cannot even allocate " | 112 | pr_debug("cannot even allocate buffer of size %ub\n", |
114 | "buffer of size %ub\n", size); | 113 | size); |
115 | } | 114 | } |
116 | } | 115 | } |
117 | 116 | ||
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 909ecb3c2a33..039d51e6c284 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -872,12 +872,8 @@ static void neigh_timer_handler(unsigned long arg) | |||
872 | now = jiffies; | 872 | now = jiffies; |
873 | next = now + HZ; | 873 | next = now + HZ; |
874 | 874 | ||
875 | if (!(state & NUD_IN_TIMER)) { | 875 | if (!(state & NUD_IN_TIMER)) |
876 | #ifndef CONFIG_SMP | ||
877 | printk(KERN_WARNING "neigh: timer & !nud_in_timer\n"); | ||
878 | #endif | ||
879 | goto out; | 876 | goto out; |
880 | } | ||
881 | 877 | ||
882 | if (state & NUD_REACHABLE) { | 878 | if (state & NUD_REACHABLE) { |
883 | if (time_before_eq(now, | 879 | if (time_before_eq(now, |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index ca4db40e75b8..18a3cebb753d 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -189,6 +189,7 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask, | |||
189 | * aligned memory blocks, unless SLUB/SLAB debug is enabled. | 189 | * aligned memory blocks, unless SLUB/SLAB debug is enabled. |
190 | * Both skb->head and skb_shared_info are cache line aligned. | 190 | * Both skb->head and skb_shared_info are cache line aligned. |
191 | */ | 191 | */ |
192 | size = SKB_DATA_ALIGN(size); | ||
192 | size += SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); | 193 | size += SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); |
193 | data = kmalloc_node_track_caller(size, gfp_mask, node); | 194 | data = kmalloc_node_track_caller(size, gfp_mask, node); |
194 | if (!data) | 195 | if (!data) |
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index 332639b56f4d..90a919afbed7 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
@@ -433,6 +433,7 @@ exit: | |||
433 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS); | 433 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS); |
434 | return NULL; | 434 | return NULL; |
435 | put_and_exit: | 435 | put_and_exit: |
436 | bh_unlock_sock(newsk); | ||
436 | sock_put(newsk); | 437 | sock_put(newsk); |
437 | goto exit; | 438 | goto exit; |
438 | } | 439 | } |
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c index db8d22db425f..a639967eb727 100644 --- a/net/ipv4/netfilter/ipt_CLUSTERIP.c +++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c | |||
@@ -395,7 +395,6 @@ static int clusterip_tg_check(const struct xt_tgchk_param *par) | |||
395 | config = clusterip_config_init(cipinfo, | 395 | config = clusterip_config_init(cipinfo, |
396 | e->ip.dst.s_addr, dev); | 396 | e->ip.dst.s_addr, dev); |
397 | if (!config) { | 397 | if (!config) { |
398 | pr_info("cannot allocate config\n"); | ||
399 | dev_put(dev); | 398 | dev_put(dev); |
400 | return -ENOMEM; | 399 | return -ENOMEM; |
401 | } | 400 | } |
diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c index 446e0f467a17..b5508151e547 100644 --- a/net/ipv4/netfilter/ipt_ULOG.c +++ b/net/ipv4/netfilter/ipt_ULOG.c | |||
@@ -135,10 +135,8 @@ static struct sk_buff *ulog_alloc_skb(unsigned int size) | |||
135 | * due to slab allocator restrictions */ | 135 | * due to slab allocator restrictions */ |
136 | 136 | ||
137 | n = max(size, nlbufsiz); | 137 | n = max(size, nlbufsiz); |
138 | skb = alloc_skb(n, GFP_ATOMIC); | 138 | skb = alloc_skb(n, GFP_ATOMIC | __GFP_NOWARN); |
139 | if (!skb) { | 139 | if (!skb) { |
140 | pr_debug("cannot alloc whole buffer %ub!\n", n); | ||
141 | |||
142 | if (n > size) { | 140 | if (n > size) { |
143 | /* try to allocate only as much as we need for | 141 | /* try to allocate only as much as we need for |
144 | * current packet */ | 142 | * current packet */ |
diff --git a/net/ipv4/netfilter/nf_nat_snmp_basic.c b/net/ipv4/netfilter/nf_nat_snmp_basic.c index d1cb412c18e0..2133c30a4a5f 100644 --- a/net/ipv4/netfilter/nf_nat_snmp_basic.c +++ b/net/ipv4/netfilter/nf_nat_snmp_basic.c | |||
@@ -400,11 +400,8 @@ static unsigned char asn1_octets_decode(struct asn1_ctx *ctx, | |||
400 | *len = 0; | 400 | *len = 0; |
401 | 401 | ||
402 | *octets = kmalloc(eoc - ctx->pointer, GFP_ATOMIC); | 402 | *octets = kmalloc(eoc - ctx->pointer, GFP_ATOMIC); |
403 | if (*octets == NULL) { | 403 | if (*octets == NULL) |
404 | if (net_ratelimit()) | ||
405 | pr_notice("OOM in bsalg (%d)\n", __LINE__); | ||
406 | return 0; | 404 | return 0; |
407 | } | ||
408 | 405 | ||
409 | ptr = *octets; | 406 | ptr = *octets; |
410 | while (ctx->pointer < eoc) { | 407 | while (ctx->pointer < eoc) { |
@@ -451,11 +448,8 @@ static unsigned char asn1_oid_decode(struct asn1_ctx *ctx, | |||
451 | return 0; | 448 | return 0; |
452 | 449 | ||
453 | *oid = kmalloc(size * sizeof(unsigned long), GFP_ATOMIC); | 450 | *oid = kmalloc(size * sizeof(unsigned long), GFP_ATOMIC); |
454 | if (*oid == NULL) { | 451 | if (*oid == NULL) |
455 | if (net_ratelimit()) | ||
456 | pr_notice("OOM in bsalg (%d)\n", __LINE__); | ||
457 | return 0; | 452 | return 0; |
458 | } | ||
459 | 453 | ||
460 | optr = *oid; | 454 | optr = *oid; |
461 | 455 | ||
@@ -728,8 +722,6 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx, | |||
728 | *obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC); | 722 | *obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC); |
729 | if (*obj == NULL) { | 723 | if (*obj == NULL) { |
730 | kfree(id); | 724 | kfree(id); |
731 | if (net_ratelimit()) | ||
732 | pr_notice("OOM in bsalg (%d)\n", __LINE__); | ||
733 | return 0; | 725 | return 0; |
734 | } | 726 | } |
735 | (*obj)->syntax.l[0] = l; | 727 | (*obj)->syntax.l[0] = l; |
@@ -744,8 +736,6 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx, | |||
744 | if (*obj == NULL) { | 736 | if (*obj == NULL) { |
745 | kfree(p); | 737 | kfree(p); |
746 | kfree(id); | 738 | kfree(id); |
747 | if (net_ratelimit()) | ||
748 | pr_notice("OOM in bsalg (%d)\n", __LINE__); | ||
749 | return 0; | 739 | return 0; |
750 | } | 740 | } |
751 | memcpy((*obj)->syntax.c, p, len); | 741 | memcpy((*obj)->syntax.c, p, len); |
@@ -759,8 +749,6 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx, | |||
759 | *obj = kmalloc(sizeof(struct snmp_object), GFP_ATOMIC); | 749 | *obj = kmalloc(sizeof(struct snmp_object), GFP_ATOMIC); |
760 | if (*obj == NULL) { | 750 | if (*obj == NULL) { |
761 | kfree(id); | 751 | kfree(id); |
762 | if (net_ratelimit()) | ||
763 | pr_notice("OOM in bsalg (%d)\n", __LINE__); | ||
764 | return 0; | 752 | return 0; |
765 | } | 753 | } |
766 | if (!asn1_null_decode(ctx, end)) { | 754 | if (!asn1_null_decode(ctx, end)) { |
@@ -780,8 +768,6 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx, | |||
780 | if (*obj == NULL) { | 768 | if (*obj == NULL) { |
781 | kfree(lp); | 769 | kfree(lp); |
782 | kfree(id); | 770 | kfree(id); |
783 | if (net_ratelimit()) | ||
784 | pr_notice("OOM in bsalg (%d)\n", __LINE__); | ||
785 | return 0; | 771 | return 0; |
786 | } | 772 | } |
787 | memcpy((*obj)->syntax.ul, lp, len); | 773 | memcpy((*obj)->syntax.ul, lp, len); |
@@ -801,8 +787,6 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx, | |||
801 | if (*obj == NULL) { | 787 | if (*obj == NULL) { |
802 | kfree(p); | 788 | kfree(p); |
803 | kfree(id); | 789 | kfree(id); |
804 | if (net_ratelimit()) | ||
805 | pr_notice("OOM in bsalg (%d)\n", __LINE__); | ||
806 | return 0; | 790 | return 0; |
807 | } | 791 | } |
808 | memcpy((*obj)->syntax.uc, p, len); | 792 | memcpy((*obj)->syntax.uc, p, len); |
@@ -819,8 +803,6 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx, | |||
819 | *obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC); | 803 | *obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC); |
820 | if (*obj == NULL) { | 804 | if (*obj == NULL) { |
821 | kfree(id); | 805 | kfree(id); |
822 | if (net_ratelimit()) | ||
823 | pr_notice("OOM in bsalg (%d)\n", __LINE__); | ||
824 | return 0; | 806 | return 0; |
825 | } | 807 | } |
826 | (*obj)->syntax.ul[0] = ul; | 808 | (*obj)->syntax.ul[0] = ul; |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 0ea10eefa60f..a7443159c400 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -1510,6 +1510,7 @@ exit: | |||
1510 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS); | 1510 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS); |
1511 | return NULL; | 1511 | return NULL; |
1512 | put_and_exit: | 1512 | put_and_exit: |
1513 | bh_unlock_sock(newsk); | ||
1513 | sock_put(newsk); | 1514 | sock_put(newsk); |
1514 | goto exit; | 1515 | goto exit; |
1515 | } | 1516 | } |
@@ -2339,7 +2340,7 @@ static void tcp_seq_stop(struct seq_file *seq, void *v) | |||
2339 | } | 2340 | } |
2340 | } | 2341 | } |
2341 | 2342 | ||
2342 | static int tcp_seq_open(struct inode *inode, struct file *file) | 2343 | int tcp_seq_open(struct inode *inode, struct file *file) |
2343 | { | 2344 | { |
2344 | struct tcp_seq_afinfo *afinfo = PDE(inode)->data; | 2345 | struct tcp_seq_afinfo *afinfo = PDE(inode)->data; |
2345 | struct tcp_iter_state *s; | 2346 | struct tcp_iter_state *s; |
@@ -2355,23 +2356,19 @@ static int tcp_seq_open(struct inode *inode, struct file *file) | |||
2355 | s->last_pos = 0; | 2356 | s->last_pos = 0; |
2356 | return 0; | 2357 | return 0; |
2357 | } | 2358 | } |
2359 | EXPORT_SYMBOL(tcp_seq_open); | ||
2358 | 2360 | ||
2359 | int tcp_proc_register(struct net *net, struct tcp_seq_afinfo *afinfo) | 2361 | int tcp_proc_register(struct net *net, struct tcp_seq_afinfo *afinfo) |
2360 | { | 2362 | { |
2361 | int rc = 0; | 2363 | int rc = 0; |
2362 | struct proc_dir_entry *p; | 2364 | struct proc_dir_entry *p; |
2363 | 2365 | ||
2364 | afinfo->seq_fops.open = tcp_seq_open; | ||
2365 | afinfo->seq_fops.read = seq_read; | ||
2366 | afinfo->seq_fops.llseek = seq_lseek; | ||
2367 | afinfo->seq_fops.release = seq_release_net; | ||
2368 | |||
2369 | afinfo->seq_ops.start = tcp_seq_start; | 2366 | afinfo->seq_ops.start = tcp_seq_start; |
2370 | afinfo->seq_ops.next = tcp_seq_next; | 2367 | afinfo->seq_ops.next = tcp_seq_next; |
2371 | afinfo->seq_ops.stop = tcp_seq_stop; | 2368 | afinfo->seq_ops.stop = tcp_seq_stop; |
2372 | 2369 | ||
2373 | p = proc_create_data(afinfo->name, S_IRUGO, net->proc_net, | 2370 | p = proc_create_data(afinfo->name, S_IRUGO, net->proc_net, |
2374 | &afinfo->seq_fops, afinfo); | 2371 | afinfo->seq_fops, afinfo); |
2375 | if (!p) | 2372 | if (!p) |
2376 | rc = -ENOMEM; | 2373 | rc = -ENOMEM; |
2377 | return rc; | 2374 | return rc; |
@@ -2520,12 +2517,18 @@ out: | |||
2520 | return 0; | 2517 | return 0; |
2521 | } | 2518 | } |
2522 | 2519 | ||
2520 | static const struct file_operations tcp_afinfo_seq_fops = { | ||
2521 | .owner = THIS_MODULE, | ||
2522 | .open = tcp_seq_open, | ||
2523 | .read = seq_read, | ||
2524 | .llseek = seq_lseek, | ||
2525 | .release = seq_release_net | ||
2526 | }; | ||
2527 | |||
2523 | static struct tcp_seq_afinfo tcp4_seq_afinfo = { | 2528 | static struct tcp_seq_afinfo tcp4_seq_afinfo = { |
2524 | .name = "tcp", | 2529 | .name = "tcp", |
2525 | .family = AF_INET, | 2530 | .family = AF_INET, |
2526 | .seq_fops = { | 2531 | .seq_fops = &tcp_afinfo_seq_fops, |
2527 | .owner = THIS_MODULE, | ||
2528 | }, | ||
2529 | .seq_ops = { | 2532 | .seq_ops = { |
2530 | .show = tcp4_seq_show, | 2533 | .show = tcp4_seq_show, |
2531 | }, | 2534 | }, |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index ebaa96bd3464..ab0966df1e2a 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -1397,6 +1397,8 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) | |||
1397 | nf_reset(skb); | 1397 | nf_reset(skb); |
1398 | 1398 | ||
1399 | if (up->encap_type) { | 1399 | if (up->encap_type) { |
1400 | int (*encap_rcv)(struct sock *sk, struct sk_buff *skb); | ||
1401 | |||
1400 | /* | 1402 | /* |
1401 | * This is an encapsulation socket so pass the skb to | 1403 | * This is an encapsulation socket so pass the skb to |
1402 | * the socket's udp_encap_rcv() hook. Otherwise, just | 1404 | * 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) | |||
1409 | */ | 1411 | */ |
1410 | 1412 | ||
1411 | /* if we're overly short, let UDP handle it */ | 1413 | /* if we're overly short, let UDP handle it */ |
1412 | if (skb->len > sizeof(struct udphdr) && | 1414 | encap_rcv = ACCESS_ONCE(up->encap_rcv); |
1413 | up->encap_rcv != NULL) { | 1415 | if (skb->len > sizeof(struct udphdr) && encap_rcv != NULL) { |
1414 | int ret; | 1416 | int ret; |
1415 | 1417 | ||
1416 | ret = (*up->encap_rcv)(sk, skb); | 1418 | ret = encap_rcv(sk, skb); |
1417 | if (ret <= 0) { | 1419 | if (ret <= 0) { |
1418 | UDP_INC_STATS_BH(sock_net(sk), | 1420 | UDP_INC_STATS_BH(sock_net(sk), |
1419 | UDP_MIB_INDATAGRAMS, | 1421 | UDP_MIB_INDATAGRAMS, |
@@ -2037,7 +2039,7 @@ static void udp_seq_stop(struct seq_file *seq, void *v) | |||
2037 | spin_unlock_bh(&state->udp_table->hash[state->bucket].lock); | 2039 | spin_unlock_bh(&state->udp_table->hash[state->bucket].lock); |
2038 | } | 2040 | } |
2039 | 2041 | ||
2040 | static int udp_seq_open(struct inode *inode, struct file *file) | 2042 | int udp_seq_open(struct inode *inode, struct file *file) |
2041 | { | 2043 | { |
2042 | struct udp_seq_afinfo *afinfo = PDE(inode)->data; | 2044 | struct udp_seq_afinfo *afinfo = PDE(inode)->data; |
2043 | struct udp_iter_state *s; | 2045 | struct udp_iter_state *s; |
@@ -2053,6 +2055,7 @@ static int udp_seq_open(struct inode *inode, struct file *file) | |||
2053 | s->udp_table = afinfo->udp_table; | 2055 | s->udp_table = afinfo->udp_table; |
2054 | return err; | 2056 | return err; |
2055 | } | 2057 | } |
2058 | EXPORT_SYMBOL(udp_seq_open); | ||
2056 | 2059 | ||
2057 | /* ------------------------------------------------------------------------ */ | 2060 | /* ------------------------------------------------------------------------ */ |
2058 | int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo) | 2061 | 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) | |||
2060 | struct proc_dir_entry *p; | 2063 | struct proc_dir_entry *p; |
2061 | int rc = 0; | 2064 | int rc = 0; |
2062 | 2065 | ||
2063 | afinfo->seq_fops.open = udp_seq_open; | ||
2064 | afinfo->seq_fops.read = seq_read; | ||
2065 | afinfo->seq_fops.llseek = seq_lseek; | ||
2066 | afinfo->seq_fops.release = seq_release_net; | ||
2067 | |||
2068 | afinfo->seq_ops.start = udp_seq_start; | 2066 | afinfo->seq_ops.start = udp_seq_start; |
2069 | afinfo->seq_ops.next = udp_seq_next; | 2067 | afinfo->seq_ops.next = udp_seq_next; |
2070 | afinfo->seq_ops.stop = udp_seq_stop; | 2068 | afinfo->seq_ops.stop = udp_seq_stop; |
2071 | 2069 | ||
2072 | p = proc_create_data(afinfo->name, S_IRUGO, net->proc_net, | 2070 | p = proc_create_data(afinfo->name, S_IRUGO, net->proc_net, |
2073 | &afinfo->seq_fops, afinfo); | 2071 | afinfo->seq_fops, afinfo); |
2074 | if (!p) | 2072 | if (!p) |
2075 | rc = -ENOMEM; | 2073 | rc = -ENOMEM; |
2076 | return rc; | 2074 | return rc; |
@@ -2120,14 +2118,20 @@ int udp4_seq_show(struct seq_file *seq, void *v) | |||
2120 | return 0; | 2118 | return 0; |
2121 | } | 2119 | } |
2122 | 2120 | ||
2121 | static const struct file_operations udp_afinfo_seq_fops = { | ||
2122 | .owner = THIS_MODULE, | ||
2123 | .open = udp_seq_open, | ||
2124 | .read = seq_read, | ||
2125 | .llseek = seq_lseek, | ||
2126 | .release = seq_release_net | ||
2127 | }; | ||
2128 | |||
2123 | /* ------------------------------------------------------------------------ */ | 2129 | /* ------------------------------------------------------------------------ */ |
2124 | static struct udp_seq_afinfo udp4_seq_afinfo = { | 2130 | static struct udp_seq_afinfo udp4_seq_afinfo = { |
2125 | .name = "udp", | 2131 | .name = "udp", |
2126 | .family = AF_INET, | 2132 | .family = AF_INET, |
2127 | .udp_table = &udp_table, | 2133 | .udp_table = &udp_table, |
2128 | .seq_fops = { | 2134 | .seq_fops = &udp_afinfo_seq_fops, |
2129 | .owner = THIS_MODULE, | ||
2130 | }, | ||
2131 | .seq_ops = { | 2135 | .seq_ops = { |
2132 | .show = udp4_seq_show, | 2136 | .show = udp4_seq_show, |
2133 | }, | 2137 | }, |
diff --git a/net/ipv4/udplite.c b/net/ipv4/udplite.c index aee9963f7f5a..08383eb54208 100644 --- a/net/ipv4/udplite.c +++ b/net/ipv4/udplite.c | |||
@@ -71,13 +71,20 @@ static struct inet_protosw udplite4_protosw = { | |||
71 | }; | 71 | }; |
72 | 72 | ||
73 | #ifdef CONFIG_PROC_FS | 73 | #ifdef CONFIG_PROC_FS |
74 | |||
75 | static const struct file_operations udplite_afinfo_seq_fops = { | ||
76 | .owner = THIS_MODULE, | ||
77 | .open = udp_seq_open, | ||
78 | .read = seq_read, | ||
79 | .llseek = seq_lseek, | ||
80 | .release = seq_release_net | ||
81 | }; | ||
82 | |||
74 | static struct udp_seq_afinfo udplite4_seq_afinfo = { | 83 | static struct udp_seq_afinfo udplite4_seq_afinfo = { |
75 | .name = "udplite", | 84 | .name = "udplite", |
76 | .family = AF_INET, | 85 | .family = AF_INET, |
77 | .udp_table = &udplite_table, | 86 | .udp_table = &udplite_table, |
78 | .seq_fops = { | 87 | .seq_fops = &udplite_afinfo_seq_fops, |
79 | .owner = THIS_MODULE, | ||
80 | }, | ||
81 | .seq_ops = { | 88 | .seq_ops = { |
82 | .show = udp4_seq_show, | 89 | .show = udp4_seq_show, |
83 | }, | 90 | }, |
diff --git a/net/ipv6/netfilter.c b/net/ipv6/netfilter.c index 30fcee465448..8992cf6651d4 100644 --- a/net/ipv6/netfilter.c +++ b/net/ipv6/netfilter.c | |||
@@ -100,9 +100,16 @@ static int nf_ip6_route(struct net *net, struct dst_entry **dst, | |||
100 | .pinet6 = (struct ipv6_pinfo *) &fake_pinfo, | 100 | .pinet6 = (struct ipv6_pinfo *) &fake_pinfo, |
101 | }; | 101 | }; |
102 | const void *sk = strict ? &fake_sk : NULL; | 102 | const void *sk = strict ? &fake_sk : NULL; |
103 | 103 | struct dst_entry *result; | |
104 | *dst = ip6_route_output(net, sk, &fl->u.ip6); | 104 | int err; |
105 | return (*dst)->error; | 105 | |
106 | result = ip6_route_output(net, sk, &fl->u.ip6); | ||
107 | err = result->error; | ||
108 | if (err) | ||
109 | dst_release(result); | ||
110 | else | ||
111 | *dst = result; | ||
112 | return err; | ||
106 | } | 113 | } |
107 | 114 | ||
108 | __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, | 115 | __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, |
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c index e8762c73b170..38f00b0298d3 100644 --- a/net/ipv6/netfilter/nf_conntrack_reasm.c +++ b/net/ipv6/netfilter/nf_conntrack_reasm.c | |||
@@ -182,7 +182,6 @@ fq_find(__be32 id, u32 user, struct in6_addr *src, struct in6_addr *dst) | |||
182 | return container_of(q, struct nf_ct_frag6_queue, q); | 182 | return container_of(q, struct nf_ct_frag6_queue, q); |
183 | 183 | ||
184 | oom: | 184 | oom: |
185 | pr_debug("Can't alloc new queue\n"); | ||
186 | return NULL; | 185 | return NULL; |
187 | } | 186 | } |
188 | 187 | ||
@@ -370,10 +369,10 @@ nf_ct_frag6_reasm(struct nf_ct_frag6_queue *fq, struct net_device *dev) | |||
370 | struct sk_buff *clone; | 369 | struct sk_buff *clone; |
371 | int i, plen = 0; | 370 | int i, plen = 0; |
372 | 371 | ||
373 | if ((clone = alloc_skb(0, GFP_ATOMIC)) == NULL) { | 372 | clone = alloc_skb(0, GFP_ATOMIC); |
374 | pr_debug("Can't alloc skb\n"); | 373 | if (clone == NULL) |
375 | goto out_oom; | 374 | goto out_oom; |
376 | } | 375 | |
377 | clone->next = head->next; | 376 | clone->next = head->next; |
378 | head->next = clone; | 377 | head->next = clone; |
379 | skb_shinfo(clone)->frag_list = skb_shinfo(head)->frag_list; | 378 | skb_shinfo(clone)->frag_list = skb_shinfo(head)->frag_list; |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 10b2b3165a1a..36131d122a6f 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -2161,12 +2161,18 @@ out: | |||
2161 | return 0; | 2161 | return 0; |
2162 | } | 2162 | } |
2163 | 2163 | ||
2164 | static const struct file_operations tcp6_afinfo_seq_fops = { | ||
2165 | .owner = THIS_MODULE, | ||
2166 | .open = tcp_seq_open, | ||
2167 | .read = seq_read, | ||
2168 | .llseek = seq_lseek, | ||
2169 | .release = seq_release_net | ||
2170 | }; | ||
2171 | |||
2164 | static struct tcp_seq_afinfo tcp6_seq_afinfo = { | 2172 | static struct tcp_seq_afinfo tcp6_seq_afinfo = { |
2165 | .name = "tcp6", | 2173 | .name = "tcp6", |
2166 | .family = AF_INET6, | 2174 | .family = AF_INET6, |
2167 | .seq_fops = { | 2175 | .seq_fops = &tcp6_afinfo_seq_fops, |
2168 | .owner = THIS_MODULE, | ||
2169 | }, | ||
2170 | .seq_ops = { | 2176 | .seq_ops = { |
2171 | .show = tcp6_seq_show, | 2177 | .show = tcp6_seq_show, |
2172 | }, | 2178 | }, |
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index f4ca0a5b3457..846f4757eb8d 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -1424,13 +1424,19 @@ int udp6_seq_show(struct seq_file *seq, void *v) | |||
1424 | return 0; | 1424 | return 0; |
1425 | } | 1425 | } |
1426 | 1426 | ||
1427 | static const struct file_operations udp6_afinfo_seq_fops = { | ||
1428 | .owner = THIS_MODULE, | ||
1429 | .open = udp_seq_open, | ||
1430 | .read = seq_read, | ||
1431 | .llseek = seq_lseek, | ||
1432 | .release = seq_release_net | ||
1433 | }; | ||
1434 | |||
1427 | static struct udp_seq_afinfo udp6_seq_afinfo = { | 1435 | static struct udp_seq_afinfo udp6_seq_afinfo = { |
1428 | .name = "udp6", | 1436 | .name = "udp6", |
1429 | .family = AF_INET6, | 1437 | .family = AF_INET6, |
1430 | .udp_table = &udp_table, | 1438 | .udp_table = &udp_table, |
1431 | .seq_fops = { | 1439 | .seq_fops = &udp6_afinfo_seq_fops, |
1432 | .owner = THIS_MODULE, | ||
1433 | }, | ||
1434 | .seq_ops = { | 1440 | .seq_ops = { |
1435 | .show = udp6_seq_show, | 1441 | .show = udp6_seq_show, |
1436 | }, | 1442 | }, |
diff --git a/net/ipv6/udplite.c b/net/ipv6/udplite.c index 986c4de5292e..8889aa22ed47 100644 --- a/net/ipv6/udplite.c +++ b/net/ipv6/udplite.c | |||
@@ -93,13 +93,20 @@ void udplitev6_exit(void) | |||
93 | } | 93 | } |
94 | 94 | ||
95 | #ifdef CONFIG_PROC_FS | 95 | #ifdef CONFIG_PROC_FS |
96 | |||
97 | static const struct file_operations udplite6_afinfo_seq_fops = { | ||
98 | .owner = THIS_MODULE, | ||
99 | .open = udp_seq_open, | ||
100 | .read = seq_read, | ||
101 | .llseek = seq_lseek, | ||
102 | .release = seq_release_net | ||
103 | }; | ||
104 | |||
96 | static struct udp_seq_afinfo udplite6_seq_afinfo = { | 105 | static struct udp_seq_afinfo udplite6_seq_afinfo = { |
97 | .name = "udplite6", | 106 | .name = "udplite6", |
98 | .family = AF_INET6, | 107 | .family = AF_INET6, |
99 | .udp_table = &udplite_table, | 108 | .udp_table = &udplite_table, |
100 | .seq_fops = { | 109 | .seq_fops = &udplite6_afinfo_seq_fops, |
101 | .owner = THIS_MODULE, | ||
102 | }, | ||
103 | .seq_ops = { | 110 | .seq_ops = { |
104 | .show = udp6_seq_show, | 111 | .show = udp6_seq_show, |
105 | }, | 112 | }, |
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c index 34b2ddeacb67..bf8d50c67931 100644 --- a/net/l2tp/l2tp_core.c +++ b/net/l2tp/l2tp_core.c | |||
@@ -397,6 +397,7 @@ static void l2tp_recv_dequeue(struct l2tp_session *session) | |||
397 | * expect to send up next, dequeue it and any other | 397 | * expect to send up next, dequeue it and any other |
398 | * in-sequence packets behind it. | 398 | * in-sequence packets behind it. |
399 | */ | 399 | */ |
400 | start: | ||
400 | spin_lock_bh(&session->reorder_q.lock); | 401 | spin_lock_bh(&session->reorder_q.lock); |
401 | skb_queue_walk_safe(&session->reorder_q, skb, tmp) { | 402 | skb_queue_walk_safe(&session->reorder_q, skb, tmp) { |
402 | if (time_after(jiffies, L2TP_SKB_CB(skb)->expires)) { | 403 | if (time_after(jiffies, L2TP_SKB_CB(skb)->expires)) { |
@@ -433,7 +434,7 @@ static void l2tp_recv_dequeue(struct l2tp_session *session) | |||
433 | */ | 434 | */ |
434 | spin_unlock_bh(&session->reorder_q.lock); | 435 | spin_unlock_bh(&session->reorder_q.lock); |
435 | l2tp_recv_dequeue_skb(session, skb); | 436 | l2tp_recv_dequeue_skb(session, skb); |
436 | spin_lock_bh(&session->reorder_q.lock); | 437 | goto start; |
437 | } | 438 | } |
438 | 439 | ||
439 | out: | 440 | out: |
diff --git a/net/netfilter/core.c b/net/netfilter/core.c index 3346829ea07f..afca6c78948c 100644 --- a/net/netfilter/core.c +++ b/net/netfilter/core.c | |||
@@ -180,17 +180,16 @@ next_hook: | |||
180 | if (ret == 0) | 180 | if (ret == 0) |
181 | ret = -EPERM; | 181 | ret = -EPERM; |
182 | } else if ((verdict & NF_VERDICT_MASK) == NF_QUEUE) { | 182 | } else if ((verdict & NF_VERDICT_MASK) == NF_QUEUE) { |
183 | ret = nf_queue(skb, elem, pf, hook, indev, outdev, okfn, | 183 | int err = nf_queue(skb, elem, pf, hook, indev, outdev, okfn, |
184 | verdict >> NF_VERDICT_QBITS); | 184 | verdict >> NF_VERDICT_QBITS); |
185 | if (ret < 0) { | 185 | if (err < 0) { |
186 | if (ret == -ECANCELED) | 186 | if (err == -ECANCELED) |
187 | goto next_hook; | 187 | goto next_hook; |
188 | if (ret == -ESRCH && | 188 | if (err == -ESRCH && |
189 | (verdict & NF_VERDICT_FLAG_QUEUE_BYPASS)) | 189 | (verdict & NF_VERDICT_FLAG_QUEUE_BYPASS)) |
190 | goto next_hook; | 190 | goto next_hook; |
191 | kfree_skb(skb); | 191 | kfree_skb(skb); |
192 | } | 192 | } |
193 | ret = 0; | ||
194 | } | 193 | } |
195 | rcu_read_unlock(); | 194 | rcu_read_unlock(); |
196 | return ret; | 195 | return ret; |
diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c index d7e86ef9d23a..86137b558f45 100644 --- a/net/netfilter/ipset/ip_set_core.c +++ b/net/netfilter/ipset/ip_set_core.c | |||
@@ -1699,10 +1699,8 @@ ip_set_init(void) | |||
1699 | 1699 | ||
1700 | ip_set_list = kzalloc(sizeof(struct ip_set *) * ip_set_max, | 1700 | ip_set_list = kzalloc(sizeof(struct ip_set *) * ip_set_max, |
1701 | GFP_KERNEL); | 1701 | GFP_KERNEL); |
1702 | if (!ip_set_list) { | 1702 | if (!ip_set_list) |
1703 | pr_err("ip_set: Unable to create ip_set_list\n"); | ||
1704 | return -ENOMEM; | 1703 | return -ENOMEM; |
1705 | } | ||
1706 | 1704 | ||
1707 | ret = nfnetlink_subsys_register(&ip_set_netlink_subsys); | 1705 | ret = nfnetlink_subsys_register(&ip_set_netlink_subsys); |
1708 | if (ret != 0) { | 1706 | if (ret != 0) { |
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c index 4f77bb16d22a..093cc327020f 100644 --- a/net/netfilter/ipvs/ip_vs_core.c +++ b/net/netfilter/ipvs/ip_vs_core.c | |||
@@ -188,14 +188,13 @@ ip_vs_conn_stats(struct ip_vs_conn *cp, struct ip_vs_service *svc) | |||
188 | } | 188 | } |
189 | 189 | ||
190 | 190 | ||
191 | static inline int | 191 | static inline void |
192 | ip_vs_set_state(struct ip_vs_conn *cp, int direction, | 192 | ip_vs_set_state(struct ip_vs_conn *cp, int direction, |
193 | const struct sk_buff *skb, | 193 | const struct sk_buff *skb, |
194 | struct ip_vs_proto_data *pd) | 194 | struct ip_vs_proto_data *pd) |
195 | { | 195 | { |
196 | if (unlikely(!pd->pp->state_transition)) | 196 | if (likely(pd->pp->state_transition)) |
197 | return 0; | 197 | pd->pp->state_transition(cp, direction, skb, pd); |
198 | return pd->pp->state_transition(cp, direction, skb, pd); | ||
199 | } | 198 | } |
200 | 199 | ||
201 | static inline int | 200 | static inline int |
@@ -530,7 +529,7 @@ int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, | |||
530 | a cache_bypass connection entry */ | 529 | a cache_bypass connection entry */ |
531 | ipvs = net_ipvs(net); | 530 | ipvs = net_ipvs(net); |
532 | if (ipvs->sysctl_cache_bypass && svc->fwmark && unicast) { | 531 | if (ipvs->sysctl_cache_bypass && svc->fwmark && unicast) { |
533 | int ret, cs; | 532 | int ret; |
534 | struct ip_vs_conn *cp; | 533 | struct ip_vs_conn *cp; |
535 | unsigned int flags = (svc->flags & IP_VS_SVC_F_ONEPACKET && | 534 | unsigned int flags = (svc->flags & IP_VS_SVC_F_ONEPACKET && |
536 | iph.protocol == IPPROTO_UDP)? | 535 | iph.protocol == IPPROTO_UDP)? |
@@ -557,7 +556,7 @@ int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, | |||
557 | ip_vs_in_stats(cp, skb); | 556 | ip_vs_in_stats(cp, skb); |
558 | 557 | ||
559 | /* set state */ | 558 | /* set state */ |
560 | cs = ip_vs_set_state(cp, IP_VS_DIR_INPUT, skb, pd); | 559 | ip_vs_set_state(cp, IP_VS_DIR_INPUT, skb, pd); |
561 | 560 | ||
562 | /* transmit the first SYN packet */ | 561 | /* transmit the first SYN packet */ |
563 | ret = cp->packet_xmit(skb, cp, pd->pp); | 562 | ret = cp->packet_xmit(skb, cp, pd->pp); |
@@ -1490,7 +1489,7 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af) | |||
1490 | struct ip_vs_protocol *pp; | 1489 | struct ip_vs_protocol *pp; |
1491 | struct ip_vs_proto_data *pd; | 1490 | struct ip_vs_proto_data *pd; |
1492 | struct ip_vs_conn *cp; | 1491 | struct ip_vs_conn *cp; |
1493 | int ret, restart, pkts; | 1492 | int ret, pkts; |
1494 | struct netns_ipvs *ipvs; | 1493 | struct netns_ipvs *ipvs; |
1495 | 1494 | ||
1496 | /* Already marked as IPVS request or reply? */ | 1495 | /* Already marked as IPVS request or reply? */ |
@@ -1591,7 +1590,7 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af) | |||
1591 | } | 1590 | } |
1592 | 1591 | ||
1593 | ip_vs_in_stats(cp, skb); | 1592 | ip_vs_in_stats(cp, skb); |
1594 | restart = ip_vs_set_state(cp, IP_VS_DIR_INPUT, skb, pd); | 1593 | ip_vs_set_state(cp, IP_VS_DIR_INPUT, skb, pd); |
1595 | if (cp->packet_xmit) | 1594 | if (cp->packet_xmit) |
1596 | ret = cp->packet_xmit(skb, cp, pp); | 1595 | ret = cp->packet_xmit(skb, cp, pp); |
1597 | /* do not touch skb anymore */ | 1596 | /* do not touch skb anymore */ |
@@ -1878,10 +1877,9 @@ static int __net_init __ip_vs_init(struct net *net) | |||
1878 | struct netns_ipvs *ipvs; | 1877 | struct netns_ipvs *ipvs; |
1879 | 1878 | ||
1880 | ipvs = net_generic(net, ip_vs_net_id); | 1879 | ipvs = net_generic(net, ip_vs_net_id); |
1881 | if (ipvs == NULL) { | 1880 | if (ipvs == NULL) |
1882 | pr_err("%s(): no memory.\n", __func__); | ||
1883 | return -ENOMEM; | 1881 | return -ENOMEM; |
1884 | } | 1882 | |
1885 | /* Hold the beast until a service is registerd */ | 1883 | /* Hold the beast until a service is registerd */ |
1886 | ipvs->enable = 0; | 1884 | ipvs->enable = 0; |
1887 | ipvs->net = net; | 1885 | ipvs->net = net; |
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index e3be48bf4dcd..008bf97cc91a 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c | |||
@@ -856,15 +856,12 @@ ip_vs_new_dest(struct ip_vs_service *svc, struct ip_vs_dest_user_kern *udest, | |||
856 | } | 856 | } |
857 | 857 | ||
858 | dest = kzalloc(sizeof(struct ip_vs_dest), GFP_KERNEL); | 858 | dest = kzalloc(sizeof(struct ip_vs_dest), GFP_KERNEL); |
859 | if (dest == NULL) { | 859 | if (dest == NULL) |
860 | pr_err("%s(): no memory.\n", __func__); | ||
861 | return -ENOMEM; | 860 | return -ENOMEM; |
862 | } | 861 | |
863 | dest->stats.cpustats = alloc_percpu(struct ip_vs_cpu_stats); | 862 | dest->stats.cpustats = alloc_percpu(struct ip_vs_cpu_stats); |
864 | if (!dest->stats.cpustats) { | 863 | if (!dest->stats.cpustats) |
865 | pr_err("%s() alloc_percpu failed\n", __func__); | ||
866 | goto err_alloc; | 864 | goto err_alloc; |
867 | } | ||
868 | 865 | ||
869 | dest->af = svc->af; | 866 | dest->af = svc->af; |
870 | dest->protocol = svc->protocol; | 867 | dest->protocol = svc->protocol; |
@@ -1168,10 +1165,8 @@ ip_vs_add_service(struct net *net, struct ip_vs_service_user_kern *u, | |||
1168 | goto out_err; | 1165 | goto out_err; |
1169 | } | 1166 | } |
1170 | svc->stats.cpustats = alloc_percpu(struct ip_vs_cpu_stats); | 1167 | svc->stats.cpustats = alloc_percpu(struct ip_vs_cpu_stats); |
1171 | if (!svc->stats.cpustats) { | 1168 | if (!svc->stats.cpustats) |
1172 | pr_err("%s() alloc_percpu failed\n", __func__); | ||
1173 | goto out_err; | 1169 | goto out_err; |
1174 | } | ||
1175 | 1170 | ||
1176 | /* I'm the first user of the service */ | 1171 | /* I'm the first user of the service */ |
1177 | atomic_set(&svc->usecnt, 0); | 1172 | atomic_set(&svc->usecnt, 0); |
@@ -3326,10 +3321,8 @@ static int ip_vs_genl_set_cmd(struct sk_buff *skb, struct genl_info *info) | |||
3326 | int ret = 0, cmd; | 3321 | int ret = 0, cmd; |
3327 | int need_full_svc = 0, need_full_dest = 0; | 3322 | int need_full_svc = 0, need_full_dest = 0; |
3328 | struct net *net; | 3323 | struct net *net; |
3329 | struct netns_ipvs *ipvs; | ||
3330 | 3324 | ||
3331 | net = skb_sknet(skb); | 3325 | net = skb_sknet(skb); |
3332 | ipvs = net_ipvs(net); | ||
3333 | cmd = info->genlhdr->cmd; | 3326 | cmd = info->genlhdr->cmd; |
3334 | 3327 | ||
3335 | mutex_lock(&__ip_vs_mutex); | 3328 | mutex_lock(&__ip_vs_mutex); |
@@ -3421,10 +3414,8 @@ static int ip_vs_genl_get_cmd(struct sk_buff *skb, struct genl_info *info) | |||
3421 | void *reply; | 3414 | void *reply; |
3422 | int ret, cmd, reply_cmd; | 3415 | int ret, cmd, reply_cmd; |
3423 | struct net *net; | 3416 | struct net *net; |
3424 | struct netns_ipvs *ipvs; | ||
3425 | 3417 | ||
3426 | net = skb_sknet(skb); | 3418 | net = skb_sknet(skb); |
3427 | ipvs = net_ipvs(net); | ||
3428 | cmd = info->genlhdr->cmd; | 3419 | cmd = info->genlhdr->cmd; |
3429 | 3420 | ||
3430 | if (cmd == IPVS_CMD_GET_SERVICE) | 3421 | if (cmd == IPVS_CMD_GET_SERVICE) |
@@ -3720,10 +3711,9 @@ int __net_init ip_vs_control_net_init(struct net *net) | |||
3720 | 3711 | ||
3721 | /* procfs stats */ | 3712 | /* procfs stats */ |
3722 | ipvs->tot_stats.cpustats = alloc_percpu(struct ip_vs_cpu_stats); | 3713 | ipvs->tot_stats.cpustats = alloc_percpu(struct ip_vs_cpu_stats); |
3723 | if (!ipvs->tot_stats.cpustats) { | 3714 | if (!ipvs->tot_stats.cpustats) |
3724 | pr_err("%s(): alloc_percpu.\n", __func__); | ||
3725 | return -ENOMEM; | 3715 | return -ENOMEM; |
3726 | } | 3716 | |
3727 | spin_lock_init(&ipvs->tot_stats.lock); | 3717 | spin_lock_init(&ipvs->tot_stats.lock); |
3728 | 3718 | ||
3729 | proc_net_fops_create(net, "ip_vs", 0, &ip_vs_info_fops); | 3719 | proc_net_fops_create(net, "ip_vs", 0, &ip_vs_info_fops); |
diff --git a/net/netfilter/ipvs/ip_vs_dh.c b/net/netfilter/ipvs/ip_vs_dh.c index 95fd0d14200b..1c269e56200a 100644 --- a/net/netfilter/ipvs/ip_vs_dh.c +++ b/net/netfilter/ipvs/ip_vs_dh.c | |||
@@ -150,10 +150,9 @@ static int ip_vs_dh_init_svc(struct ip_vs_service *svc) | |||
150 | /* allocate the DH table for this service */ | 150 | /* allocate the DH table for this service */ |
151 | tbl = kmalloc(sizeof(struct ip_vs_dh_bucket)*IP_VS_DH_TAB_SIZE, | 151 | tbl = kmalloc(sizeof(struct ip_vs_dh_bucket)*IP_VS_DH_TAB_SIZE, |
152 | GFP_ATOMIC); | 152 | GFP_ATOMIC); |
153 | if (tbl == NULL) { | 153 | if (tbl == NULL) |
154 | pr_err("%s(): no memory\n", __func__); | ||
155 | return -ENOMEM; | 154 | return -ENOMEM; |
156 | } | 155 | |
157 | svc->sched_data = tbl; | 156 | svc->sched_data = tbl; |
158 | IP_VS_DBG(6, "DH hash table (memory=%Zdbytes) allocated for " | 157 | IP_VS_DBG(6, "DH hash table (memory=%Zdbytes) allocated for " |
159 | "current service\n", | 158 | "current service\n", |
diff --git a/net/netfilter/ipvs/ip_vs_ftp.c b/net/netfilter/ipvs/ip_vs_ftp.c index 4490a32ad5b2..538d74ee4f68 100644 --- a/net/netfilter/ipvs/ip_vs_ftp.c +++ b/net/netfilter/ipvs/ip_vs_ftp.c | |||
@@ -52,8 +52,9 @@ | |||
52 | * List of ports (up to IP_VS_APP_MAX_PORTS) to be handled by helper | 52 | * List of ports (up to IP_VS_APP_MAX_PORTS) to be handled by helper |
53 | * First port is set to the default port. | 53 | * First port is set to the default port. |
54 | */ | 54 | */ |
55 | static unsigned int ports_count = 1; | ||
55 | static unsigned short ports[IP_VS_APP_MAX_PORTS] = {21, 0}; | 56 | static unsigned short ports[IP_VS_APP_MAX_PORTS] = {21, 0}; |
56 | module_param_array(ports, ushort, NULL, 0); | 57 | module_param_array(ports, ushort, &ports_count, 0444); |
57 | MODULE_PARM_DESC(ports, "Ports to monitor for FTP control commands"); | 58 | MODULE_PARM_DESC(ports, "Ports to monitor for FTP control commands"); |
58 | 59 | ||
59 | 60 | ||
@@ -449,7 +450,7 @@ static int __net_init __ip_vs_ftp_init(struct net *net) | |||
449 | if (ret) | 450 | if (ret) |
450 | goto err_exit; | 451 | goto err_exit; |
451 | 452 | ||
452 | for (i=0; i<IP_VS_APP_MAX_PORTS; i++) { | 453 | for (i = 0; i < ports_count; i++) { |
453 | if (!ports[i]) | 454 | if (!ports[i]) |
454 | continue; | 455 | continue; |
455 | ret = register_ip_vs_app_inc(net, app, app->protocol, ports[i]); | 456 | ret = register_ip_vs_app_inc(net, app, app->protocol, ports[i]); |
diff --git a/net/netfilter/ipvs/ip_vs_lblc.c b/net/netfilter/ipvs/ip_vs_lblc.c index 87e40ea77a95..0f16283fd058 100644 --- a/net/netfilter/ipvs/ip_vs_lblc.c +++ b/net/netfilter/ipvs/ip_vs_lblc.c | |||
@@ -202,10 +202,8 @@ ip_vs_lblc_new(struct ip_vs_lblc_table *tbl, const union nf_inet_addr *daddr, | |||
202 | en = ip_vs_lblc_get(dest->af, tbl, daddr); | 202 | en = ip_vs_lblc_get(dest->af, tbl, daddr); |
203 | if (!en) { | 203 | if (!en) { |
204 | en = kmalloc(sizeof(*en), GFP_ATOMIC); | 204 | en = kmalloc(sizeof(*en), GFP_ATOMIC); |
205 | if (!en) { | 205 | if (!en) |
206 | pr_err("%s(): no memory\n", __func__); | ||
207 | return NULL; | 206 | return NULL; |
208 | } | ||
209 | 207 | ||
210 | en->af = dest->af; | 208 | en->af = dest->af; |
211 | ip_vs_addr_copy(dest->af, &en->addr, daddr); | 209 | 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) | |||
345 | * Allocate the ip_vs_lblc_table for this service | 343 | * Allocate the ip_vs_lblc_table for this service |
346 | */ | 344 | */ |
347 | tbl = kmalloc(sizeof(*tbl), GFP_ATOMIC); | 345 | tbl = kmalloc(sizeof(*tbl), GFP_ATOMIC); |
348 | if (tbl == NULL) { | 346 | if (tbl == NULL) |
349 | pr_err("%s(): no memory\n", __func__); | ||
350 | return -ENOMEM; | 347 | return -ENOMEM; |
351 | } | 348 | |
352 | svc->sched_data = tbl; | 349 | svc->sched_data = tbl; |
353 | IP_VS_DBG(6, "LBLC hash table (memory=%Zdbytes) allocated for " | 350 | IP_VS_DBG(6, "LBLC hash table (memory=%Zdbytes) allocated for " |
354 | "current service\n", sizeof(*tbl)); | 351 | "current service\n", sizeof(*tbl)); |
diff --git a/net/netfilter/ipvs/ip_vs_lblcr.c b/net/netfilter/ipvs/ip_vs_lblcr.c index 90f618ab6dda..eec797f8cce7 100644 --- a/net/netfilter/ipvs/ip_vs_lblcr.c +++ b/net/netfilter/ipvs/ip_vs_lblcr.c | |||
@@ -112,10 +112,8 @@ ip_vs_dest_set_insert(struct ip_vs_dest_set *set, struct ip_vs_dest *dest) | |||
112 | } | 112 | } |
113 | 113 | ||
114 | e = kmalloc(sizeof(*e), GFP_ATOMIC); | 114 | e = kmalloc(sizeof(*e), GFP_ATOMIC); |
115 | if (e == NULL) { | 115 | if (e == NULL) |
116 | pr_err("%s(): no memory\n", __func__); | ||
117 | return NULL; | 116 | return NULL; |
118 | } | ||
119 | 117 | ||
120 | atomic_inc(&dest->refcnt); | 118 | atomic_inc(&dest->refcnt); |
121 | e->dest = dest; | 119 | e->dest = dest; |
@@ -373,10 +371,8 @@ ip_vs_lblcr_new(struct ip_vs_lblcr_table *tbl, const union nf_inet_addr *daddr, | |||
373 | en = ip_vs_lblcr_get(dest->af, tbl, daddr); | 371 | en = ip_vs_lblcr_get(dest->af, tbl, daddr); |
374 | if (!en) { | 372 | if (!en) { |
375 | en = kmalloc(sizeof(*en), GFP_ATOMIC); | 373 | en = kmalloc(sizeof(*en), GFP_ATOMIC); |
376 | if (!en) { | 374 | if (!en) |
377 | pr_err("%s(): no memory\n", __func__); | ||
378 | return NULL; | 375 | return NULL; |
379 | } | ||
380 | 376 | ||
381 | en->af = dest->af; | 377 | en->af = dest->af; |
382 | ip_vs_addr_copy(dest->af, &en->addr, daddr); | 378 | 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) | |||
516 | * Allocate the ip_vs_lblcr_table for this service | 512 | * Allocate the ip_vs_lblcr_table for this service |
517 | */ | 513 | */ |
518 | tbl = kmalloc(sizeof(*tbl), GFP_ATOMIC); | 514 | tbl = kmalloc(sizeof(*tbl), GFP_ATOMIC); |
519 | if (tbl == NULL) { | 515 | if (tbl == NULL) |
520 | pr_err("%s(): no memory\n", __func__); | ||
521 | return -ENOMEM; | 516 | return -ENOMEM; |
522 | } | 517 | |
523 | svc->sched_data = tbl; | 518 | svc->sched_data = tbl; |
524 | IP_VS_DBG(6, "LBLCR hash table (memory=%Zdbytes) allocated for " | 519 | IP_VS_DBG(6, "LBLCR hash table (memory=%Zdbytes) allocated for " |
525 | "current service\n", sizeof(*tbl)); | 520 | "current service\n", sizeof(*tbl)); |
diff --git a/net/netfilter/ipvs/ip_vs_nfct.c b/net/netfilter/ipvs/ip_vs_nfct.c index f454c80df0a7..022e77e1e766 100644 --- a/net/netfilter/ipvs/ip_vs_nfct.c +++ b/net/netfilter/ipvs/ip_vs_nfct.c | |||
@@ -127,7 +127,7 @@ ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp, int outin) | |||
127 | nf_conntrack_alter_reply(ct, &new_tuple); | 127 | nf_conntrack_alter_reply(ct, &new_tuple); |
128 | } | 128 | } |
129 | 129 | ||
130 | int ip_vs_confirm_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp) | 130 | int ip_vs_confirm_conntrack(struct sk_buff *skb) |
131 | { | 131 | { |
132 | return nf_conntrack_confirm(skb); | 132 | return nf_conntrack_confirm(skb); |
133 | } | 133 | } |
diff --git a/net/netfilter/ipvs/ip_vs_proto.c b/net/netfilter/ipvs/ip_vs_proto.c index 52d073c105e9..85312939695f 100644 --- a/net/netfilter/ipvs/ip_vs_proto.c +++ b/net/netfilter/ipvs/ip_vs_proto.c | |||
@@ -74,10 +74,9 @@ register_ip_vs_proto_netns(struct net *net, struct ip_vs_protocol *pp) | |||
74 | struct ip_vs_proto_data *pd = | 74 | struct ip_vs_proto_data *pd = |
75 | kzalloc(sizeof(struct ip_vs_proto_data), GFP_ATOMIC); | 75 | kzalloc(sizeof(struct ip_vs_proto_data), GFP_ATOMIC); |
76 | 76 | ||
77 | if (!pd) { | 77 | if (!pd) |
78 | pr_err("%s(): no memory.\n", __func__); | ||
79 | return -ENOMEM; | 78 | return -ENOMEM; |
80 | } | 79 | |
81 | pd->pp = pp; /* For speed issues */ | 80 | pd->pp = pp; /* For speed issues */ |
82 | pd->next = ipvs->proto_data_table[hash]; | 81 | pd->next = ipvs->proto_data_table[hash]; |
83 | ipvs->proto_data_table[hash] = pd; | 82 | ipvs->proto_data_table[hash] = pd; |
diff --git a/net/netfilter/ipvs/ip_vs_proto_sctp.c b/net/netfilter/ipvs/ip_vs_proto_sctp.c index d12ed53ec95f..1fbf7a2816f5 100644 --- a/net/netfilter/ipvs/ip_vs_proto_sctp.c +++ b/net/netfilter/ipvs/ip_vs_proto_sctp.c | |||
@@ -906,7 +906,7 @@ static const char *sctp_state_name(int state) | |||
906 | return "?"; | 906 | return "?"; |
907 | } | 907 | } |
908 | 908 | ||
909 | static inline int | 909 | static inline void |
910 | set_sctp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp, | 910 | set_sctp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp, |
911 | int direction, const struct sk_buff *skb) | 911 | int direction, const struct sk_buff *skb) |
912 | { | 912 | { |
@@ -924,7 +924,7 @@ set_sctp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp, | |||
924 | sch = skb_header_pointer(skb, ihl + sizeof(sctp_sctphdr_t), | 924 | sch = skb_header_pointer(skb, ihl + sizeof(sctp_sctphdr_t), |
925 | sizeof(_sctpch), &_sctpch); | 925 | sizeof(_sctpch), &_sctpch); |
926 | if (sch == NULL) | 926 | if (sch == NULL) |
927 | return 0; | 927 | return; |
928 | 928 | ||
929 | chunk_type = sch->type; | 929 | chunk_type = sch->type; |
930 | /* | 930 | /* |
@@ -993,21 +993,15 @@ set_sctp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp, | |||
993 | cp->timeout = pd->timeout_table[cp->state = next_state]; | 993 | cp->timeout = pd->timeout_table[cp->state = next_state]; |
994 | else /* What to do ? */ | 994 | else /* What to do ? */ |
995 | cp->timeout = sctp_timeouts[cp->state = next_state]; | 995 | cp->timeout = sctp_timeouts[cp->state = next_state]; |
996 | |||
997 | return 1; | ||
998 | } | 996 | } |
999 | 997 | ||
1000 | static int | 998 | static void |
1001 | sctp_state_transition(struct ip_vs_conn *cp, int direction, | 999 | sctp_state_transition(struct ip_vs_conn *cp, int direction, |
1002 | const struct sk_buff *skb, struct ip_vs_proto_data *pd) | 1000 | const struct sk_buff *skb, struct ip_vs_proto_data *pd) |
1003 | { | 1001 | { |
1004 | int ret = 0; | ||
1005 | |||
1006 | spin_lock(&cp->lock); | 1002 | spin_lock(&cp->lock); |
1007 | ret = set_sctp_state(pd, cp, direction, skb); | 1003 | set_sctp_state(pd, cp, direction, skb); |
1008 | spin_unlock(&cp->lock); | 1004 | spin_unlock(&cp->lock); |
1009 | |||
1010 | return ret; | ||
1011 | } | 1005 | } |
1012 | 1006 | ||
1013 | static inline __u16 sctp_app_hashkey(__be16 port) | 1007 | static inline __u16 sctp_app_hashkey(__be16 port) |
diff --git a/net/netfilter/ipvs/ip_vs_proto_tcp.c b/net/netfilter/ipvs/ip_vs_proto_tcp.c index c0cc341b840d..ef8641f7af83 100644 --- a/net/netfilter/ipvs/ip_vs_proto_tcp.c +++ b/net/netfilter/ipvs/ip_vs_proto_tcp.c | |||
@@ -546,7 +546,7 @@ set_tcp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp, | |||
546 | /* | 546 | /* |
547 | * Handle state transitions | 547 | * Handle state transitions |
548 | */ | 548 | */ |
549 | static int | 549 | static void |
550 | tcp_state_transition(struct ip_vs_conn *cp, int direction, | 550 | tcp_state_transition(struct ip_vs_conn *cp, int direction, |
551 | const struct sk_buff *skb, | 551 | const struct sk_buff *skb, |
552 | struct ip_vs_proto_data *pd) | 552 | struct ip_vs_proto_data *pd) |
@@ -561,13 +561,11 @@ tcp_state_transition(struct ip_vs_conn *cp, int direction, | |||
561 | 561 | ||
562 | th = skb_header_pointer(skb, ihl, sizeof(_tcph), &_tcph); | 562 | th = skb_header_pointer(skb, ihl, sizeof(_tcph), &_tcph); |
563 | if (th == NULL) | 563 | if (th == NULL) |
564 | return 0; | 564 | return; |
565 | 565 | ||
566 | spin_lock(&cp->lock); | 566 | spin_lock(&cp->lock); |
567 | set_tcp_state(pd, cp, direction, th); | 567 | set_tcp_state(pd, cp, direction, th); |
568 | spin_unlock(&cp->lock); | 568 | spin_unlock(&cp->lock); |
569 | |||
570 | return 1; | ||
571 | } | 569 | } |
572 | 570 | ||
573 | static inline __u16 tcp_app_hashkey(__be16 port) | 571 | static inline __u16 tcp_app_hashkey(__be16 port) |
diff --git a/net/netfilter/ipvs/ip_vs_proto_udp.c b/net/netfilter/ipvs/ip_vs_proto_udp.c index f1282cbe6fe3..f4b7262896bb 100644 --- a/net/netfilter/ipvs/ip_vs_proto_udp.c +++ b/net/netfilter/ipvs/ip_vs_proto_udp.c | |||
@@ -454,18 +454,17 @@ static const char * udp_state_name(int state) | |||
454 | return udp_state_name_table[state] ? udp_state_name_table[state] : "?"; | 454 | return udp_state_name_table[state] ? udp_state_name_table[state] : "?"; |
455 | } | 455 | } |
456 | 456 | ||
457 | static int | 457 | static void |
458 | udp_state_transition(struct ip_vs_conn *cp, int direction, | 458 | udp_state_transition(struct ip_vs_conn *cp, int direction, |
459 | const struct sk_buff *skb, | 459 | const struct sk_buff *skb, |
460 | struct ip_vs_proto_data *pd) | 460 | struct ip_vs_proto_data *pd) |
461 | { | 461 | { |
462 | if (unlikely(!pd)) { | 462 | if (unlikely(!pd)) { |
463 | pr_err("UDP no ns data\n"); | 463 | pr_err("UDP no ns data\n"); |
464 | return 0; | 464 | return; |
465 | } | 465 | } |
466 | 466 | ||
467 | cp->timeout = pd->timeout_table[IP_VS_UDP_S_NORMAL]; | 467 | cp->timeout = pd->timeout_table[IP_VS_UDP_S_NORMAL]; |
468 | return 1; | ||
469 | } | 468 | } |
470 | 469 | ||
471 | static void __udp_init(struct net *net, struct ip_vs_proto_data *pd) | 470 | static void __udp_init(struct net *net, struct ip_vs_proto_data *pd) |
diff --git a/net/netfilter/ipvs/ip_vs_sh.c b/net/netfilter/ipvs/ip_vs_sh.c index b5e2556c581a..33815f4fb451 100644 --- a/net/netfilter/ipvs/ip_vs_sh.c +++ b/net/netfilter/ipvs/ip_vs_sh.c | |||
@@ -147,10 +147,9 @@ static int ip_vs_sh_init_svc(struct ip_vs_service *svc) | |||
147 | /* allocate the SH table for this service */ | 147 | /* allocate the SH table for this service */ |
148 | tbl = kmalloc(sizeof(struct ip_vs_sh_bucket)*IP_VS_SH_TAB_SIZE, | 148 | tbl = kmalloc(sizeof(struct ip_vs_sh_bucket)*IP_VS_SH_TAB_SIZE, |
149 | GFP_ATOMIC); | 149 | GFP_ATOMIC); |
150 | if (tbl == NULL) { | 150 | if (tbl == NULL) |
151 | pr_err("%s(): no memory\n", __func__); | ||
152 | return -ENOMEM; | 151 | return -ENOMEM; |
153 | } | 152 | |
154 | svc->sched_data = tbl; | 153 | svc->sched_data = tbl; |
155 | IP_VS_DBG(6, "SH hash table (memory=%Zdbytes) allocated for " | 154 | IP_VS_DBG(6, "SH hash table (memory=%Zdbytes) allocated for " |
156 | "current service\n", | 155 | "current service\n", |
diff --git a/net/netfilter/ipvs/ip_vs_wrr.c b/net/netfilter/ipvs/ip_vs_wrr.c index 1ef41f50723c..fd0d4e09876a 100644 --- a/net/netfilter/ipvs/ip_vs_wrr.c +++ b/net/netfilter/ipvs/ip_vs_wrr.c | |||
@@ -85,10 +85,9 @@ static int ip_vs_wrr_init_svc(struct ip_vs_service *svc) | |||
85 | * Allocate the mark variable for WRR scheduling | 85 | * Allocate the mark variable for WRR scheduling |
86 | */ | 86 | */ |
87 | mark = kmalloc(sizeof(struct ip_vs_wrr_mark), GFP_ATOMIC); | 87 | mark = kmalloc(sizeof(struct ip_vs_wrr_mark), GFP_ATOMIC); |
88 | if (mark == NULL) { | 88 | if (mark == NULL) |
89 | pr_err("%s(): no memory\n", __func__); | ||
90 | return -ENOMEM; | 89 | return -ENOMEM; |
91 | } | 90 | |
92 | mark->cl = &svc->destinations; | 91 | mark->cl = &svc->destinations; |
93 | mark->cw = 0; | 92 | mark->cw = 0; |
94 | mark->mw = ip_vs_wrr_max_weight(svc); | 93 | mark->mw = ip_vs_wrr_max_weight(svc); |
diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c index ee319a4338b0..aa2d7206ee8a 100644 --- a/net/netfilter/ipvs/ip_vs_xmit.c +++ b/net/netfilter/ipvs/ip_vs_xmit.c | |||
@@ -339,7 +339,7 @@ ip_vs_dst_reset(struct ip_vs_dest *dest) | |||
339 | \ | 339 | \ |
340 | (skb)->ipvs_property = 1; \ | 340 | (skb)->ipvs_property = 1; \ |
341 | if (unlikely((cp)->flags & IP_VS_CONN_F_NFCT)) \ | 341 | if (unlikely((cp)->flags & IP_VS_CONN_F_NFCT)) \ |
342 | __ret = ip_vs_confirm_conntrack(skb, cp); \ | 342 | __ret = ip_vs_confirm_conntrack(skb); \ |
343 | if (__ret == NF_ACCEPT) { \ | 343 | if (__ret == NF_ACCEPT) { \ |
344 | nf_reset(skb); \ | 344 | nf_reset(skb); \ |
345 | skb_forward_csum(skb); \ | 345 | skb_forward_csum(skb); \ |
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index 5acfaf59a9c3..7202b0631cd6 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c | |||
@@ -661,7 +661,6 @@ __nf_conntrack_alloc(struct net *net, u16 zone, | |||
661 | */ | 661 | */ |
662 | ct = kmem_cache_alloc(net->ct.nf_conntrack_cachep, gfp); | 662 | ct = kmem_cache_alloc(net->ct.nf_conntrack_cachep, gfp); |
663 | if (ct == NULL) { | 663 | if (ct == NULL) { |
664 | pr_debug("nf_conntrack_alloc: Can't alloc conntrack.\n"); | ||
665 | atomic_dec(&net->ct.count); | 664 | atomic_dec(&net->ct.count); |
666 | return ERR_PTR(-ENOMEM); | 665 | return ERR_PTR(-ENOMEM); |
667 | } | 666 | } |
@@ -749,10 +748,8 @@ init_conntrack(struct net *net, struct nf_conn *tmpl, | |||
749 | 748 | ||
750 | ct = __nf_conntrack_alloc(net, zone, tuple, &repl_tuple, GFP_ATOMIC, | 749 | ct = __nf_conntrack_alloc(net, zone, tuple, &repl_tuple, GFP_ATOMIC, |
751 | hash); | 750 | hash); |
752 | if (IS_ERR(ct)) { | 751 | if (IS_ERR(ct)) |
753 | pr_debug("Can't allocate conntrack.\n"); | ||
754 | return (struct nf_conntrack_tuple_hash *)ct; | 752 | return (struct nf_conntrack_tuple_hash *)ct; |
755 | } | ||
756 | 753 | ||
757 | if (!l4proto->new(ct, skb, dataoff)) { | 754 | if (!l4proto->new(ct, skb, dataoff)) { |
758 | nf_conntrack_free(ct); | 755 | nf_conntrack_free(ct); |
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index 2d8158acf6fa..66b2c54c544f 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c | |||
@@ -307,17 +307,14 @@ nfulnl_alloc_skb(unsigned int inst_size, unsigned int pkt_size) | |||
307 | n = max(inst_size, pkt_size); | 307 | n = max(inst_size, pkt_size); |
308 | skb = alloc_skb(n, GFP_ATOMIC); | 308 | skb = alloc_skb(n, GFP_ATOMIC); |
309 | if (!skb) { | 309 | if (!skb) { |
310 | pr_notice("nfnetlink_log: can't alloc whole buffer (%u bytes)\n", | ||
311 | inst_size); | ||
312 | |||
313 | if (n > pkt_size) { | 310 | if (n > pkt_size) { |
314 | /* try to allocate only as much as we need for current | 311 | /* try to allocate only as much as we need for current |
315 | * packet */ | 312 | * packet */ |
316 | 313 | ||
317 | skb = alloc_skb(pkt_size, GFP_ATOMIC); | 314 | skb = alloc_skb(pkt_size, GFP_ATOMIC); |
318 | if (!skb) | 315 | if (!skb) |
319 | pr_err("nfnetlink_log: can't even alloc %u " | 316 | pr_err("nfnetlink_log: can't even alloc %u bytes\n", |
320 | "bytes\n", pkt_size); | 317 | pkt_size); |
321 | } | 318 | } |
322 | } | 319 | } |
323 | 320 | ||
diff --git a/net/netfilter/xt_IDLETIMER.c b/net/netfilter/xt_IDLETIMER.c index 3bdd443aaf15..f407ebc13481 100644 --- a/net/netfilter/xt_IDLETIMER.c +++ b/net/netfilter/xt_IDLETIMER.c | |||
@@ -122,14 +122,12 @@ static int idletimer_tg_create(struct idletimer_tg_info *info) | |||
122 | 122 | ||
123 | info->timer = kmalloc(sizeof(*info->timer), GFP_KERNEL); | 123 | info->timer = kmalloc(sizeof(*info->timer), GFP_KERNEL); |
124 | if (!info->timer) { | 124 | if (!info->timer) { |
125 | pr_debug("couldn't alloc timer\n"); | ||
126 | ret = -ENOMEM; | 125 | ret = -ENOMEM; |
127 | goto out; | 126 | goto out; |
128 | } | 127 | } |
129 | 128 | ||
130 | info->timer->attr.attr.name = kstrdup(info->label, GFP_KERNEL); | 129 | info->timer->attr.attr.name = kstrdup(info->label, GFP_KERNEL); |
131 | if (!info->timer->attr.attr.name) { | 130 | if (!info->timer->attr.attr.name) { |
132 | pr_debug("couldn't alloc attribute name\n"); | ||
133 | ret = -ENOMEM; | 131 | ret = -ENOMEM; |
134 | goto out_free_timer; | 132 | goto out_free_timer; |
135 | } | 133 | } |
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index 9228ee0dc11a..dfd52bad1523 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c | |||
@@ -176,10 +176,7 @@ dsthash_alloc_init(struct xt_hashlimit_htable *ht, | |||
176 | ent = NULL; | 176 | ent = NULL; |
177 | } else | 177 | } else |
178 | ent = kmem_cache_alloc(hashlimit_cachep, GFP_ATOMIC); | 178 | ent = kmem_cache_alloc(hashlimit_cachep, GFP_ATOMIC); |
179 | if (!ent) { | 179 | if (ent) { |
180 | if (net_ratelimit()) | ||
181 | pr_err("cannot allocate dsthash_ent\n"); | ||
182 | } else { | ||
183 | memcpy(&ent->dst, dst, sizeof(ent->dst)); | 180 | memcpy(&ent->dst, dst, sizeof(ent->dst)); |
184 | spin_lock_init(&ent->lock); | 181 | spin_lock_init(&ent->lock); |
185 | 182 | ||
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 03bb45adf2fc..82a6f34d39d0 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -335,7 +335,7 @@ struct packet_skb_cb { | |||
335 | (((x)->kactive_blk_num < ((x)->knum_blocks-1)) ? \ | 335 | (((x)->kactive_blk_num < ((x)->knum_blocks-1)) ? \ |
336 | ((x)->kactive_blk_num+1) : 0) | 336 | ((x)->kactive_blk_num+1) : 0) |
337 | 337 | ||
338 | static inline struct packet_sock *pkt_sk(struct sock *sk) | 338 | static struct packet_sock *pkt_sk(struct sock *sk) |
339 | { | 339 | { |
340 | return (struct packet_sock *)sk; | 340 | return (struct packet_sock *)sk; |
341 | } | 341 | } |
@@ -477,7 +477,7 @@ static void *packet_lookup_frame(struct packet_sock *po, | |||
477 | return h.raw; | 477 | return h.raw; |
478 | } | 478 | } |
479 | 479 | ||
480 | static inline void *packet_current_frame(struct packet_sock *po, | 480 | static void *packet_current_frame(struct packet_sock *po, |
481 | struct packet_ring_buffer *rb, | 481 | struct packet_ring_buffer *rb, |
482 | int status) | 482 | int status) |
483 | { | 483 | { |
@@ -715,7 +715,7 @@ out: | |||
715 | spin_unlock(&po->sk.sk_receive_queue.lock); | 715 | spin_unlock(&po->sk.sk_receive_queue.lock); |
716 | } | 716 | } |
717 | 717 | ||
718 | static inline void prb_flush_block(struct tpacket_kbdq_core *pkc1, | 718 | static void prb_flush_block(struct tpacket_kbdq_core *pkc1, |
719 | struct tpacket_block_desc *pbd1, __u32 status) | 719 | struct tpacket_block_desc *pbd1, __u32 status) |
720 | { | 720 | { |
721 | /* Flush everything minus the block header */ | 721 | /* Flush everything minus the block header */ |
@@ -793,7 +793,7 @@ static void prb_close_block(struct tpacket_kbdq_core *pkc1, | |||
793 | pkc1->kactive_blk_num = GET_NEXT_PRB_BLK_NUM(pkc1); | 793 | pkc1->kactive_blk_num = GET_NEXT_PRB_BLK_NUM(pkc1); |
794 | } | 794 | } |
795 | 795 | ||
796 | static inline void prb_thaw_queue(struct tpacket_kbdq_core *pkc) | 796 | static void prb_thaw_queue(struct tpacket_kbdq_core *pkc) |
797 | { | 797 | { |
798 | pkc->reset_pending_on_curr_blk = 0; | 798 | pkc->reset_pending_on_curr_blk = 0; |
799 | } | 799 | } |
@@ -869,7 +869,7 @@ static void prb_open_block(struct tpacket_kbdq_core *pkc1, | |||
869 | * case and __packet_lookup_frame_in_block will check if block-0 | 869 | * case and __packet_lookup_frame_in_block will check if block-0 |
870 | * is free and can now be re-used. | 870 | * is free and can now be re-used. |
871 | */ | 871 | */ |
872 | static inline void prb_freeze_queue(struct tpacket_kbdq_core *pkc, | 872 | static void prb_freeze_queue(struct tpacket_kbdq_core *pkc, |
873 | struct packet_sock *po) | 873 | struct packet_sock *po) |
874 | { | 874 | { |
875 | pkc->reset_pending_on_curr_blk = 1; | 875 | pkc->reset_pending_on_curr_blk = 1; |
@@ -940,36 +940,36 @@ static void prb_retire_current_block(struct tpacket_kbdq_core *pkc, | |||
940 | BUG(); | 940 | BUG(); |
941 | } | 941 | } |
942 | 942 | ||
943 | static inline int prb_curr_blk_in_use(struct tpacket_kbdq_core *pkc, | 943 | static int prb_curr_blk_in_use(struct tpacket_kbdq_core *pkc, |
944 | struct tpacket_block_desc *pbd) | 944 | struct tpacket_block_desc *pbd) |
945 | { | 945 | { |
946 | return TP_STATUS_USER & BLOCK_STATUS(pbd); | 946 | return TP_STATUS_USER & BLOCK_STATUS(pbd); |
947 | } | 947 | } |
948 | 948 | ||
949 | static inline int prb_queue_frozen(struct tpacket_kbdq_core *pkc) | 949 | static int prb_queue_frozen(struct tpacket_kbdq_core *pkc) |
950 | { | 950 | { |
951 | return pkc->reset_pending_on_curr_blk; | 951 | return pkc->reset_pending_on_curr_blk; |
952 | } | 952 | } |
953 | 953 | ||
954 | static inline void prb_clear_blk_fill_status(struct packet_ring_buffer *rb) | 954 | static void prb_clear_blk_fill_status(struct packet_ring_buffer *rb) |
955 | { | 955 | { |
956 | struct tpacket_kbdq_core *pkc = GET_PBDQC_FROM_RB(rb); | 956 | struct tpacket_kbdq_core *pkc = GET_PBDQC_FROM_RB(rb); |
957 | atomic_dec(&pkc->blk_fill_in_prog); | 957 | atomic_dec(&pkc->blk_fill_in_prog); |
958 | } | 958 | } |
959 | 959 | ||
960 | static inline void prb_fill_rxhash(struct tpacket_kbdq_core *pkc, | 960 | static void prb_fill_rxhash(struct tpacket_kbdq_core *pkc, |
961 | struct tpacket3_hdr *ppd) | 961 | struct tpacket3_hdr *ppd) |
962 | { | 962 | { |
963 | ppd->hv1.tp_rxhash = skb_get_rxhash(pkc->skb); | 963 | ppd->hv1.tp_rxhash = skb_get_rxhash(pkc->skb); |
964 | } | 964 | } |
965 | 965 | ||
966 | static inline void prb_clear_rxhash(struct tpacket_kbdq_core *pkc, | 966 | static void prb_clear_rxhash(struct tpacket_kbdq_core *pkc, |
967 | struct tpacket3_hdr *ppd) | 967 | struct tpacket3_hdr *ppd) |
968 | { | 968 | { |
969 | ppd->hv1.tp_rxhash = 0; | 969 | ppd->hv1.tp_rxhash = 0; |
970 | } | 970 | } |
971 | 971 | ||
972 | static inline void prb_fill_vlan_info(struct tpacket_kbdq_core *pkc, | 972 | static void prb_fill_vlan_info(struct tpacket_kbdq_core *pkc, |
973 | struct tpacket3_hdr *ppd) | 973 | struct tpacket3_hdr *ppd) |
974 | { | 974 | { |
975 | if (vlan_tx_tag_present(pkc->skb)) { | 975 | if (vlan_tx_tag_present(pkc->skb)) { |
@@ -991,7 +991,7 @@ static void prb_run_all_ft_ops(struct tpacket_kbdq_core *pkc, | |||
991 | prb_clear_rxhash(pkc, ppd); | 991 | prb_clear_rxhash(pkc, ppd); |
992 | } | 992 | } |
993 | 993 | ||
994 | static inline void prb_fill_curr_block(char *curr, | 994 | static void prb_fill_curr_block(char *curr, |
995 | struct tpacket_kbdq_core *pkc, | 995 | struct tpacket_kbdq_core *pkc, |
996 | struct tpacket_block_desc *pbd, | 996 | struct tpacket_block_desc *pbd, |
997 | unsigned int len) | 997 | unsigned int len) |
@@ -1071,7 +1071,7 @@ static void *__packet_lookup_frame_in_block(struct packet_sock *po, | |||
1071 | return NULL; | 1071 | return NULL; |
1072 | } | 1072 | } |
1073 | 1073 | ||
1074 | static inline void *packet_current_rx_frame(struct packet_sock *po, | 1074 | static void *packet_current_rx_frame(struct packet_sock *po, |
1075 | struct sk_buff *skb, | 1075 | struct sk_buff *skb, |
1076 | int status, unsigned int len) | 1076 | int status, unsigned int len) |
1077 | { | 1077 | { |
@@ -1091,7 +1091,7 @@ static inline void *packet_current_rx_frame(struct packet_sock *po, | |||
1091 | } | 1091 | } |
1092 | } | 1092 | } |
1093 | 1093 | ||
1094 | static inline void *prb_lookup_block(struct packet_sock *po, | 1094 | static void *prb_lookup_block(struct packet_sock *po, |
1095 | struct packet_ring_buffer *rb, | 1095 | struct packet_ring_buffer *rb, |
1096 | unsigned int previous, | 1096 | unsigned int previous, |
1097 | int status) | 1097 | int status) |
@@ -1104,7 +1104,7 @@ static inline void *prb_lookup_block(struct packet_sock *po, | |||
1104 | return pbd; | 1104 | return pbd; |
1105 | } | 1105 | } |
1106 | 1106 | ||
1107 | static inline int prb_previous_blk_num(struct packet_ring_buffer *rb) | 1107 | static int prb_previous_blk_num(struct packet_ring_buffer *rb) |
1108 | { | 1108 | { |
1109 | unsigned int prev; | 1109 | unsigned int prev; |
1110 | if (rb->prb_bdqc.kactive_blk_num) | 1110 | if (rb->prb_bdqc.kactive_blk_num) |
@@ -1115,7 +1115,7 @@ static inline int prb_previous_blk_num(struct packet_ring_buffer *rb) | |||
1115 | } | 1115 | } |
1116 | 1116 | ||
1117 | /* Assumes caller has held the rx_queue.lock */ | 1117 | /* Assumes caller has held the rx_queue.lock */ |
1118 | static inline void *__prb_previous_block(struct packet_sock *po, | 1118 | static void *__prb_previous_block(struct packet_sock *po, |
1119 | struct packet_ring_buffer *rb, | 1119 | struct packet_ring_buffer *rb, |
1120 | int status) | 1120 | int status) |
1121 | { | 1121 | { |
@@ -1123,7 +1123,7 @@ static inline void *__prb_previous_block(struct packet_sock *po, | |||
1123 | return prb_lookup_block(po, rb, previous, status); | 1123 | return prb_lookup_block(po, rb, previous, status); |
1124 | } | 1124 | } |
1125 | 1125 | ||
1126 | static inline void *packet_previous_rx_frame(struct packet_sock *po, | 1126 | static void *packet_previous_rx_frame(struct packet_sock *po, |
1127 | struct packet_ring_buffer *rb, | 1127 | struct packet_ring_buffer *rb, |
1128 | int status) | 1128 | int status) |
1129 | { | 1129 | { |
@@ -1133,7 +1133,7 @@ static inline void *packet_previous_rx_frame(struct packet_sock *po, | |||
1133 | return __prb_previous_block(po, rb, status); | 1133 | return __prb_previous_block(po, rb, status); |
1134 | } | 1134 | } |
1135 | 1135 | ||
1136 | static inline void packet_increment_rx_head(struct packet_sock *po, | 1136 | static void packet_increment_rx_head(struct packet_sock *po, |
1137 | struct packet_ring_buffer *rb) | 1137 | struct packet_ring_buffer *rb) |
1138 | { | 1138 | { |
1139 | switch (po->tp_version) { | 1139 | switch (po->tp_version) { |
@@ -1148,7 +1148,7 @@ static inline void packet_increment_rx_head(struct packet_sock *po, | |||
1148 | } | 1148 | } |
1149 | } | 1149 | } |
1150 | 1150 | ||
1151 | static inline void *packet_previous_frame(struct packet_sock *po, | 1151 | static void *packet_previous_frame(struct packet_sock *po, |
1152 | struct packet_ring_buffer *rb, | 1152 | struct packet_ring_buffer *rb, |
1153 | int status) | 1153 | int status) |
1154 | { | 1154 | { |
@@ -1156,7 +1156,7 @@ static inline void *packet_previous_frame(struct packet_sock *po, | |||
1156 | return packet_lookup_frame(po, rb, previous, status); | 1156 | return packet_lookup_frame(po, rb, previous, status); |
1157 | } | 1157 | } |
1158 | 1158 | ||
1159 | static inline void packet_increment_head(struct packet_ring_buffer *buff) | 1159 | static void packet_increment_head(struct packet_ring_buffer *buff) |
1160 | { | 1160 | { |
1161 | buff->head = buff->head != buff->frame_max ? buff->head+1 : 0; | 1161 | buff->head = buff->head != buff->frame_max ? buff->head+1 : 0; |
1162 | } | 1162 | } |
@@ -1558,7 +1558,7 @@ out_free: | |||
1558 | return err; | 1558 | return err; |
1559 | } | 1559 | } |
1560 | 1560 | ||
1561 | static inline unsigned int run_filter(const struct sk_buff *skb, | 1561 | static unsigned int run_filter(const struct sk_buff *skb, |
1562 | const struct sock *sk, | 1562 | const struct sock *sk, |
1563 | unsigned int res) | 1563 | unsigned int res) |
1564 | { | 1564 | { |
@@ -2167,10 +2167,10 @@ out: | |||
2167 | return err; | 2167 | return err; |
2168 | } | 2168 | } |
2169 | 2169 | ||
2170 | static inline struct sk_buff *packet_alloc_skb(struct sock *sk, size_t prepad, | 2170 | static struct sk_buff *packet_alloc_skb(struct sock *sk, size_t prepad, |
2171 | size_t reserve, size_t len, | 2171 | size_t reserve, size_t len, |
2172 | size_t linear, int noblock, | 2172 | size_t linear, int noblock, |
2173 | int *err) | 2173 | int *err) |
2174 | { | 2174 | { |
2175 | struct sk_buff *skb; | 2175 | struct sk_buff *skb; |
2176 | 2176 | ||
@@ -3494,7 +3494,7 @@ static void free_pg_vec(struct pgv *pg_vec, unsigned int order, | |||
3494 | kfree(pg_vec); | 3494 | kfree(pg_vec); |
3495 | } | 3495 | } |
3496 | 3496 | ||
3497 | static inline char *alloc_one_pg_vec_page(unsigned long order) | 3497 | static char *alloc_one_pg_vec_page(unsigned long order) |
3498 | { | 3498 | { |
3499 | char *buffer = NULL; | 3499 | char *buffer = NULL; |
3500 | gfp_t gfp_flags = GFP_KERNEL | __GFP_COMP | | 3500 | gfp_t gfp_flags = GFP_KERNEL | __GFP_COMP | |
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index 5f03e4ea65bf..3e16c6abde4f 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c | |||
@@ -1261,14 +1261,19 @@ static int x25_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1261 | struct x25_sock *x25 = x25_sk(sk); | 1261 | struct x25_sock *x25 = x25_sk(sk); |
1262 | struct sockaddr_x25 *sx25 = (struct sockaddr_x25 *)msg->msg_name; | 1262 | struct sockaddr_x25 *sx25 = (struct sockaddr_x25 *)msg->msg_name; |
1263 | size_t copied; | 1263 | size_t copied; |
1264 | int qbit, header_len = x25->neighbour->extended ? | 1264 | int qbit, header_len; |
1265 | X25_EXT_MIN_LEN : X25_STD_MIN_LEN; | ||
1266 | |||
1267 | struct sk_buff *skb; | 1265 | struct sk_buff *skb; |
1268 | unsigned char *asmptr; | 1266 | unsigned char *asmptr; |
1269 | int rc = -ENOTCONN; | 1267 | int rc = -ENOTCONN; |
1270 | 1268 | ||
1271 | lock_sock(sk); | 1269 | lock_sock(sk); |
1270 | |||
1271 | if (x25->neighbour == NULL) | ||
1272 | goto out; | ||
1273 | |||
1274 | header_len = x25->neighbour->extended ? | ||
1275 | X25_EXT_MIN_LEN : X25_STD_MIN_LEN; | ||
1276 | |||
1272 | /* | 1277 | /* |
1273 | * This works for seqpacket too. The receiver has ordered the queue for | 1278 | * This works for seqpacket too. The receiver has ordered the queue for |
1274 | * us! We do one quick check first though | 1279 | * us! We do one quick check first though |