aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MAINTAINERS7
-rw-r--r--crypto/deflate.c7
-rw-r--r--crypto/zlib.c7
-rw-r--r--drivers/net/Kconfig3
-rw-r--r--drivers/net/bnx2x/bnx2x_main.c6
-rw-r--r--drivers/net/can/Kconfig4
-rw-r--r--drivers/net/cxgb3/sge.c4
-rw-r--r--drivers/net/ppp_deflate.c5
-rw-r--r--drivers/net/r8169.c2
-rw-r--r--drivers/net/rionet.c28
-rw-r--r--drivers/net/usb/kalmia.c42
-rw-r--r--drivers/net/usb/zaurus.c10
-rw-r--r--drivers/net/wireless/rtlwifi/pci.c13
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/sw.c20
-rw-r--r--net/bluetooth/hci_conn.c6
-rw-r--r--net/bluetooth/l2cap_core.c21
-rw-r--r--net/bridge/br_multicast.c5
-rw-r--r--net/ipv4/ip_output.c17
-rw-r--r--net/ipv4/netfilter.c60
-rw-r--r--net/ipv4/netfilter/ipt_REJECT.c14
-rw-r--r--net/ipv4/udp.c3
-rw-r--r--net/ipv6/udp.c5
22 files changed, 155 insertions, 134 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 1b9bcdaef6ff..ae563fad2271 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1392,7 +1392,6 @@ F: include/linux/backlight.h
1392BATMAN ADVANCED 1392BATMAN ADVANCED
1393M: Marek Lindner <lindner_marek@yahoo.de> 1393M: Marek Lindner <lindner_marek@yahoo.de>
1394M: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> 1394M: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
1395M: Sven Eckelmann <sven@narfation.org>
1396L: b.a.t.m.a.n@lists.open-mesh.org 1395L: b.a.t.m.a.n@lists.open-mesh.org
1397W: http://www.open-mesh.org/ 1396W: http://www.open-mesh.org/
1398S: Maintained 1397S: Maintained
@@ -1425,7 +1424,6 @@ S: Supported
1425F: arch/blackfin/ 1424F: arch/blackfin/
1426 1425
1427BLACKFIN EMAC DRIVER 1426BLACKFIN EMAC DRIVER
1428M: Michael Hennerich <michael.hennerich@analog.com>
1429L: uclinux-dist-devel@blackfin.uclinux.org 1427L: uclinux-dist-devel@blackfin.uclinux.org
1430W: http://blackfin.uclinux.org 1428W: http://blackfin.uclinux.org
1431S: Supported 1429S: Supported
@@ -1641,7 +1639,7 @@ CAN NETWORK LAYER
1641M: Oliver Hartkopp <socketcan@hartkopp.net> 1639M: Oliver Hartkopp <socketcan@hartkopp.net>
1642M: Oliver Hartkopp <oliver.hartkopp@volkswagen.de> 1640M: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
1643M: Urs Thuermann <urs.thuermann@volkswagen.de> 1641M: Urs Thuermann <urs.thuermann@volkswagen.de>
1644L: socketcan-core@lists.berlios.de 1642L: socketcan-core@lists.berlios.de (subscribers-only)
1645L: netdev@vger.kernel.org 1643L: netdev@vger.kernel.org
1646W: http://developer.berlios.de/projects/socketcan/ 1644W: http://developer.berlios.de/projects/socketcan/
1647S: Maintained 1645S: Maintained
@@ -1653,7 +1651,7 @@ F: include/linux/can/raw.h
1653 1651
1654CAN NETWORK DRIVERS 1652CAN NETWORK DRIVERS
1655M: Wolfgang Grandegger <wg@grandegger.com> 1653M: Wolfgang Grandegger <wg@grandegger.com>
1656L: socketcan-core@lists.berlios.de 1654L: socketcan-core@lists.berlios.de (subscribers-only)
1657L: netdev@vger.kernel.org 1655L: netdev@vger.kernel.org
1658W: http://developer.berlios.de/projects/socketcan/ 1656W: http://developer.berlios.de/projects/socketcan/
1659S: Maintained 1657S: Maintained
@@ -5183,6 +5181,7 @@ S: Supported
5183F: drivers/net/qlcnic/ 5181F: drivers/net/qlcnic/
5184 5182
5185QLOGIC QLGE 10Gb ETHERNET DRIVER 5183QLOGIC QLGE 10Gb ETHERNET DRIVER
5184M: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
5186M: Ron Mercer <ron.mercer@qlogic.com> 5185M: Ron Mercer <ron.mercer@qlogic.com>
5187M: linux-driver@qlogic.com 5186M: linux-driver@qlogic.com
5188L: netdev@vger.kernel.org 5187L: netdev@vger.kernel.org
diff --git a/crypto/deflate.c b/crypto/deflate.c
index b5ccae29be74..b0165ecad0c5 100644
--- a/crypto/deflate.c
+++ b/crypto/deflate.c
@@ -32,7 +32,6 @@
32#include <linux/interrupt.h> 32#include <linux/interrupt.h>
33#include <linux/mm.h> 33#include <linux/mm.h>
34#include <linux/net.h> 34#include <linux/net.h>
35#include <linux/slab.h>
36 35
37#define DEFLATE_DEF_LEVEL Z_DEFAULT_COMPRESSION 36#define DEFLATE_DEF_LEVEL Z_DEFAULT_COMPRESSION
38#define DEFLATE_DEF_WINBITS 11 37#define DEFLATE_DEF_WINBITS 11
@@ -73,7 +72,7 @@ static int deflate_decomp_init(struct deflate_ctx *ctx)
73 int ret = 0; 72 int ret = 0;
74 struct z_stream_s *stream = &ctx->decomp_stream; 73 struct z_stream_s *stream = &ctx->decomp_stream;
75 74
76 stream->workspace = kzalloc(zlib_inflate_workspacesize(), GFP_KERNEL); 75 stream->workspace = vzalloc(zlib_inflate_workspacesize());
77 if (!stream->workspace) { 76 if (!stream->workspace) {
78 ret = -ENOMEM; 77 ret = -ENOMEM;
79 goto out; 78 goto out;
@@ -86,7 +85,7 @@ static int deflate_decomp_init(struct deflate_ctx *ctx)
86out: 85out:
87 return ret; 86 return ret;
88out_free: 87out_free:
89 kfree(stream->workspace); 88 vfree(stream->workspace);
90 goto out; 89 goto out;
91} 90}
92 91
@@ -99,7 +98,7 @@ static void deflate_comp_exit(struct deflate_ctx *ctx)
99static void deflate_decomp_exit(struct deflate_ctx *ctx) 98static void deflate_decomp_exit(struct deflate_ctx *ctx)
100{ 99{
101 zlib_inflateEnd(&ctx->decomp_stream); 100 zlib_inflateEnd(&ctx->decomp_stream);
102 kfree(ctx->decomp_stream.workspace); 101 vfree(ctx->decomp_stream.workspace);
103} 102}
104 103
105static int deflate_init(struct crypto_tfm *tfm) 104static int deflate_init(struct crypto_tfm *tfm)
diff --git a/crypto/zlib.c b/crypto/zlib.c
index d11d761a5e41..06b62e5cdcc7 100644
--- a/crypto/zlib.c
+++ b/crypto/zlib.c
@@ -29,7 +29,6 @@
29#include <linux/interrupt.h> 29#include <linux/interrupt.h>
30#include <linux/mm.h> 30#include <linux/mm.h>
31#include <linux/net.h> 31#include <linux/net.h>
32#include <linux/slab.h>
33 32
34#include <crypto/internal/compress.h> 33#include <crypto/internal/compress.h>
35 34
@@ -60,7 +59,7 @@ static void zlib_decomp_exit(struct zlib_ctx *ctx)
60 59
61 if (stream->workspace) { 60 if (stream->workspace) {
62 zlib_inflateEnd(stream); 61 zlib_inflateEnd(stream);
63 kfree(stream->workspace); 62 vfree(stream->workspace);
64 stream->workspace = NULL; 63 stream->workspace = NULL;
65 } 64 }
66} 65}
@@ -228,13 +227,13 @@ static int zlib_decompress_setup(struct crypto_pcomp *tfm, void *params,
228 ? nla_get_u32(tb[ZLIB_DECOMP_WINDOWBITS]) 227 ? nla_get_u32(tb[ZLIB_DECOMP_WINDOWBITS])
229 : DEF_WBITS; 228 : DEF_WBITS;
230 229
231 stream->workspace = kzalloc(zlib_inflate_workspacesize(), GFP_KERNEL); 230 stream->workspace = vzalloc(zlib_inflate_workspacesize());
232 if (!stream->workspace) 231 if (!stream->workspace)
233 return -ENOMEM; 232 return -ENOMEM;
234 233
235 ret = zlib_inflateInit2(stream, ctx->decomp_windowBits); 234 ret = zlib_inflateInit2(stream, ctx->decomp_windowBits);
236 if (ret != Z_OK) { 235 if (ret != Z_OK) {
237 kfree(stream->workspace); 236 vfree(stream->workspace);
238 stream->workspace = NULL; 237 stream->workspace = NULL;
239 return -EINVAL; 238 return -EINVAL;
240 } 239 }
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 19f04a34783a..93359fab240e 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -3416,7 +3416,8 @@ config NETCONSOLE
3416 3416
3417config NETCONSOLE_DYNAMIC 3417config NETCONSOLE_DYNAMIC
3418 bool "Dynamic reconfiguration of logging targets" 3418 bool "Dynamic reconfiguration of logging targets"
3419 depends on NETCONSOLE && SYSFS && CONFIGFS_FS 3419 depends on NETCONSOLE && SYSFS && CONFIGFS_FS && \
3420 !(NETCONSOLE=y && CONFIGFS_FS=m)
3420 help 3421 help
3421 This option enables the ability to dynamically reconfigure target 3422 This option enables the ability to dynamically reconfigure target
3422 parameters (interface, IP addresses, port numbers, MAC addresses) 3423 parameters (interface, IP addresses, port numbers, MAC addresses)
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c
index 4b70311a11ef..74be989f51c5 100644
--- a/drivers/net/bnx2x/bnx2x_main.c
+++ b/drivers/net/bnx2x/bnx2x_main.c
@@ -49,6 +49,7 @@
49#include <linux/zlib.h> 49#include <linux/zlib.h>
50#include <linux/io.h> 50#include <linux/io.h>
51#include <linux/stringify.h> 51#include <linux/stringify.h>
52#include <linux/vmalloc.h>
52 53
53#define BNX2X_MAIN 54#define BNX2X_MAIN
54#include "bnx2x.h" 55#include "bnx2x.h"
@@ -4537,8 +4538,7 @@ static int bnx2x_gunzip_init(struct bnx2x *bp)
4537 if (bp->strm == NULL) 4538 if (bp->strm == NULL)
4538 goto gunzip_nomem2; 4539 goto gunzip_nomem2;
4539 4540
4540 bp->strm->workspace = kmalloc(zlib_inflate_workspacesize(), 4541 bp->strm->workspace = vmalloc(zlib_inflate_workspacesize());
4541 GFP_KERNEL);
4542 if (bp->strm->workspace == NULL) 4542 if (bp->strm->workspace == NULL)
4543 goto gunzip_nomem3; 4543 goto gunzip_nomem3;
4544 4544
@@ -4562,7 +4562,7 @@ gunzip_nomem1:
4562static void bnx2x_gunzip_end(struct bnx2x *bp) 4562static void bnx2x_gunzip_end(struct bnx2x *bp)
4563{ 4563{
4564 if (bp->strm) { 4564 if (bp->strm) {
4565 kfree(bp->strm->workspace); 4565 vfree(bp->strm->workspace);
4566 kfree(bp->strm); 4566 kfree(bp->strm);
4567 bp->strm = NULL; 4567 bp->strm = NULL;
4568 } 4568 }
diff --git a/drivers/net/can/Kconfig b/drivers/net/can/Kconfig
index 1d699e3df547..754df5ef1729 100644
--- a/drivers/net/can/Kconfig
+++ b/drivers/net/can/Kconfig
@@ -36,7 +36,7 @@ config CAN_SLCAN
36config CAN_DEV 36config CAN_DEV
37 tristate "Platform CAN drivers with Netlink support" 37 tristate "Platform CAN drivers with Netlink support"
38 depends on CAN 38 depends on CAN
39 default Y 39 default y
40 ---help--- 40 ---help---
41 Enables the common framework for platform CAN drivers with Netlink 41 Enables the common framework for platform CAN drivers with Netlink
42 support. This is the standard library for CAN drivers. 42 support. This is the standard library for CAN drivers.
@@ -45,7 +45,7 @@ config CAN_DEV
45config CAN_CALC_BITTIMING 45config CAN_CALC_BITTIMING
46 bool "CAN bit-timing calculation" 46 bool "CAN bit-timing calculation"
47 depends on CAN_DEV 47 depends on CAN_DEV
48 default Y 48 default y
49 ---help--- 49 ---help---
50 If enabled, CAN bit-timing parameters will be calculated for the 50 If enabled, CAN bit-timing parameters will be calculated for the
51 bit-rate specified via Netlink argument "bitrate" when the device 51 bit-rate specified via Netlink argument "bitrate" when the device
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index 3f562ba2f0c9..76bf5892b962 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -2026,7 +2026,7 @@ static void rx_eth(struct adapter *adap, struct sge_rspq *rq,
2026 skb->ip_summed = CHECKSUM_UNNECESSARY; 2026 skb->ip_summed = CHECKSUM_UNNECESSARY;
2027 } else 2027 } else
2028 skb_checksum_none_assert(skb); 2028 skb_checksum_none_assert(skb);
2029 skb_record_rx_queue(skb, qs - &adap->sge.qs[0]); 2029 skb_record_rx_queue(skb, qs - &adap->sge.qs[pi->first_qset]);
2030 2030
2031 if (unlikely(p->vlan_valid)) { 2031 if (unlikely(p->vlan_valid)) {
2032 struct vlan_group *grp = pi->vlan_grp; 2032 struct vlan_group *grp = pi->vlan_grp;
@@ -2145,7 +2145,7 @@ static void lro_add_page(struct adapter *adap, struct sge_qset *qs,
2145 if (!complete) 2145 if (!complete)
2146 return; 2146 return;
2147 2147
2148 skb_record_rx_queue(skb, qs - &adap->sge.qs[0]); 2148 skb_record_rx_queue(skb, qs - &adap->sge.qs[pi->first_qset]);
2149 2149
2150 if (unlikely(cpl->vlan_valid)) { 2150 if (unlikely(cpl->vlan_valid)) {
2151 struct vlan_group *grp = pi->vlan_grp; 2151 struct vlan_group *grp = pi->vlan_grp;
diff --git a/drivers/net/ppp_deflate.c b/drivers/net/ppp_deflate.c
index 31e9407a0739..1dbdf82a6dfd 100644
--- a/drivers/net/ppp_deflate.c
+++ b/drivers/net/ppp_deflate.c
@@ -305,7 +305,7 @@ static void z_decomp_free(void *arg)
305 305
306 if (state) { 306 if (state) {
307 zlib_inflateEnd(&state->strm); 307 zlib_inflateEnd(&state->strm);
308 kfree(state->strm.workspace); 308 vfree(state->strm.workspace);
309 kfree(state); 309 kfree(state);
310 } 310 }
311} 311}
@@ -345,8 +345,7 @@ static void *z_decomp_alloc(unsigned char *options, int opt_len)
345 345
346 state->w_size = w_size; 346 state->w_size = w_size;
347 state->strm.next_out = NULL; 347 state->strm.next_out = NULL;
348 state->strm.workspace = kmalloc(zlib_inflate_workspacesize(), 348 state->strm.workspace = vmalloc(zlib_inflate_workspacesize());
349 GFP_KERNEL|__GFP_REPEAT);
350 if (state->strm.workspace == NULL) 349 if (state->strm.workspace == NULL)
351 goto out_free; 350 goto out_free;
352 351
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 05d81780d1fd..5990621fb5cd 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -742,7 +742,7 @@ static void rtl8168_oob_notify(struct rtl8169_private *tp, u8 cmd)
742 msleep(2); 742 msleep(2);
743 for (i = 0; i < 5; i++) { 743 for (i = 0; i < 5; i++) {
744 udelay(100); 744 udelay(100);
745 if (!(RTL_R32(ERIDR) & ERIAR_FLAG)) 745 if (!(RTL_R32(ERIAR) & ERIAR_FLAG))
746 break; 746 break;
747 } 747 }
748 748
diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c
index 77c5092a6a40..5d3436d47edd 100644
--- a/drivers/net/rionet.c
+++ b/drivers/net/rionet.c
@@ -378,7 +378,7 @@ static int rionet_close(struct net_device *ndev)
378 378
379static void rionet_remove(struct rio_dev *rdev) 379static void rionet_remove(struct rio_dev *rdev)
380{ 380{
381 struct net_device *ndev = NULL; 381 struct net_device *ndev = rio_get_drvdata(rdev);
382 struct rionet_peer *peer, *tmp; 382 struct rionet_peer *peer, *tmp;
383 383
384 free_pages((unsigned long)rionet_active, rdev->net->hport->sys_size ? 384 free_pages((unsigned long)rionet_active, rdev->net->hport->sys_size ?
@@ -433,22 +433,12 @@ static const struct net_device_ops rionet_netdev_ops = {
433 .ndo_set_mac_address = eth_mac_addr, 433 .ndo_set_mac_address = eth_mac_addr,
434}; 434};
435 435
436static int rionet_setup_netdev(struct rio_mport *mport) 436static int rionet_setup_netdev(struct rio_mport *mport, struct net_device *ndev)
437{ 437{
438 int rc = 0; 438 int rc = 0;
439 struct net_device *ndev = NULL;
440 struct rionet_private *rnet; 439 struct rionet_private *rnet;
441 u16 device_id; 440 u16 device_id;
442 441
443 /* Allocate our net_device structure */
444 ndev = alloc_etherdev(sizeof(struct rionet_private));
445 if (ndev == NULL) {
446 printk(KERN_INFO "%s: could not allocate ethernet device.\n",
447 DRV_NAME);
448 rc = -ENOMEM;
449 goto out;
450 }
451
452 rionet_active = (struct rio_dev **)__get_free_pages(GFP_KERNEL, 442 rionet_active = (struct rio_dev **)__get_free_pages(GFP_KERNEL,
453 mport->sys_size ? __fls(sizeof(void *)) + 4 : 0); 443 mport->sys_size ? __fls(sizeof(void *)) + 4 : 0);
454 if (!rionet_active) { 444 if (!rionet_active) {
@@ -504,11 +494,21 @@ static int rionet_probe(struct rio_dev *rdev, const struct rio_device_id *id)
504 int rc = -ENODEV; 494 int rc = -ENODEV;
505 u32 lpef, lsrc_ops, ldst_ops; 495 u32 lpef, lsrc_ops, ldst_ops;
506 struct rionet_peer *peer; 496 struct rionet_peer *peer;
497 struct net_device *ndev = NULL;
507 498
508 /* If local device is not rionet capable, give up quickly */ 499 /* If local device is not rionet capable, give up quickly */
509 if (!rionet_capable) 500 if (!rionet_capable)
510 goto out; 501 goto out;
511 502
503 /* Allocate our net_device structure */
504 ndev = alloc_etherdev(sizeof(struct rionet_private));
505 if (ndev == NULL) {
506 printk(KERN_INFO "%s: could not allocate ethernet device.\n",
507 DRV_NAME);
508 rc = -ENOMEM;
509 goto out;
510 }
511
512 /* 512 /*
513 * First time through, make sure local device is rionet 513 * First time through, make sure local device is rionet
514 * capable, setup netdev, and set flags so this is skipped 514 * capable, setup netdev, and set flags so this is skipped
@@ -529,7 +529,7 @@ static int rionet_probe(struct rio_dev *rdev, const struct rio_device_id *id)
529 goto out; 529 goto out;
530 } 530 }
531 531
532 rc = rionet_setup_netdev(rdev->net->hport); 532 rc = rionet_setup_netdev(rdev->net->hport, ndev);
533 rionet_check = 1; 533 rionet_check = 1;
534 } 534 }
535 535
@@ -546,6 +546,8 @@ static int rionet_probe(struct rio_dev *rdev, const struct rio_device_id *id)
546 list_add_tail(&peer->node, &rionet_peers); 546 list_add_tail(&peer->node, &rionet_peers);
547 } 547 }
548 548
549 rio_set_drvdata(rdev, ndev);
550
549 out: 551 out:
550 return rc; 552 return rc;
551} 553}
diff --git a/drivers/net/usb/kalmia.c b/drivers/net/usb/kalmia.c
index d965fb1e013e..a9b6c63d54e4 100644
--- a/drivers/net/usb/kalmia.c
+++ b/drivers/net/usb/kalmia.c
@@ -100,34 +100,42 @@ kalmia_send_init_packet(struct usbnet *dev, u8 *init_msg, u8 init_msg_len,
100static int 100static int
101kalmia_init_and_get_ethernet_addr(struct usbnet *dev, u8 *ethernet_addr) 101kalmia_init_and_get_ethernet_addr(struct usbnet *dev, u8 *ethernet_addr)
102{ 102{
103 char init_msg_1[] = 103 const static char init_msg_1[] =
104 { 0x57, 0x50, 0x04, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 104 { 0x57, 0x50, 0x04, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
105 0x00, 0x00 }; 105 0x00, 0x00 };
106 char init_msg_2[] = 106 const static char init_msg_2[] =
107 { 0x57, 0x50, 0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf4, 107 { 0x57, 0x50, 0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf4,
108 0x00, 0x00 }; 108 0x00, 0x00 };
109 char receive_buf[28]; 109 const static int buflen = 28;
110 char *usb_buf;
110 int status; 111 int status;
111 112
112 status = kalmia_send_init_packet(dev, init_msg_1, sizeof(init_msg_1) 113 usb_buf = kmalloc(buflen, GFP_DMA | GFP_KERNEL);
113 / sizeof(init_msg_1[0]), receive_buf, 24); 114 if (!usb_buf)
115 return -ENOMEM;
116
117 memcpy(usb_buf, init_msg_1, 12);
118 status = kalmia_send_init_packet(dev, usb_buf, sizeof(init_msg_1)
119 / sizeof(init_msg_1[0]), usb_buf, 24);
114 if (status != 0) 120 if (status != 0)
115 return status; 121 return status;
116 122
117 status = kalmia_send_init_packet(dev, init_msg_2, sizeof(init_msg_2) 123 memcpy(usb_buf, init_msg_2, 12);
118 / sizeof(init_msg_2[0]), receive_buf, 28); 124 status = kalmia_send_init_packet(dev, usb_buf, sizeof(init_msg_2)
125 / sizeof(init_msg_2[0]), usb_buf, 28);
119 if (status != 0) 126 if (status != 0)
120 return status; 127 return status;
121 128
122 memcpy(ethernet_addr, receive_buf + 10, ETH_ALEN); 129 memcpy(ethernet_addr, usb_buf + 10, ETH_ALEN);
123 130
131 kfree(usb_buf);
124 return status; 132 return status;
125} 133}
126 134
127static int 135static int
128kalmia_bind(struct usbnet *dev, struct usb_interface *intf) 136kalmia_bind(struct usbnet *dev, struct usb_interface *intf)
129{ 137{
130 u8 status; 138 int status;
131 u8 ethernet_addr[ETH_ALEN]; 139 u8 ethernet_addr[ETH_ALEN];
132 140
133 /* Don't bind to AT command interface */ 141 /* Don't bind to AT command interface */
@@ -190,7 +198,8 @@ kalmia_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
190 dev_kfree_skb_any(skb); 198 dev_kfree_skb_any(skb);
191 skb = skb2; 199 skb = skb2;
192 200
193 done: header_start = skb_push(skb, KALMIA_HEADER_LENGTH); 201done:
202 header_start = skb_push(skb, KALMIA_HEADER_LENGTH);
194 ether_type_1 = header_start[KALMIA_HEADER_LENGTH + 12]; 203 ether_type_1 = header_start[KALMIA_HEADER_LENGTH + 12];
195 ether_type_2 = header_start[KALMIA_HEADER_LENGTH + 13]; 204 ether_type_2 = header_start[KALMIA_HEADER_LENGTH + 13];
196 205
@@ -201,9 +210,8 @@ kalmia_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
201 header_start[0] = 0x57; 210 header_start[0] = 0x57;
202 header_start[1] = 0x44; 211 header_start[1] = 0x44;
203 content_len = skb->len - KALMIA_HEADER_LENGTH; 212 content_len = skb->len - KALMIA_HEADER_LENGTH;
204 header_start[2] = (content_len & 0xff); /* low byte */
205 header_start[3] = (content_len >> 8); /* high byte */
206 213
214 put_unaligned_le16(content_len, &header_start[2]);
207 header_start[4] = ether_type_1; 215 header_start[4] = ether_type_1;
208 header_start[5] = ether_type_2; 216 header_start[5] = ether_type_2;
209 217
@@ -231,13 +239,13 @@ kalmia_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
231 * Our task here is to strip off framing, leaving skb with one 239 * Our task here is to strip off framing, leaving skb with one
232 * data frame for the usbnet framework code to process. 240 * data frame for the usbnet framework code to process.
233 */ 241 */
234 const u8 HEADER_END_OF_USB_PACKET[] = 242 const static u8 HEADER_END_OF_USB_PACKET[] =
235 { 0x57, 0x5a, 0x00, 0x00, 0x08, 0x00 }; 243 { 0x57, 0x5a, 0x00, 0x00, 0x08, 0x00 };
236 const u8 EXPECTED_UNKNOWN_HEADER_1[] = 244 const static u8 EXPECTED_UNKNOWN_HEADER_1[] =
237 { 0x57, 0x43, 0x1e, 0x00, 0x15, 0x02 }; 245 { 0x57, 0x43, 0x1e, 0x00, 0x15, 0x02 };
238 const u8 EXPECTED_UNKNOWN_HEADER_2[] = 246 const static u8 EXPECTED_UNKNOWN_HEADER_2[] =
239 { 0x57, 0x50, 0x0e, 0x00, 0x00, 0x00 }; 247 { 0x57, 0x50, 0x0e, 0x00, 0x00, 0x00 };
240 u8 i = 0; 248 int i = 0;
241 249
242 /* incomplete header? */ 250 /* incomplete header? */
243 if (skb->len < KALMIA_HEADER_LENGTH) 251 if (skb->len < KALMIA_HEADER_LENGTH)
@@ -285,7 +293,7 @@ kalmia_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
285 293
286 /* subtract start header and end header */ 294 /* subtract start header and end header */
287 usb_packet_length = skb->len - (2 * KALMIA_HEADER_LENGTH); 295 usb_packet_length = skb->len - (2 * KALMIA_HEADER_LENGTH);
288 ether_packet_length = header_start[2] + (header_start[3] << 8); 296 ether_packet_length = get_unaligned_le16(&header_start[2]);
289 skb_pull(skb, KALMIA_HEADER_LENGTH); 297 skb_pull(skb, KALMIA_HEADER_LENGTH);
290 298
291 /* Some small packets misses end marker */ 299 /* Some small packets misses end marker */
diff --git a/drivers/net/usb/zaurus.c b/drivers/net/usb/zaurus.c
index 241756e0e86f..1a2234c20514 100644
--- a/drivers/net/usb/zaurus.c
+++ b/drivers/net/usb/zaurus.c
@@ -331,17 +331,7 @@ static const struct usb_device_id products [] = {
331 ZAURUS_MASTER_INTERFACE, 331 ZAURUS_MASTER_INTERFACE,
332 .driver_info = ZAURUS_PXA_INFO, 332 .driver_info = ZAURUS_PXA_INFO,
333}, 333},
334
335
336/* At least some of the newest PXA units have very different lies about
337 * their standards support: they claim to be cell phones offering
338 * direct access to their radios! (No, they don't conform to CDC MDLM.)
339 */
340{ 334{
341 USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MDLM,
342 USB_CDC_PROTO_NONE),
343 .driver_info = (unsigned long) &bogus_mdlm_info,
344}, {
345 /* Motorola MOTOMAGX phones */ 335 /* Motorola MOTOMAGX phones */
346 USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x6425, USB_CLASS_COMM, 336 USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x6425, USB_CLASS_COMM,
347 USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), 337 USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index 9f8ccae93317..254b64ba4bf6 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -1624,6 +1624,16 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev,
1624 pci_read_config_byte(pdev, 0x8, &revisionid); 1624 pci_read_config_byte(pdev, 0x8, &revisionid);
1625 pci_read_config_word(pdev, 0x3C, &irqline); 1625 pci_read_config_word(pdev, 0x3C, &irqline);
1626 1626
1627 /* PCI ID 0x10ec:0x8192 occurs for both RTL8192E, which uses
1628 * r8192e_pci, and RTL8192SE, which uses this driver. If the
1629 * revision ID is RTL_PCI_REVISION_ID_8192PCIE (0x01), then
1630 * the correct driver is r8192e_pci, thus this routine should
1631 * return false.
1632 */
1633 if (deviceid == RTL_PCI_8192SE_DID &&
1634 revisionid == RTL_PCI_REVISION_ID_8192PCIE)
1635 return false;
1636
1627 if (deviceid == RTL_PCI_8192_DID || 1637 if (deviceid == RTL_PCI_8192_DID ||
1628 deviceid == RTL_PCI_0044_DID || 1638 deviceid == RTL_PCI_0044_DID ||
1629 deviceid == RTL_PCI_0047_DID || 1639 deviceid == RTL_PCI_0047_DID ||
@@ -1856,7 +1866,8 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev,
1856 pci_write_config_byte(pdev, 0x04, 0x07); 1866 pci_write_config_byte(pdev, 0x04, 0x07);
1857 1867
1858 /* find adapter */ 1868 /* find adapter */
1859 _rtl_pci_find_adapter(pdev, hw); 1869 if (!_rtl_pci_find_adapter(pdev, hw))
1870 goto fail3;
1860 1871
1861 /* Init IO handler */ 1872 /* Init IO handler */
1862 _rtl_pci_io_handler_init(&pdev->dev, hw); 1873 _rtl_pci_io_handler_init(&pdev->dev, hw);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
index bee7c1480f63..092e342c19df 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
@@ -53,6 +53,8 @@ MODULE_FIRMWARE("rtlwifi/rtl8192cufw.bin");
53static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw) 53static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw)
54{ 54{
55 struct rtl_priv *rtlpriv = rtl_priv(hw); 55 struct rtl_priv *rtlpriv = rtl_priv(hw);
56 const struct firmware *firmware;
57 int err;
56 58
57 rtlpriv->dm.dm_initialgain_enable = 1; 59 rtlpriv->dm.dm_initialgain_enable = 1;
58 rtlpriv->dm.dm_flag = 0; 60 rtlpriv->dm.dm_flag = 0;
@@ -64,6 +66,24 @@ static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw)
64 ("Can't alloc buffer for fw.\n")); 66 ("Can't alloc buffer for fw.\n"));
65 return 1; 67 return 1;
66 } 68 }
69 /* request fw */
70 err = request_firmware(&firmware, rtlpriv->cfg->fw_name,
71 rtlpriv->io.dev);
72 if (err) {
73 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
74 ("Failed to request firmware!\n"));
75 return 1;
76 }
77 if (firmware->size > 0x4000) {
78 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
79 ("Firmware is too big!\n"));
80 release_firmware(firmware);
81 return 1;
82 }
83 memcpy(rtlpriv->rtlhal.pfirmware, firmware->data, firmware->size);
84 rtlpriv->rtlhal.fwsize = firmware->size;
85 release_firmware(firmware);
86
67 return 0; 87 return 0;
68} 88}
69 89
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 3163330cd4f1..d3a05b9ade7a 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -608,11 +608,11 @@ int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
608 goto encrypt; 608 goto encrypt;
609 609
610auth: 610auth:
611 if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend)) 611 if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend))
612 return 0; 612 return 0;
613 613
614 hci_conn_auth(conn, sec_level, auth_type); 614 if (!hci_conn_auth(conn, sec_level, auth_type))
615 return 0; 615 return 0;
616 616
617encrypt: 617encrypt:
618 if (conn->link_mode & HCI_LM_ENCRYPT) 618 if (conn->link_mode & HCI_LM_ENCRYPT)
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index e64a1c2df238..56fdd9162da9 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -4002,21 +4002,30 @@ static int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
4002 } 4002 }
4003 } else if (sk->sk_state == BT_CONNECT2) { 4003 } else if (sk->sk_state == BT_CONNECT2) {
4004 struct l2cap_conn_rsp rsp; 4004 struct l2cap_conn_rsp rsp;
4005 __u16 result; 4005 __u16 res, stat;
4006 4006
4007 if (!status) { 4007 if (!status) {
4008 sk->sk_state = BT_CONFIG; 4008 if (bt_sk(sk)->defer_setup) {
4009 result = L2CAP_CR_SUCCESS; 4009 struct sock *parent = bt_sk(sk)->parent;
4010 res = L2CAP_CR_PEND;
4011 stat = L2CAP_CS_AUTHOR_PEND;
4012 parent->sk_data_ready(parent, 0);
4013 } else {
4014 sk->sk_state = BT_CONFIG;
4015 res = L2CAP_CR_SUCCESS;
4016 stat = L2CAP_CS_NO_INFO;
4017 }
4010 } else { 4018 } else {
4011 sk->sk_state = BT_DISCONN; 4019 sk->sk_state = BT_DISCONN;
4012 l2cap_sock_set_timer(sk, HZ / 10); 4020 l2cap_sock_set_timer(sk, HZ / 10);
4013 result = L2CAP_CR_SEC_BLOCK; 4021 res = L2CAP_CR_SEC_BLOCK;
4022 stat = L2CAP_CS_NO_INFO;
4014 } 4023 }
4015 4024
4016 rsp.scid = cpu_to_le16(chan->dcid); 4025 rsp.scid = cpu_to_le16(chan->dcid);
4017 rsp.dcid = cpu_to_le16(chan->scid); 4026 rsp.dcid = cpu_to_le16(chan->scid);
4018 rsp.result = cpu_to_le16(result); 4027 rsp.result = cpu_to_le16(res);
4019 rsp.status = cpu_to_le16(L2CAP_CS_NO_INFO); 4028 rsp.status = cpu_to_le16(stat);
4020 l2cap_send_cmd(conn, chan->ident, L2CAP_CONN_RSP, 4029 l2cap_send_cmd(conn, chan->ident, L2CAP_CONN_RSP,
4021 sizeof(rsp), &rsp); 4030 sizeof(rsp), &rsp);
4022 } 4031 }
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 29b9812c8da0..2d85ca7111d3 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -1379,8 +1379,11 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br,
1379 if (unlikely(ip_fast_csum((u8 *)iph, iph->ihl))) 1379 if (unlikely(ip_fast_csum((u8 *)iph, iph->ihl)))
1380 return -EINVAL; 1380 return -EINVAL;
1381 1381
1382 if (iph->protocol != IPPROTO_IGMP) 1382 if (iph->protocol != IPPROTO_IGMP) {
1383 if ((iph->daddr & IGMP_LOCAL_GROUP_MASK) != IGMP_LOCAL_GROUP)
1384 BR_INPUT_SKB_CB(skb)->mrouters_only = 1;
1383 return 0; 1385 return 0;
1386 }
1384 1387
1385 len = ntohs(iph->tot_len); 1388 len = ntohs(iph->tot_len);
1386 if (skb->len < len || len < ip_hdrlen(skb)) 1389 if (skb->len < len || len < ip_hdrlen(skb))
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index a8024eaa0e87..4a7e16b5d3f3 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -802,8 +802,6 @@ static int __ip_append_data(struct sock *sk,
802 skb = skb_peek_tail(queue); 802 skb = skb_peek_tail(queue);
803 803
804 exthdrlen = !skb ? rt->dst.header_len : 0; 804 exthdrlen = !skb ? rt->dst.header_len : 0;
805 length += exthdrlen;
806 transhdrlen += exthdrlen;
807 mtu = cork->fragsize; 805 mtu = cork->fragsize;
808 806
809 hh_len = LL_RESERVED_SPACE(rt->dst.dev); 807 hh_len = LL_RESERVED_SPACE(rt->dst.dev);
@@ -883,17 +881,16 @@ alloc_new_skb:
883 else 881 else
884 alloclen = fraglen; 882 alloclen = fraglen;
885 883
884 alloclen += exthdrlen;
885
886 /* The last fragment gets additional space at tail. 886 /* The last fragment gets additional space at tail.
887 * Note, with MSG_MORE we overallocate on fragments, 887 * Note, with MSG_MORE we overallocate on fragments,
888 * because we have no idea what fragment will be 888 * because we have no idea what fragment will be
889 * the last. 889 * the last.
890 */ 890 */
891 if (datalen == length + fraggap) { 891 if (datalen == length + fraggap)
892 alloclen += rt->dst.trailer_len; 892 alloclen += rt->dst.trailer_len;
893 /* make sure mtu is not reached */ 893
894 if (datalen > mtu - fragheaderlen - rt->dst.trailer_len)
895 datalen -= ALIGN(rt->dst.trailer_len, 8);
896 }
897 if (transhdrlen) { 894 if (transhdrlen) {
898 skb = sock_alloc_send_skb(sk, 895 skb = sock_alloc_send_skb(sk,
899 alloclen + hh_len + 15, 896 alloclen + hh_len + 15,
@@ -926,11 +923,11 @@ alloc_new_skb:
926 /* 923 /*
927 * Find where to start putting bytes. 924 * Find where to start putting bytes.
928 */ 925 */
929 data = skb_put(skb, fraglen); 926 data = skb_put(skb, fraglen + exthdrlen);
930 skb_set_network_header(skb, exthdrlen); 927 skb_set_network_header(skb, exthdrlen);
931 skb->transport_header = (skb->network_header + 928 skb->transport_header = (skb->network_header +
932 fragheaderlen); 929 fragheaderlen);
933 data += fragheaderlen; 930 data += fragheaderlen + exthdrlen;
934 931
935 if (fraggap) { 932 if (fraggap) {
936 skb->csum = skb_copy_and_csum_bits( 933 skb->csum = skb_copy_and_csum_bits(
@@ -1064,7 +1061,7 @@ static int ip_setup_cork(struct sock *sk, struct inet_cork *cork,
1064 */ 1061 */
1065 *rtp = NULL; 1062 *rtp = NULL;
1066 cork->fragsize = inet->pmtudisc == IP_PMTUDISC_PROBE ? 1063 cork->fragsize = inet->pmtudisc == IP_PMTUDISC_PROBE ?
1067 rt->dst.dev->mtu : dst_mtu(rt->dst.path); 1064 rt->dst.dev->mtu : dst_mtu(&rt->dst);
1068 cork->dst = &rt->dst; 1065 cork->dst = &rt->dst;
1069 cork->length = 0; 1066 cork->length = 0;
1070 cork->tx_flags = ipc->tx_flags; 1067 cork->tx_flags = ipc->tx_flags;
diff --git a/net/ipv4/netfilter.c b/net/ipv4/netfilter.c
index 4614babdc45f..2e97e3ec1eb7 100644
--- a/net/ipv4/netfilter.c
+++ b/net/ipv4/netfilter.c
@@ -17,51 +17,35 @@ int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type)
17 const struct iphdr *iph = ip_hdr(skb); 17 const struct iphdr *iph = ip_hdr(skb);
18 struct rtable *rt; 18 struct rtable *rt;
19 struct flowi4 fl4 = {}; 19 struct flowi4 fl4 = {};
20 unsigned long orefdst; 20 __be32 saddr = iph->saddr;
21 __u8 flags = 0;
21 unsigned int hh_len; 22 unsigned int hh_len;
22 unsigned int type;
23 23
24 type = inet_addr_type(net, iph->saddr); 24 if (!skb->sk && addr_type != RTN_LOCAL) {
25 if (skb->sk && inet_sk(skb->sk)->transparent) 25 if (addr_type == RTN_UNSPEC)
26 type = RTN_LOCAL; 26 addr_type = inet_addr_type(net, saddr);
27 if (addr_type == RTN_UNSPEC) 27 if (addr_type == RTN_LOCAL || addr_type == RTN_UNICAST)
28 addr_type = type; 28 flags |= FLOWI_FLAG_ANYSRC;
29 else
30 saddr = 0;
31 }
29 32
30 /* some non-standard hacks like ipt_REJECT.c:send_reset() can cause 33 /* some non-standard hacks like ipt_REJECT.c:send_reset() can cause
31 * packets with foreign saddr to appear on the NF_INET_LOCAL_OUT hook. 34 * packets with foreign saddr to appear on the NF_INET_LOCAL_OUT hook.
32 */ 35 */
33 if (addr_type == RTN_LOCAL) { 36 fl4.daddr = iph->daddr;
34 fl4.daddr = iph->daddr; 37 fl4.saddr = saddr;
35 if (type == RTN_LOCAL) 38 fl4.flowi4_tos = RT_TOS(iph->tos);
36 fl4.saddr = iph->saddr; 39 fl4.flowi4_oif = skb->sk ? skb->sk->sk_bound_dev_if : 0;
37 fl4.flowi4_tos = RT_TOS(iph->tos); 40 fl4.flowi4_mark = skb->mark;
38 fl4.flowi4_oif = skb->sk ? skb->sk->sk_bound_dev_if : 0; 41 fl4.flowi4_flags = skb->sk ? inet_sk_flowi_flags(skb->sk) : flags;
39 fl4.flowi4_mark = skb->mark; 42 rt = ip_route_output_key(net, &fl4);
40 fl4.flowi4_flags = skb->sk ? inet_sk_flowi_flags(skb->sk) : 0; 43 if (IS_ERR(rt))
41 rt = ip_route_output_key(net, &fl4); 44 return -1;
42 if (IS_ERR(rt))
43 return -1;
44
45 /* Drop old route. */
46 skb_dst_drop(skb);
47 skb_dst_set(skb, &rt->dst);
48 } else {
49 /* non-local src, find valid iif to satisfy
50 * rp-filter when calling ip_route_input. */
51 fl4.daddr = iph->saddr;
52 rt = ip_route_output_key(net, &fl4);
53 if (IS_ERR(rt))
54 return -1;
55 45
56 orefdst = skb->_skb_refdst; 46 /* Drop old route. */
57 if (ip_route_input(skb, iph->daddr, iph->saddr, 47 skb_dst_drop(skb);
58 RT_TOS(iph->tos), rt->dst.dev) != 0) { 48 skb_dst_set(skb, &rt->dst);
59 dst_release(&rt->dst);
60 return -1;
61 }
62 dst_release(&rt->dst);
63 refdst_drop(orefdst);
64 }
65 49
66 if (skb_dst(skb)->error) 50 if (skb_dst(skb)->error)
67 return -1; 51 return -1;
diff --git a/net/ipv4/netfilter/ipt_REJECT.c b/net/ipv4/netfilter/ipt_REJECT.c
index 1ff79e557f96..51f13f8ec724 100644
--- a/net/ipv4/netfilter/ipt_REJECT.c
+++ b/net/ipv4/netfilter/ipt_REJECT.c
@@ -40,7 +40,6 @@ static void send_reset(struct sk_buff *oldskb, int hook)
40 struct iphdr *niph; 40 struct iphdr *niph;
41 const struct tcphdr *oth; 41 const struct tcphdr *oth;
42 struct tcphdr _otcph, *tcph; 42 struct tcphdr _otcph, *tcph;
43 unsigned int addr_type;
44 43
45 /* IP header checks: fragment. */ 44 /* IP header checks: fragment. */
46 if (ip_hdr(oldskb)->frag_off & htons(IP_OFFSET)) 45 if (ip_hdr(oldskb)->frag_off & htons(IP_OFFSET))
@@ -55,6 +54,9 @@ static void send_reset(struct sk_buff *oldskb, int hook)
55 if (oth->rst) 54 if (oth->rst)
56 return; 55 return;
57 56
57 if (skb_rtable(oldskb)->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST))
58 return;
59
58 /* Check checksum */ 60 /* Check checksum */
59 if (nf_ip_checksum(oldskb, hook, ip_hdrlen(oldskb), IPPROTO_TCP)) 61 if (nf_ip_checksum(oldskb, hook, ip_hdrlen(oldskb), IPPROTO_TCP))
60 return; 62 return;
@@ -101,19 +103,11 @@ static void send_reset(struct sk_buff *oldskb, int hook)
101 nskb->csum_start = (unsigned char *)tcph - nskb->head; 103 nskb->csum_start = (unsigned char *)tcph - nskb->head;
102 nskb->csum_offset = offsetof(struct tcphdr, check); 104 nskb->csum_offset = offsetof(struct tcphdr, check);
103 105
104 addr_type = RTN_UNSPEC;
105 if (hook != NF_INET_FORWARD
106#ifdef CONFIG_BRIDGE_NETFILTER
107 || (nskb->nf_bridge && nskb->nf_bridge->mask & BRNF_BRIDGED)
108#endif
109 )
110 addr_type = RTN_LOCAL;
111
112 /* ip_route_me_harder expects skb->dst to be set */ 106 /* ip_route_me_harder expects skb->dst to be set */
113 skb_dst_set_noref(nskb, skb_dst(oldskb)); 107 skb_dst_set_noref(nskb, skb_dst(oldskb));
114 108
115 nskb->protocol = htons(ETH_P_IP); 109 nskb->protocol = htons(ETH_P_IP);
116 if (ip_route_me_harder(nskb, addr_type)) 110 if (ip_route_me_harder(nskb, RTN_UNSPEC))
117 goto free_nskb; 111 goto free_nskb;
118 112
119 niph->ttl = ip4_dst_hoplimit(skb_dst(nskb)); 113 niph->ttl = ip4_dst_hoplimit(skb_dst(nskb));
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index abca870d8ff6..48cd88e62553 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1249,6 +1249,9 @@ csum_copy_err:
1249 1249
1250 if (noblock) 1250 if (noblock)
1251 return -EAGAIN; 1251 return -EAGAIN;
1252
1253 /* starting over for a new packet */
1254 msg->msg_flags &= ~MSG_TRUNC;
1252 goto try_again; 1255 goto try_again;
1253} 1256}
1254 1257
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 41f8c9c08dba..328985c40883 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -453,8 +453,11 @@ csum_copy_err:
453 } 453 }
454 unlock_sock_fast(sk, slow); 454 unlock_sock_fast(sk, slow);
455 455
456 if (flags & MSG_DONTWAIT) 456 if (noblock)
457 return -EAGAIN; 457 return -EAGAIN;
458
459 /* starting over for a new packet */
460 msg->msg_flags &= ~MSG_TRUNC;
458 goto try_again; 461 goto try_again;
459} 462}
460 463