Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (24 commits)
usbnet: Remove over-broad module alias from zaurus.
MAINTAINERS: drop Michael from bfin_mac driver
net/can: activate bit-timing calculation and netlink based drivers by default
rionet: fix NULL pointer dereference in rionet_remove
net+crypto: Use vmalloc for zlib inflate buffers.
netfilter: Fix ip_route_me_harder triggering ip_rt_bug
ipv4: Fix IPsec slowpath fragmentation problem
ipv4: Fix packet size calculation in __ip_append_data
cxgb3: skb_record_rx_queue now records the queue index relative to the net_device.
bridge: Only flood unregistered groups to routers
qlge: Add maintainer.
MAINTAINERS: mark socketcan-core lists as subscribers-only
MAINTAINERS: Remove Sven Eckelmann from BATMAN ADVANCED
r8169: fix wrong register use.
net/usb/kalmia: signedness bug in kalmia_bind()
net/usb: kalmia: Various fixes for better support of non-x86 architectures.
rtl8192cu: Fix missing firmware load
udp/recvmsg: Clear MSG_TRUNC flag when starting over for a new packet
ipv6/udp: Use the correct variable to determine non-blocking condition
netconsole: fix build when CONFIG_NETCONSOLE_DYNAMIC is turned on
...

+155 -134
+3 -4
MAINTAINERS
··· 1392 1392 BATMAN ADVANCED 1393 1393 M: Marek Lindner <lindner_marek@yahoo.de> 1394 1394 M: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> 1395 - M: Sven Eckelmann <sven@narfation.org> 1396 1395 L: b.a.t.m.a.n@lists.open-mesh.org 1397 1396 W: http://www.open-mesh.org/ 1398 1397 S: Maintained ··· 1424 1425 F: arch/blackfin/ 1425 1426 1426 1427 BLACKFIN EMAC DRIVER 1427 - M: Michael Hennerich <michael.hennerich@analog.com> 1428 1428 L: uclinux-dist-devel@blackfin.uclinux.org 1429 1429 W: http://blackfin.uclinux.org 1430 1430 S: Supported ··· 1639 1641 M: Oliver Hartkopp <socketcan@hartkopp.net> 1640 1642 M: Oliver Hartkopp <oliver.hartkopp@volkswagen.de> 1641 1643 M: Urs Thuermann <urs.thuermann@volkswagen.de> 1642 - L: socketcan-core@lists.berlios.de 1644 + L: socketcan-core@lists.berlios.de (subscribers-only) 1643 1645 L: netdev@vger.kernel.org 1644 1646 W: http://developer.berlios.de/projects/socketcan/ 1645 1647 S: Maintained ··· 1651 1653 1652 1654 CAN NETWORK DRIVERS 1653 1655 M: Wolfgang Grandegger <wg@grandegger.com> 1654 - L: socketcan-core@lists.berlios.de 1656 + L: socketcan-core@lists.berlios.de (subscribers-only) 1655 1657 L: netdev@vger.kernel.org 1656 1658 W: http://developer.berlios.de/projects/socketcan/ 1657 1659 S: Maintained ··· 5181 5183 F: drivers/net/qlcnic/ 5182 5184 5183 5185 QLOGIC QLGE 10Gb ETHERNET DRIVER 5186 + M: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com> 5184 5187 M: Ron Mercer <ron.mercer@qlogic.com> 5185 5188 M: linux-driver@qlogic.com 5186 5189 L: netdev@vger.kernel.org
+3 -4
crypto/deflate.c
··· 32 32 #include <linux/interrupt.h> 33 33 #include <linux/mm.h> 34 34 #include <linux/net.h> 35 - #include <linux/slab.h> 36 35 37 36 #define DEFLATE_DEF_LEVEL Z_DEFAULT_COMPRESSION 38 37 #define DEFLATE_DEF_WINBITS 11 ··· 72 73 int ret = 0; 73 74 struct z_stream_s *stream = &ctx->decomp_stream; 74 75 75 - stream->workspace = kzalloc(zlib_inflate_workspacesize(), GFP_KERNEL); 76 + stream->workspace = vzalloc(zlib_inflate_workspacesize()); 76 77 if (!stream->workspace) { 77 78 ret = -ENOMEM; 78 79 goto out; ··· 85 86 out: 86 87 return ret; 87 88 out_free: 88 - kfree(stream->workspace); 89 + vfree(stream->workspace); 89 90 goto out; 90 91 } 91 92 ··· 98 99 static void deflate_decomp_exit(struct deflate_ctx *ctx) 99 100 { 100 101 zlib_inflateEnd(&ctx->decomp_stream); 101 - kfree(ctx->decomp_stream.workspace); 102 + vfree(ctx->decomp_stream.workspace); 102 103 } 103 104 104 105 static int deflate_init(struct crypto_tfm *tfm)
+3 -4
crypto/zlib.c
··· 29 29 #include <linux/interrupt.h> 30 30 #include <linux/mm.h> 31 31 #include <linux/net.h> 32 - #include <linux/slab.h> 33 32 34 33 #include <crypto/internal/compress.h> 35 34 ··· 59 60 60 61 if (stream->workspace) { 61 62 zlib_inflateEnd(stream); 62 - kfree(stream->workspace); 63 + vfree(stream->workspace); 63 64 stream->workspace = NULL; 64 65 } 65 66 } ··· 227 228 ? nla_get_u32(tb[ZLIB_DECOMP_WINDOWBITS]) 228 229 : DEF_WBITS; 229 230 230 - stream->workspace = kzalloc(zlib_inflate_workspacesize(), GFP_KERNEL); 231 + stream->workspace = vzalloc(zlib_inflate_workspacesize()); 231 232 if (!stream->workspace) 232 233 return -ENOMEM; 233 234 234 235 ret = zlib_inflateInit2(stream, ctx->decomp_windowBits); 235 236 if (ret != Z_OK) { 236 - kfree(stream->workspace); 237 + vfree(stream->workspace); 237 238 stream->workspace = NULL; 238 239 return -EINVAL; 239 240 }
+2 -1
drivers/net/Kconfig
··· 3416 3416 3417 3417 config NETCONSOLE_DYNAMIC 3418 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 3421 help 3421 3422 This option enables the ability to dynamically reconfigure target 3422 3423 parameters (interface, IP addresses, port numbers, MAC addresses)
+3 -3
drivers/net/bnx2x/bnx2x_main.c
··· 49 49 #include <linux/zlib.h> 50 50 #include <linux/io.h> 51 51 #include <linux/stringify.h> 52 + #include <linux/vmalloc.h> 52 53 53 54 #define BNX2X_MAIN 54 55 #include "bnx2x.h" ··· 4538 4537 if (bp->strm == NULL) 4539 4538 goto gunzip_nomem2; 4540 4539 4541 - bp->strm->workspace = kmalloc(zlib_inflate_workspacesize(), 4542 - GFP_KERNEL); 4540 + bp->strm->workspace = vmalloc(zlib_inflate_workspacesize()); 4543 4541 if (bp->strm->workspace == NULL) 4544 4542 goto gunzip_nomem3; 4545 4543 ··· 4562 4562 static void bnx2x_gunzip_end(struct bnx2x *bp) 4563 4563 { 4564 4564 if (bp->strm) { 4565 - kfree(bp->strm->workspace); 4565 + vfree(bp->strm->workspace); 4566 4566 kfree(bp->strm); 4567 4567 bp->strm = NULL; 4568 4568 }
+2 -2
drivers/net/can/Kconfig
··· 36 36 config CAN_DEV 37 37 tristate "Platform CAN drivers with Netlink support" 38 38 depends on CAN 39 - default Y 39 + default y 40 40 ---help--- 41 41 Enables the common framework for platform CAN drivers with Netlink 42 42 support. This is the standard library for CAN drivers. ··· 45 45 config CAN_CALC_BITTIMING 46 46 bool "CAN bit-timing calculation" 47 47 depends on CAN_DEV 48 - default Y 48 + default y 49 49 ---help--- 50 50 If enabled, CAN bit-timing parameters will be calculated for the 51 51 bit-rate specified via Netlink argument "bitrate" when the device
+2 -2
drivers/net/cxgb3/sge.c
··· 2026 2026 skb->ip_summed = CHECKSUM_UNNECESSARY; 2027 2027 } else 2028 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 2031 if (unlikely(p->vlan_valid)) { 2032 2032 struct vlan_group *grp = pi->vlan_grp; ··· 2145 2145 if (!complete) 2146 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 2150 if (unlikely(cpl->vlan_valid)) { 2151 2151 struct vlan_group *grp = pi->vlan_grp;
+2 -3
drivers/net/ppp_deflate.c
··· 305 305 306 306 if (state) { 307 307 zlib_inflateEnd(&state->strm); 308 - kfree(state->strm.workspace); 308 + vfree(state->strm.workspace); 309 309 kfree(state); 310 310 } 311 311 } ··· 345 345 346 346 state->w_size = w_size; 347 347 state->strm.next_out = NULL; 348 - state->strm.workspace = kmalloc(zlib_inflate_workspacesize(), 349 - GFP_KERNEL|__GFP_REPEAT); 348 + state->strm.workspace = vmalloc(zlib_inflate_workspacesize()); 350 349 if (state->strm.workspace == NULL) 351 350 goto out_free; 352 351
+1 -1
drivers/net/r8169.c
··· 742 742 msleep(2); 743 743 for (i = 0; i < 5; i++) { 744 744 udelay(100); 745 - if (!(RTL_R32(ERIDR) & ERIAR_FLAG)) 745 + if (!(RTL_R32(ERIAR) & ERIAR_FLAG)) 746 746 break; 747 747 } 748 748
+15 -13
drivers/net/rionet.c
··· 378 378 379 379 static 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 382 struct rionet_peer *peer, *tmp; 383 383 384 384 free_pages((unsigned long)rionet_active, rdev->net->hport->sys_size ? ··· 433 433 .ndo_set_mac_address = eth_mac_addr, 434 434 }; 435 435 436 - static int rionet_setup_netdev(struct rio_mport *mport) 436 + static int rionet_setup_netdev(struct rio_mport *mport, struct net_device *ndev) 437 437 { 438 438 int rc = 0; 439 - struct net_device *ndev = NULL; 440 439 struct rionet_private *rnet; 441 440 u16 device_id; 442 - 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 441 452 442 rionet_active = (struct rio_dev **)__get_free_pages(GFP_KERNEL, 453 443 mport->sys_size ? __fls(sizeof(void *)) + 4 : 0); ··· 494 504 int rc = -ENODEV; 495 505 u32 lpef, lsrc_ops, ldst_ops; 496 506 struct rionet_peer *peer; 507 + struct net_device *ndev = NULL; 497 508 498 509 /* If local device is not rionet capable, give up quickly */ 499 510 if (!rionet_capable) 500 511 goto out; 512 + 513 + /* Allocate our net_device structure */ 514 + ndev = alloc_etherdev(sizeof(struct rionet_private)); 515 + if (ndev == NULL) { 516 + printk(KERN_INFO "%s: could not allocate ethernet device.\n", 517 + DRV_NAME); 518 + rc = -ENOMEM; 519 + goto out; 520 + } 501 521 502 522 /* 503 523 * First time through, make sure local device is rionet ··· 529 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 533 rionet_check = 1; 534 534 } 535 535 ··· 545 545 peer->rdev = rdev; 546 546 list_add_tail(&peer->node, &rionet_peers); 547 547 } 548 + 549 + rio_set_drvdata(rdev, ndev); 548 550 549 551 out: 550 552 return rc;
+25 -17
drivers/net/usb/kalmia.c
··· 100 100 static int 101 101 kalmia_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 104 { 0x57, 0x50, 0x04, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 105 105 0x00, 0x00 }; 106 - char init_msg_2[] = 106 + const static char init_msg_2[] = 107 107 { 0x57, 0x50, 0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf4, 108 108 0x00, 0x00 }; 109 - char receive_buf[28]; 109 + const static int buflen = 28; 110 + char *usb_buf; 110 111 int status; 111 112 112 - status = kalmia_send_init_packet(dev, init_msg_1, sizeof(init_msg_1) 113 - / sizeof(init_msg_1[0]), receive_buf, 24); 113 + usb_buf = kmalloc(buflen, GFP_DMA | GFP_KERNEL); 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 120 if (status != 0) 115 121 return status; 116 122 117 - status = kalmia_send_init_packet(dev, init_msg_2, sizeof(init_msg_2) 118 - / sizeof(init_msg_2[0]), receive_buf, 28); 123 + memcpy(usb_buf, init_msg_2, 12); 124 + status = kalmia_send_init_packet(dev, usb_buf, sizeof(init_msg_2) 125 + / sizeof(init_msg_2[0]), usb_buf, 28); 119 126 if (status != 0) 120 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 132 return status; 125 133 } 126 134 127 135 static int 128 136 kalmia_bind(struct usbnet *dev, struct usb_interface *intf) 129 137 { 130 - u8 status; 138 + int status; 131 139 u8 ethernet_addr[ETH_ALEN]; 132 140 133 141 /* Don't bind to AT command interface */ ··· 198 190 dev_kfree_skb_any(skb); 199 191 skb = skb2; 200 192 201 - done: header_start = skb_push(skb, KALMIA_HEADER_LENGTH); 193 + done: 194 + header_start = skb_push(skb, KALMIA_HEADER_LENGTH); 202 195 ether_type_1 = header_start[KALMIA_HEADER_LENGTH + 12]; 203 196 ether_type_2 = header_start[KALMIA_HEADER_LENGTH + 13]; 204 197 ··· 210 201 header_start[0] = 0x57; 211 202 header_start[1] = 0x44; 212 203 content_len = skb->len - KALMIA_HEADER_LENGTH; 213 - header_start[2] = (content_len & 0xff); /* low byte */ 214 - header_start[3] = (content_len >> 8); /* high byte */ 215 204 205 + put_unaligned_le16(content_len, &header_start[2]); 216 206 header_start[4] = ether_type_1; 217 207 header_start[5] = ether_type_2; 218 208 ··· 239 231 * Our task here is to strip off framing, leaving skb with one 240 232 * data frame for the usbnet framework code to process. 241 233 */ 242 - const u8 HEADER_END_OF_USB_PACKET[] = 234 + const static u8 HEADER_END_OF_USB_PACKET[] = 243 235 { 0x57, 0x5a, 0x00, 0x00, 0x08, 0x00 }; 244 - const u8 EXPECTED_UNKNOWN_HEADER_1[] = 236 + const static u8 EXPECTED_UNKNOWN_HEADER_1[] = 245 237 { 0x57, 0x43, 0x1e, 0x00, 0x15, 0x02 }; 246 - const u8 EXPECTED_UNKNOWN_HEADER_2[] = 238 + const static u8 EXPECTED_UNKNOWN_HEADER_2[] = 247 239 { 0x57, 0x50, 0x0e, 0x00, 0x00, 0x00 }; 248 - u8 i = 0; 240 + int i = 0; 249 241 250 242 /* incomplete header? */ 251 243 if (skb->len < KALMIA_HEADER_LENGTH) ··· 293 285 294 286 /* subtract start header and end header */ 295 287 usb_packet_length = skb->len - (2 * KALMIA_HEADER_LENGTH); 296 - ether_packet_length = header_start[2] + (header_start[3] << 8); 288 + ether_packet_length = get_unaligned_le16(&header_start[2]); 297 289 skb_pull(skb, KALMIA_HEADER_LENGTH); 298 290 299 291 /* Some small packets misses end marker */
-10
drivers/net/usb/zaurus.c
··· 331 331 ZAURUS_MASTER_INTERFACE, 332 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 335 /* Motorola MOTOMAGX phones */ 346 336 USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x6425, USB_CLASS_COMM, 347 337 USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
+12 -1
drivers/net/wireless/rtlwifi/pci.c
··· 1624 1624 pci_read_config_byte(pdev, 0x8, &revisionid); 1625 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 1637 if (deviceid == RTL_PCI_8192_DID || 1628 1638 deviceid == RTL_PCI_0044_DID || 1629 1639 deviceid == RTL_PCI_0047_DID || ··· 1866 1856 pci_write_config_byte(pdev, 0x04, 0x07); 1867 1857 1868 1858 /* find adapter */ 1869 - _rtl_pci_find_adapter(pdev, hw); 1859 + if (!_rtl_pci_find_adapter(pdev, hw)) 1860 + goto fail3; 1870 1861 1871 1862 /* Init IO handler */ 1872 1863 _rtl_pci_io_handler_init(&pdev->dev, hw);
+20
drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
··· 53 53 static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw) 54 54 { 55 55 struct rtl_priv *rtlpriv = rtl_priv(hw); 56 + const struct firmware *firmware; 57 + int err; 56 58 57 59 rtlpriv->dm.dm_initialgain_enable = 1; 58 60 rtlpriv->dm.dm_flag = 0; ··· 66 64 ("Can't alloc buffer for fw.\n")); 67 65 return 1; 68 66 } 67 + /* request fw */ 68 + err = request_firmware(&firmware, rtlpriv->cfg->fw_name, 69 + rtlpriv->io.dev); 70 + if (err) { 71 + RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 72 + ("Failed to request firmware!\n")); 73 + return 1; 74 + } 75 + if (firmware->size > 0x4000) { 76 + RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 77 + ("Firmware is too big!\n")); 78 + release_firmware(firmware); 79 + return 1; 80 + } 81 + memcpy(rtlpriv->rtlhal.pfirmware, firmware->data, firmware->size); 82 + rtlpriv->rtlhal.fwsize = firmware->size; 83 + release_firmware(firmware); 84 + 69 85 return 0; 70 86 } 71 87
+3 -3
net/bluetooth/hci_conn.c
··· 608 608 goto encrypt; 609 609 610 610 auth: 611 - if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend)) 611 + if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend)) 612 612 return 0; 613 613 614 - hci_conn_auth(conn, sec_level, auth_type); 615 - return 0; 614 + if (!hci_conn_auth(conn, sec_level, auth_type)) 615 + return 0; 616 616 617 617 encrypt: 618 618 if (conn->link_mode & HCI_LM_ENCRYPT)
+15 -6
net/bluetooth/l2cap_core.c
··· 4002 4002 } 4003 4003 } else if (sk->sk_state == BT_CONNECT2) { 4004 4004 struct l2cap_conn_rsp rsp; 4005 - __u16 result; 4005 + __u16 res, stat; 4006 4006 4007 4007 if (!status) { 4008 - sk->sk_state = BT_CONFIG; 4009 - result = L2CAP_CR_SUCCESS; 4008 + if (bt_sk(sk)->defer_setup) { 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 4018 } else { 4011 4019 sk->sk_state = BT_DISCONN; 4012 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 4025 rsp.scid = cpu_to_le16(chan->dcid); 4017 4026 rsp.dcid = cpu_to_le16(chan->scid); 4018 - rsp.result = cpu_to_le16(result); 4019 - rsp.status = cpu_to_le16(L2CAP_CS_NO_INFO); 4027 + rsp.result = cpu_to_le16(res); 4028 + rsp.status = cpu_to_le16(stat); 4020 4029 l2cap_send_cmd(conn, chan->ident, L2CAP_CONN_RSP, 4021 4030 sizeof(rsp), &rsp); 4022 4031 }
+4 -1
net/bridge/br_multicast.c
··· 1379 1379 if (unlikely(ip_fast_csum((u8 *)iph, iph->ihl))) 1380 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 1385 return 0; 1386 + } 1384 1387 1385 1388 len = ntohs(iph->tot_len); 1386 1389 if (skb->len < len || len < ip_hdrlen(skb))
+7 -10
net/ipv4/ip_output.c
··· 802 802 skb = skb_peek_tail(queue); 803 803 804 804 exthdrlen = !skb ? rt->dst.header_len : 0; 805 - length += exthdrlen; 806 - transhdrlen += exthdrlen; 807 805 mtu = cork->fragsize; 808 806 809 807 hh_len = LL_RESERVED_SPACE(rt->dst.dev); ··· 881 883 else 882 884 alloclen = fraglen; 883 885 886 + alloclen += exthdrlen; 887 + 884 888 /* The last fragment gets additional space at tail. 885 889 * Note, with MSG_MORE we overallocate on fragments, 886 890 * because we have no idea what fragment will be 887 891 * the last. 888 892 */ 889 - if (datalen == length + fraggap) { 893 + if (datalen == length + fraggap) 890 894 alloclen += rt->dst.trailer_len; 891 - /* make sure mtu is not reached */ 892 - if (datalen > mtu - fragheaderlen - rt->dst.trailer_len) 893 - datalen -= ALIGN(rt->dst.trailer_len, 8); 894 - } 895 + 895 896 if (transhdrlen) { 896 897 skb = sock_alloc_send_skb(sk, 897 898 alloclen + hh_len + 15, ··· 923 926 /* 924 927 * Find where to start putting bytes. 925 928 */ 926 - data = skb_put(skb, fraglen); 929 + data = skb_put(skb, fraglen + exthdrlen); 927 930 skb_set_network_header(skb, exthdrlen); 928 931 skb->transport_header = (skb->network_header + 929 932 fragheaderlen); 930 - data += fragheaderlen; 933 + data += fragheaderlen + exthdrlen; 931 934 932 935 if (fraggap) { 933 936 skb->csum = skb_copy_and_csum_bits( ··· 1061 1064 */ 1062 1065 *rtp = NULL; 1063 1066 cork->fragsize = inet->pmtudisc == IP_PMTUDISC_PROBE ? 1064 - rt->dst.dev->mtu : dst_mtu(rt->dst.path); 1067 + rt->dst.dev->mtu : dst_mtu(&rt->dst); 1065 1068 cork->dst = &rt->dst; 1066 1069 cork->length = 0; 1067 1070 cork->tx_flags = ipc->tx_flags;
+22 -38
net/ipv4/netfilter.c
··· 17 17 const struct iphdr *iph = ip_hdr(skb); 18 18 struct rtable *rt; 19 19 struct flowi4 fl4 = {}; 20 - unsigned long orefdst; 20 + __be32 saddr = iph->saddr; 21 + __u8 flags = 0; 21 22 unsigned int hh_len; 22 - unsigned int type; 23 23 24 - type = inet_addr_type(net, iph->saddr); 25 - if (skb->sk && inet_sk(skb->sk)->transparent) 26 - type = RTN_LOCAL; 27 - if (addr_type == RTN_UNSPEC) 28 - addr_type = type; 24 + if (!skb->sk && addr_type != RTN_LOCAL) { 25 + if (addr_type == RTN_UNSPEC) 26 + addr_type = inet_addr_type(net, saddr); 27 + if (addr_type == RTN_LOCAL || addr_type == RTN_UNICAST) 28 + flags |= FLOWI_FLAG_ANYSRC; 29 + else 30 + saddr = 0; 31 + } 29 32 30 33 /* some non-standard hacks like ipt_REJECT.c:send_reset() can cause 31 34 * packets with foreign saddr to appear on the NF_INET_LOCAL_OUT hook. 32 35 */ 33 - if (addr_type == RTN_LOCAL) { 34 - fl4.daddr = iph->daddr; 35 - if (type == RTN_LOCAL) 36 - fl4.saddr = iph->saddr; 37 - fl4.flowi4_tos = RT_TOS(iph->tos); 38 - fl4.flowi4_oif = skb->sk ? skb->sk->sk_bound_dev_if : 0; 39 - fl4.flowi4_mark = skb->mark; 40 - fl4.flowi4_flags = skb->sk ? inet_sk_flowi_flags(skb->sk) : 0; 41 - rt = ip_route_output_key(net, &fl4); 42 - if (IS_ERR(rt)) 43 - return -1; 36 + fl4.daddr = iph->daddr; 37 + fl4.saddr = saddr; 38 + fl4.flowi4_tos = RT_TOS(iph->tos); 39 + fl4.flowi4_oif = skb->sk ? skb->sk->sk_bound_dev_if : 0; 40 + fl4.flowi4_mark = skb->mark; 41 + fl4.flowi4_flags = skb->sk ? inet_sk_flowi_flags(skb->sk) : flags; 42 + rt = ip_route_output_key(net, &fl4); 43 + if (IS_ERR(rt)) 44 + return -1; 44 45 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 - 56 - orefdst = skb->_skb_refdst; 57 - if (ip_route_input(skb, iph->daddr, iph->saddr, 58 - RT_TOS(iph->tos), rt->dst.dev) != 0) { 59 - dst_release(&rt->dst); 60 - return -1; 61 - } 62 - dst_release(&rt->dst); 63 - refdst_drop(orefdst); 64 - } 46 + /* Drop old route. */ 47 + skb_dst_drop(skb); 48 + skb_dst_set(skb, &rt->dst); 65 49 66 50 if (skb_dst(skb)->error) 67 51 return -1;
+4 -10
net/ipv4/netfilter/ipt_REJECT.c
··· 40 40 struct iphdr *niph; 41 41 const struct tcphdr *oth; 42 42 struct tcphdr _otcph, *tcph; 43 - unsigned int addr_type; 44 43 45 44 /* IP header checks: fragment. */ 46 45 if (ip_hdr(oldskb)->frag_off & htons(IP_OFFSET)) ··· 52 53 53 54 /* No RST for RST. */ 54 55 if (oth->rst) 56 + return; 57 + 58 + if (skb_rtable(oldskb)->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST)) 55 59 return; 56 60 57 61 /* Check checksum */ ··· 103 101 nskb->csum_start = (unsigned char *)tcph - nskb->head; 104 102 nskb->csum_offset = offsetof(struct tcphdr, check); 105 103 106 - addr_type = RTN_UNSPEC; 107 - if (hook != NF_INET_FORWARD 108 - #ifdef CONFIG_BRIDGE_NETFILTER 109 - || (nskb->nf_bridge && nskb->nf_bridge->mask & BRNF_BRIDGED) 110 - #endif 111 - ) 112 - addr_type = RTN_LOCAL; 113 - 114 104 /* ip_route_me_harder expects skb->dst to be set */ 115 105 skb_dst_set_noref(nskb, skb_dst(oldskb)); 116 106 117 107 nskb->protocol = htons(ETH_P_IP); 118 - if (ip_route_me_harder(nskb, addr_type)) 108 + if (ip_route_me_harder(nskb, RTN_UNSPEC)) 119 109 goto free_nskb; 120 110 121 111 niph->ttl = ip4_dst_hoplimit(skb_dst(nskb));
+3
net/ipv4/udp.c
··· 1249 1249 1250 1250 if (noblock) 1251 1251 return -EAGAIN; 1252 + 1253 + /* starting over for a new packet */ 1254 + msg->msg_flags &= ~MSG_TRUNC; 1252 1255 goto try_again; 1253 1256 } 1254 1257
+4 -1
net/ipv6/udp.c
··· 453 453 } 454 454 unlock_sock_fast(sk, slow); 455 455 456 - if (flags & MSG_DONTWAIT) 456 + if (noblock) 457 457 return -EAGAIN; 458 + 459 + /* starting over for a new packet */ 460 + msg->msg_flags &= ~MSG_TRUNC; 458 461 goto try_again; 459 462 } 460 463