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

Pull networking fixes from David Miller:

1) nft_compat accidently truncates ethernet protocol to 8-bits, from
Arturo Borrero.

2) Memory leak in ip_vs_proc_conn(), from Julian Anastasov.

3) Don't allow the space required for nftables rules to exceed the
maximum value representable in the dlen field. From Patrick
McHardy.

4) bcm63xx_enet can accidently leave interrupts permanently disabled
due to errors in the NAPI polling exit logic. Fix from Nicolas
Schichan.

5) Fix OOPSes triggerable by the ping protocol module, due to missing
address family validations etc. From Lorenzo Colitti.

6) Don't use RCU locking in sleepable context in team driver, from Jiri
Pirko.

7) xen-netback miscalculates statistic offset pointers when reporting
the stats to userspace. From David Vrabel.

8) Fix a leak of up to 256 pages per VIF destroy in xen-netaback, also
from David Vrabel.

9) ip_check_defrag() cannot assume that skb_network_offset(),
particularly when it is used by the AF_PACKET fanout defrag code.
From Alexander Drozdov.

10) gianfar driver doesn't query OF node names properly when trying to
determine the number of hw queues available. Fix it to explicitly
check for OF nodes named queue-group. From Tobias Waldekranz.

11) MID field in macb driver should be 12 bits, not 16. From Punnaiah
Choudary Kalluri.

12) Fix unintentional regression in traceroute due to timestamp socket
option changes. Empty ICMP payloads should be allowed in
non-timestamp cases. From Willem de Bruijn.

13) When devices are unregistered, we have to get rid of AF_PACKET
multicast list entries that point to it via ifindex. Fix from
Francesco Ruggeri.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (38 commits)
tipc: fix bug in link failover handling
net: delete stale packet_mclist entries
net: macb: constify macb configuration data
MAINTAINERS: add Marc Kleine-Budde as co maintainer for CAN networking layer
MAINTAINERS: linux-can moved to github
can: kvaser_usb: Read all messages in a bulk-in URB buffer
can: kvaser_usb: Avoid double free on URB submission failures
can: peak_usb: fix missing ctrlmode_ init for every dev
can: add missing initialisations in CAN related skbuffs
ip: fix error queue empty skb handling
bgmac: Clean warning messages
tcp: align tcp_xmit_size_goal() on tcp_tso_autosize()
net: fec: fix unbalanced clk disable on driver unbind
net: macb: Correct the MID field length value
net: gianfar: correctly determine the number of queue groups
ipv4: ip_check_defrag should not assume that skb_network_offset is zero
net: bcmgenet: properly disable password matching
net: eth: xgene: fix booting with devicetree
bnx2x: Force fundamental reset for EEH recovery
xen-netback: refactor xenvif_handle_frag_list()
...

+311 -177
+4 -1
Documentation/devicetree/bindings/net/apm-xgene-enet.txt
··· 4 4 APM X-Gene SoC. 5 5 6 6 Required properties for all the ethernet interfaces: 7 - - compatible: Should be "apm,xgene-enet" 7 + - compatible: Should state binding information from the following list, 8 + - "apm,xgene-enet": RGMII based 1G interface 9 + - "apm,xgene1-sgenet": SGMII based 1G interface 10 + - "apm,xgene1-xgenet": XFI based 10G interface 8 11 - reg: Address and length of the register set for the device. It contains the 9 12 information of registers in the same order as described by reg-names 10 13 - reg-names: Should contain the register set names
+3 -2
MAINTAINERS
··· 2369 2369 2370 2370 CAN NETWORK LAYER 2371 2371 M: Oliver Hartkopp <socketcan@hartkopp.net> 2372 + M: Marc Kleine-Budde <mkl@pengutronix.de> 2372 2373 L: linux-can@vger.kernel.org 2373 - W: http://gitorious.org/linux-can 2374 + W: https://github.com/linux-can 2374 2375 T: git git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git 2375 2376 T: git git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git 2376 2377 S: Maintained ··· 2387 2386 M: Wolfgang Grandegger <wg@grandegger.com> 2388 2387 M: Marc Kleine-Budde <mkl@pengutronix.de> 2389 2388 L: linux-can@vger.kernel.org 2390 - W: http://gitorious.org/linux-can 2389 + W: https://github.com/linux-can 2391 2390 T: git git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git 2392 2391 T: git git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git 2393 2392 S: Maintained
+1
arch/arm/mach-pxa/idp.c
··· 36 36 #include <linux/platform_data/video-pxafb.h> 37 37 #include <mach/bitfield.h> 38 38 #include <linux/platform_data/mmc-pxamci.h> 39 + #include <linux/smc91x.h> 39 40 40 41 #include "generic.h" 41 42 #include "devices.h"
+1 -1
arch/arm/mach-pxa/lpd270.c
··· 195 195 }; 196 196 197 197 struct smc91x_platdata smc91x_platdata = { 198 - .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT; 198 + .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, 199 199 }; 200 200 201 201 static struct platform_device smc91x_device = {
+2 -2
arch/arm/mach-sa1100/neponset.c
··· 268 268 .id = 0, 269 269 .res = smc91x_resources, 270 270 .num_res = ARRAY_SIZE(smc91x_resources), 271 - .data = &smc91c_platdata, 272 - .size_data = sizeof(smc91c_platdata), 271 + .data = &smc91x_platdata, 272 + .size_data = sizeof(smc91x_platdata), 273 273 }; 274 274 int ret, irq; 275 275
+1 -1
arch/arm/mach-sa1100/pleb.c
··· 54 54 .num_resources = ARRAY_SIZE(smc91x_resources), 55 55 .resource = smc91x_resources, 56 56 .dev = { 57 - .platform_data = &smc91c_platdata, 57 + .platform_data = &smc91x_platdata, 58 58 }, 59 59 }; 60 60
+2 -2
arch/arm64/boot/dts/apm/apm-storm.dtsi
··· 622 622 }; 623 623 624 624 sgenet0: ethernet@1f210000 { 625 - compatible = "apm,xgene-enet"; 625 + compatible = "apm,xgene1-sgenet"; 626 626 status = "disabled"; 627 627 reg = <0x0 0x1f210000 0x0 0xd100>, 628 628 <0x0 0x1f200000 0x0 0Xc300>, ··· 636 636 }; 637 637 638 638 xgenet: ethernet@1f610000 { 639 - compatible = "apm,xgene-enet"; 639 + compatible = "apm,xgene1-xgenet"; 640 640 status = "disabled"; 641 641 reg = <0x0 0x1f610000 0x0 0xd100>, 642 642 <0x0 0x1f600000 0x0 0Xc300>,
+8
drivers/net/can/dev.c
··· 579 579 skb->pkt_type = PACKET_BROADCAST; 580 580 skb->ip_summed = CHECKSUM_UNNECESSARY; 581 581 582 + skb_reset_mac_header(skb); 583 + skb_reset_network_header(skb); 584 + skb_reset_transport_header(skb); 585 + 582 586 can_skb_reserve(skb); 583 587 can_skb_prv(skb)->ifindex = dev->ifindex; 584 588 ··· 606 602 skb->protocol = htons(ETH_P_CANFD); 607 603 skb->pkt_type = PACKET_BROADCAST; 608 604 skb->ip_summed = CHECKSUM_UNNECESSARY; 605 + 606 + skb_reset_mac_header(skb); 607 + skb_reset_network_header(skb); 608 + skb_reset_transport_header(skb); 609 609 610 610 can_skb_reserve(skb); 611 611 can_skb_prv(skb)->ifindex = dev->ifindex;
+31 -17
drivers/net/can/usb/kvaser_usb.c
··· 14 14 * Copyright (C) 2015 Valeo S.A. 15 15 */ 16 16 17 + #include <linux/kernel.h> 17 18 #include <linux/completion.h> 18 19 #include <linux/module.h> 19 20 #include <linux/netdevice.h> ··· 585 584 while (pos <= actual_len - MSG_HEADER_LEN) { 586 585 tmp = buf + pos; 587 586 588 - if (!tmp->len) 589 - break; 587 + /* Handle messages crossing the USB endpoint max packet 588 + * size boundary. Check kvaser_usb_read_bulk_callback() 589 + * for further details. 590 + */ 591 + if (tmp->len == 0) { 592 + pos = round_up(pos, 593 + dev->bulk_in->wMaxPacketSize); 594 + continue; 595 + } 590 596 591 597 if (pos + tmp->len > actual_len) { 592 598 dev_err(dev->udev->dev.parent, ··· 795 787 netdev_err(netdev, "Error transmitting URB\n"); 796 788 usb_unanchor_urb(urb); 797 789 usb_free_urb(urb); 798 - kfree(buf); 799 790 return err; 800 791 } 801 792 ··· 1324 1317 while (pos <= urb->actual_length - MSG_HEADER_LEN) { 1325 1318 msg = urb->transfer_buffer + pos; 1326 1319 1327 - if (!msg->len) 1328 - break; 1320 + /* The Kvaser firmware can only read and write messages that 1321 + * does not cross the USB's endpoint wMaxPacketSize boundary. 1322 + * If a follow-up command crosses such boundary, firmware puts 1323 + * a placeholder zero-length command in its place then aligns 1324 + * the real command to the next max packet size. 1325 + * 1326 + * Handle such cases or we're going to miss a significant 1327 + * number of events in case of a heavy rx load on the bus. 1328 + */ 1329 + if (msg->len == 0) { 1330 + pos = round_up(pos, dev->bulk_in->wMaxPacketSize); 1331 + continue; 1332 + } 1329 1333 1330 1334 if (pos + msg->len > urb->actual_length) { 1331 1335 dev_err(dev->udev->dev.parent, "Format error\n"); ··· 1344 1326 } 1345 1327 1346 1328 kvaser_usb_handle_message(dev, msg); 1347 - 1348 1329 pos += msg->len; 1349 1330 } 1350 1331 ··· 1632 1615 struct urb *urb; 1633 1616 void *buf; 1634 1617 struct kvaser_msg *msg; 1635 - int i, err; 1636 - int ret = NETDEV_TX_OK; 1618 + int i, err, ret = NETDEV_TX_OK; 1637 1619 u8 *msg_tx_can_flags = NULL; /* GCC */ 1638 1620 1639 1621 if (can_dropped_invalid_skb(netdev, skb)) ··· 1650 1634 if (!buf) { 1651 1635 stats->tx_dropped++; 1652 1636 dev_kfree_skb(skb); 1653 - goto nobufmem; 1637 + goto freeurb; 1654 1638 } 1655 1639 1656 1640 msg = buf; ··· 1697 1681 /* This should never happen; it implies a flow control bug */ 1698 1682 if (!context) { 1699 1683 netdev_warn(netdev, "cannot find free context\n"); 1684 + 1685 + kfree(buf); 1700 1686 ret = NETDEV_TX_BUSY; 1701 - goto releasebuf; 1687 + goto freeurb; 1702 1688 } 1703 1689 1704 1690 context->priv = priv; ··· 1737 1719 else 1738 1720 netdev_warn(netdev, "Failed tx_urb %d\n", err); 1739 1721 1740 - goto releasebuf; 1722 + goto freeurb; 1741 1723 } 1742 1724 1743 - usb_free_urb(urb); 1725 + ret = NETDEV_TX_OK; 1744 1726 1745 - return NETDEV_TX_OK; 1746 - 1747 - releasebuf: 1748 - kfree(buf); 1749 - nobufmem: 1727 + freeurb: 1750 1728 usb_free_urb(urb); 1751 1729 return ret; 1752 1730 }
+4
drivers/net/can/usb/peak_usb/pcan_usb_fd.c
··· 879 879 880 880 pdev->usb_if = ppdev->usb_if; 881 881 pdev->cmd_buffer_addr = ppdev->cmd_buffer_addr; 882 + 883 + /* do a copy of the ctrlmode[_supported] too */ 884 + dev->can.ctrlmode = ppdev->dev.can.ctrlmode; 885 + dev->can.ctrlmode_supported = ppdev->dev.can.ctrlmode_supported; 882 886 } 883 887 884 888 pdev->usb_if->dev[dev->ctrl_idx] = dev;
+1 -1
drivers/net/ethernet/apm/xgene/xgene_enet_hw.c
··· 593 593 if (!xgene_ring_mgr_init(pdata)) 594 594 return -ENODEV; 595 595 596 - if (!efi_enabled(EFI_BOOT)) { 596 + if (pdata->clk) { 597 597 clk_prepare_enable(pdata->clk); 598 598 clk_disable_unprepare(pdata->clk); 599 599 clk_prepare_enable(pdata->clk);
+4
drivers/net/ethernet/apm/xgene/xgene_enet_main.c
··· 1025 1025 #ifdef CONFIG_ACPI 1026 1026 static const struct acpi_device_id xgene_enet_acpi_match[] = { 1027 1027 { "APMC0D05", }, 1028 + { "APMC0D30", }, 1029 + { "APMC0D31", }, 1028 1030 { } 1029 1031 }; 1030 1032 MODULE_DEVICE_TABLE(acpi, xgene_enet_acpi_match); ··· 1035 1033 #ifdef CONFIG_OF 1036 1034 static struct of_device_id xgene_enet_of_match[] = { 1037 1035 {.compatible = "apm,xgene-enet",}, 1036 + {.compatible = "apm,xgene1-sgenet",}, 1037 + {.compatible = "apm,xgene1-xgenet",}, 1038 1038 {}, 1039 1039 }; 1040 1040
+4 -4
drivers/net/ethernet/broadcom/bcm63xx_enet.c
··· 486 486 { 487 487 struct bcm_enet_priv *priv; 488 488 struct net_device *dev; 489 - int tx_work_done, rx_work_done; 489 + int rx_work_done; 490 490 491 491 priv = container_of(napi, struct bcm_enet_priv, napi); 492 492 dev = priv->net_dev; ··· 498 498 ENETDMAC_IR, priv->tx_chan); 499 499 500 500 /* reclaim sent skb */ 501 - tx_work_done = bcm_enet_tx_reclaim(dev, 0); 501 + bcm_enet_tx_reclaim(dev, 0); 502 502 503 503 spin_lock(&priv->rx_lock); 504 504 rx_work_done = bcm_enet_receive_queue(dev, budget); 505 505 spin_unlock(&priv->rx_lock); 506 506 507 - if (rx_work_done >= budget || tx_work_done > 0) { 508 - /* rx/tx queue is not yet empty/clean */ 507 + if (rx_work_done >= budget) { 508 + /* rx queue is not yet empty/clean */ 509 509 return rx_work_done; 510 510 } 511 511
-7
drivers/net/ethernet/broadcom/bgmac.c
··· 302 302 slot->skb = skb; 303 303 slot->dma_addr = dma_addr; 304 304 305 - if (slot->dma_addr & 0xC0000000) 306 - bgmac_warn(bgmac, "DMA address using 0xC0000000 bit(s), it may need translation trick\n"); 307 - 308 305 return 0; 309 306 } 310 307 ··· 502 505 ring->mmio_base); 503 506 goto err_dma_free; 504 507 } 505 - if (ring->dma_base & 0xC0000000) 506 - bgmac_warn(bgmac, "DMA address using 0xC0000000 bit(s), it may need translation trick\n"); 507 508 508 509 ring->unaligned = bgmac_dma_unaligned(bgmac, ring, 509 510 BGMAC_DMA_RING_TX); ··· 531 536 err = -ENOMEM; 532 537 goto err_dma_free; 533 538 } 534 - if (ring->dma_base & 0xC0000000) 535 - bgmac_warn(bgmac, "DMA address using 0xC0000000 bit(s), it may need translation trick\n"); 536 539 537 540 ring->unaligned = bgmac_dma_unaligned(bgmac, ring, 538 541 BGMAC_DMA_RING_RX);
+3
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
··· 12722 12722 pci_write_config_dword(bp->pdev, PCICFG_GRC_ADDRESS, 12723 12723 PCICFG_VENDOR_ID_OFFSET); 12724 12724 12725 + /* Set PCIe reset type to fundamental for EEH recovery */ 12726 + pdev->needs_freset = 1; 12727 + 12725 12728 /* AER (Advanced Error reporting) configuration */ 12726 12729 rc = pci_enable_pcie_error_reporting(pdev); 12727 12730 if (!rc)
+4 -2
drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
··· 73 73 if (wol->wolopts & ~(WAKE_MAGIC | WAKE_MAGICSECURE)) 74 74 return -EINVAL; 75 75 76 + reg = bcmgenet_umac_readl(priv, UMAC_MPD_CTRL); 76 77 if (wol->wolopts & WAKE_MAGICSECURE) { 77 78 bcmgenet_umac_writel(priv, get_unaligned_be16(&wol->sopass[0]), 78 79 UMAC_MPD_PW_MS); 79 80 bcmgenet_umac_writel(priv, get_unaligned_be32(&wol->sopass[2]), 80 81 UMAC_MPD_PW_LS); 81 - reg = bcmgenet_umac_readl(priv, UMAC_MPD_CTRL); 82 82 reg |= MPD_PW_EN; 83 - bcmgenet_umac_writel(priv, reg, UMAC_MPD_CTRL); 83 + } else { 84 + reg &= ~MPD_PW_EN; 84 85 } 86 + bcmgenet_umac_writel(priv, reg, UMAC_MPD_CTRL); 85 87 86 88 /* Flag the device and relevant IRQ as wakeup capable */ 87 89 if (wol->wolopts) {
+4 -4
drivers/net/ethernet/cadence/macb.c
··· 2113 2113 }; 2114 2114 2115 2115 #if defined(CONFIG_OF) 2116 - static struct macb_config pc302gem_config = { 2116 + static const struct macb_config pc302gem_config = { 2117 2117 .caps = MACB_CAPS_SG_DISABLED | MACB_CAPS_GIGABIT_MODE_AVAILABLE, 2118 2118 .dma_burst_length = 16, 2119 2119 }; 2120 2120 2121 - static struct macb_config sama5d3_config = { 2121 + static const struct macb_config sama5d3_config = { 2122 2122 .caps = MACB_CAPS_SG_DISABLED | MACB_CAPS_GIGABIT_MODE_AVAILABLE, 2123 2123 .dma_burst_length = 16, 2124 2124 }; 2125 2125 2126 - static struct macb_config sama5d4_config = { 2126 + static const struct macb_config sama5d4_config = { 2127 2127 .caps = 0, 2128 2128 .dma_burst_length = 4, 2129 2129 }; ··· 2154 2154 if (bp->pdev->dev.of_node) { 2155 2155 match = of_match_node(macb_dt_ids, bp->pdev->dev.of_node); 2156 2156 if (match && match->data) { 2157 - config = (const struct macb_config *)match->data; 2157 + config = match->data; 2158 2158 2159 2159 bp->caps = config->caps; 2160 2160 /*
+1 -1
drivers/net/ethernet/cadence/macb.h
··· 351 351 352 352 /* Bitfields in MID */ 353 353 #define MACB_IDNUM_OFFSET 16 354 - #define MACB_IDNUM_SIZE 16 354 + #define MACB_IDNUM_SIZE 12 355 355 #define MACB_REV_OFFSET 0 356 356 #define MACB_REV_SIZE 16 357 357
+1 -2
drivers/net/ethernet/freescale/fec_main.c
··· 1597 1597 writel(int_events, fep->hwp + FEC_IEVENT); 1598 1598 fec_enet_collect_events(fep, int_events); 1599 1599 1600 - if (fep->work_tx || fep->work_rx) { 1600 + if ((fep->work_tx || fep->work_rx) && fep->link) { 1601 1601 ret = IRQ_HANDLED; 1602 1602 1603 1603 if (napi_schedule_prep(&fep->napi)) { ··· 3383 3383 regulator_disable(fep->reg_phy); 3384 3384 if (fep->ptp_clock) 3385 3385 ptp_clock_unregister(fep->ptp_clock); 3386 - fec_enet_clk_enable(ndev, false); 3387 3386 of_node_put(fep->phy_node); 3388 3387 free_netdev(ndev); 3389 3388
+17 -2
drivers/net/ethernet/freescale/gianfar.c
··· 747 747 return 0; 748 748 } 749 749 750 + static int gfar_of_group_count(struct device_node *np) 751 + { 752 + struct device_node *child; 753 + int num = 0; 754 + 755 + for_each_available_child_of_node(np, child) 756 + if (!of_node_cmp(child->name, "queue-group")) 757 + num++; 758 + 759 + return num; 760 + } 761 + 750 762 static int gfar_of_init(struct platform_device *ofdev, struct net_device **pdev) 751 763 { 752 764 const char *model; ··· 796 784 num_rx_qs = 1; 797 785 } else { /* MQ_MG_MODE */ 798 786 /* get the actual number of supported groups */ 799 - unsigned int num_grps = of_get_available_child_count(np); 787 + unsigned int num_grps = gfar_of_group_count(np); 800 788 801 789 if (num_grps == 0 || num_grps > MAXGROUPS) { 802 790 dev_err(&ofdev->dev, "Invalid # of int groups(%d)\n", ··· 863 851 864 852 /* Parse and initialize group specific information */ 865 853 if (priv->mode == MQ_MG_MODE) { 866 - for_each_child_of_node(np, child) { 854 + for_each_available_child_of_node(np, child) { 855 + if (of_node_cmp(child->name, "queue-group")) 856 + continue; 857 + 867 858 err = gfar_parse_group(child, priv, model); 868 859 if (err) 869 860 goto err_grp_init;
+1
drivers/net/ethernet/smsc/smc91x.c
··· 92 92 #include "smc91x.h" 93 93 94 94 #if defined(CONFIG_ASSABET_NEPONSET) 95 + #include <mach/assabet.h> 95 96 #include <mach/neponset.h> 96 97 #endif 97 98
+36 -29
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
··· 272 272 struct stmmac_priv *priv = NULL; 273 273 struct plat_stmmacenet_data *plat_dat = NULL; 274 274 const char *mac = NULL; 275 + int irq, wol_irq, lpi_irq; 276 + 277 + /* Get IRQ information early to have an ability to ask for deferred 278 + * probe if needed before we went too far with resource allocation. 279 + */ 280 + irq = platform_get_irq_byname(pdev, "macirq"); 281 + if (irq < 0) { 282 + if (irq != -EPROBE_DEFER) { 283 + dev_err(dev, 284 + "MAC IRQ configuration information not found\n"); 285 + } 286 + return irq; 287 + } 288 + 289 + /* On some platforms e.g. SPEAr the wake up irq differs from the mac irq 290 + * The external wake up irq can be passed through the platform code 291 + * named as "eth_wake_irq" 292 + * 293 + * In case the wake up interrupt is not passed from the platform 294 + * so the driver will continue to use the mac irq (ndev->irq) 295 + */ 296 + wol_irq = platform_get_irq_byname(pdev, "eth_wake_irq"); 297 + if (wol_irq < 0) { 298 + if (wol_irq == -EPROBE_DEFER) 299 + return -EPROBE_DEFER; 300 + wol_irq = irq; 301 + } 302 + 303 + lpi_irq = platform_get_irq_byname(pdev, "eth_lpi"); 304 + if (lpi_irq == -EPROBE_DEFER) 305 + return -EPROBE_DEFER; 275 306 276 307 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 277 308 addr = devm_ioremap_resource(dev, res); ··· 354 323 return PTR_ERR(priv); 355 324 } 356 325 326 + /* Copy IRQ values to priv structure which is now avaialble */ 327 + priv->dev->irq = irq; 328 + priv->wol_irq = wol_irq; 329 + priv->lpi_irq = lpi_irq; 330 + 357 331 /* Get MAC address if available (DT) */ 358 332 if (mac) 359 333 memcpy(priv->dev->dev_addr, mac, ETH_ALEN); 360 - 361 - /* Get the MAC information */ 362 - priv->dev->irq = platform_get_irq_byname(pdev, "macirq"); 363 - if (priv->dev->irq < 0) { 364 - if (priv->dev->irq != -EPROBE_DEFER) { 365 - netdev_err(priv->dev, 366 - "MAC IRQ configuration information not found\n"); 367 - } 368 - return priv->dev->irq; 369 - } 370 - 371 - /* 372 - * On some platforms e.g. SPEAr the wake up irq differs from the mac irq 373 - * The external wake up irq can be passed through the platform code 374 - * named as "eth_wake_irq" 375 - * 376 - * In case the wake up interrupt is not passed from the platform 377 - * so the driver will continue to use the mac irq (ndev->irq) 378 - */ 379 - priv->wol_irq = platform_get_irq_byname(pdev, "eth_wake_irq"); 380 - if (priv->wol_irq < 0) { 381 - if (priv->wol_irq == -EPROBE_DEFER) 382 - return -EPROBE_DEFER; 383 - priv->wol_irq = priv->dev->irq; 384 - } 385 - 386 - priv->lpi_irq = platform_get_irq_byname(pdev, "eth_lpi"); 387 - if (priv->lpi_irq == -EPROBE_DEFER) 388 - return -EPROBE_DEFER; 389 334 390 335 platform_set_drvdata(pdev, priv->dev); 391 336
+3 -3
drivers/net/team/team.c
··· 1730 1730 if (dev->type == ARPHRD_ETHER && !is_valid_ether_addr(addr->sa_data)) 1731 1731 return -EADDRNOTAVAIL; 1732 1732 memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); 1733 - rcu_read_lock(); 1734 - list_for_each_entry_rcu(port, &team->port_list, list) 1733 + mutex_lock(&team->lock); 1734 + list_for_each_entry(port, &team->port_list, list) 1735 1735 if (team->ops.port_change_dev_addr) 1736 1736 team->ops.port_change_dev_addr(team, port); 1737 - rcu_read_unlock(); 1737 + mutex_unlock(&team->lock); 1738 1738 return 0; 1739 1739 } 1740 1740
+1 -2
drivers/net/xen-netback/interface.c
··· 340 340 unsigned int num_queues = vif->num_queues; 341 341 int i; 342 342 unsigned int queue_index; 343 - struct xenvif_stats *vif_stats; 344 343 345 344 for (i = 0; i < ARRAY_SIZE(xenvif_stats); i++) { 346 345 unsigned long accum = 0; 347 346 for (queue_index = 0; queue_index < num_queues; ++queue_index) { 348 - vif_stats = &vif->queues[queue_index].stats; 347 + void *vif_stats = &vif->queues[queue_index].stats; 349 348 accum += *(unsigned long *)(vif_stats + xenvif_stats[i].offset); 350 349 } 351 350 data[i] = accum;
+12 -10
drivers/net/xen-netback/netback.c
··· 1349 1349 { 1350 1350 unsigned int offset = skb_headlen(skb); 1351 1351 skb_frag_t frags[MAX_SKB_FRAGS]; 1352 - int i; 1352 + int i, f; 1353 1353 struct ubuf_info *uarg; 1354 1354 struct sk_buff *nskb = skb_shinfo(skb)->frag_list; 1355 1355 ··· 1389 1389 frags[i].page_offset = 0; 1390 1390 skb_frag_size_set(&frags[i], len); 1391 1391 } 1392 - /* swap out with old one */ 1393 - memcpy(skb_shinfo(skb)->frags, 1394 - frags, 1395 - i * sizeof(skb_frag_t)); 1396 - skb_shinfo(skb)->nr_frags = i; 1397 - skb->truesize += i * PAGE_SIZE; 1398 1392 1399 - /* remove traces of mapped pages and frag_list */ 1393 + /* Copied all the bits from the frag list -- free it. */ 1400 1394 skb_frag_list_init(skb); 1395 + xenvif_skb_zerocopy_prepare(queue, nskb); 1396 + kfree_skb(nskb); 1397 + 1398 + /* Release all the original (foreign) frags. */ 1399 + for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) 1400 + skb_frag_unref(skb, f); 1401 1401 uarg = skb_shinfo(skb)->destructor_arg; 1402 1402 /* increase inflight counter to offset decrement in callback */ 1403 1403 atomic_inc(&queue->inflight_packets); 1404 1404 uarg->callback(uarg, true); 1405 1405 skb_shinfo(skb)->destructor_arg = NULL; 1406 1406 1407 - xenvif_skb_zerocopy_prepare(queue, nskb); 1408 - kfree_skb(nskb); 1407 + /* Fill the skb with the new (local) frags. */ 1408 + memcpy(skb_shinfo(skb)->frags, frags, i * sizeof(skb_frag_t)); 1409 + skb_shinfo(skb)->nr_frags = i; 1410 + skb->truesize += i * PAGE_SIZE; 1409 1411 1410 1412 return 0; 1411 1413 }
+19 -3
include/net/netfilter/nf_tables.h
··· 119 119 const struct nft_data *data, 120 120 enum nft_data_types type); 121 121 122 + 123 + /** 124 + * struct nft_userdata - user defined data associated with an object 125 + * 126 + * @len: length of the data 127 + * @data: content 128 + * 129 + * The presence of user data is indicated in an object specific fashion, 130 + * so a length of zero can't occur and the value "len" indicates data 131 + * of length len + 1. 132 + */ 133 + struct nft_userdata { 134 + u8 len; 135 + unsigned char data[0]; 136 + }; 137 + 122 138 /** 123 139 * struct nft_set_elem - generic representation of set elements 124 140 * ··· 396 380 * @handle: rule handle 397 381 * @genmask: generation mask 398 382 * @dlen: length of expression data 399 - * @ulen: length of user data (used for comments) 383 + * @udata: user data is appended to the rule 400 384 * @data: expression data 401 385 */ 402 386 struct nft_rule { ··· 404 388 u64 handle:42, 405 389 genmask:2, 406 390 dlen:12, 407 - ulen:8; 391 + udata:1; 408 392 unsigned char data[] 409 393 __attribute__((aligned(__alignof__(struct nft_expr)))); 410 394 }; ··· 492 476 return (struct nft_expr *)&rule->data[rule->dlen]; 493 477 } 494 478 495 - static inline void *nft_userdata(const struct nft_rule *rule) 479 + static inline struct nft_userdata *nft_userdata(const struct nft_rule *rule) 496 480 { 497 481 return (void *)&rule->data[rule->dlen]; 498 482 }
+3
net/can/af_can.c
··· 259 259 goto inval_skb; 260 260 } 261 261 262 + skb->ip_summed = CHECKSUM_UNNECESSARY; 263 + 264 + skb_reset_mac_header(skb); 262 265 skb_reset_network_header(skb); 263 266 skb_reset_transport_header(skb); 264 267
+7 -4
net/ipv4/ip_fragment.c
··· 659 659 struct sk_buff *ip_check_defrag(struct sk_buff *skb, u32 user) 660 660 { 661 661 struct iphdr iph; 662 + int netoff; 662 663 u32 len; 663 664 664 665 if (skb->protocol != htons(ETH_P_IP)) 665 666 return skb; 666 667 667 - if (skb_copy_bits(skb, 0, &iph, sizeof(iph)) < 0) 668 + netoff = skb_network_offset(skb); 669 + 670 + if (skb_copy_bits(skb, netoff, &iph, sizeof(iph)) < 0) 668 671 return skb; 669 672 670 673 if (iph.ihl < 5 || iph.version != 4) 671 674 return skb; 672 675 673 676 len = ntohs(iph.tot_len); 674 - if (skb->len < len || len < (iph.ihl * 4)) 677 + if (skb->len < netoff + len || len < (iph.ihl * 4)) 675 678 return skb; 676 679 677 680 if (ip_is_fragment(&iph)) { 678 681 skb = skb_share_check(skb, GFP_ATOMIC); 679 682 if (skb) { 680 - if (!pskb_may_pull(skb, iph.ihl*4)) 683 + if (!pskb_may_pull(skb, netoff + iph.ihl * 4)) 681 684 return skb; 682 - if (pskb_trim_rcsum(skb, len)) 685 + if (pskb_trim_rcsum(skb, netoff + len)) 683 686 return skb; 684 687 memset(IPCB(skb), 0, sizeof(struct inet_skb_parm)); 685 688 if (ip_defrag(skb, user))
+23 -10
net/ipv4/ip_sockglue.c
··· 432 432 kfree_skb(skb); 433 433 } 434 434 435 - static bool ipv4_pktinfo_prepare_errqueue(const struct sock *sk, 436 - const struct sk_buff *skb, 437 - int ee_origin) 435 + /* IPv4 supports cmsg on all imcp errors and some timestamps 436 + * 437 + * Timestamp code paths do not initialize the fields expected by cmsg: 438 + * the PKTINFO fields in skb->cb[]. Fill those in here. 439 + */ 440 + static bool ipv4_datagram_support_cmsg(const struct sock *sk, 441 + struct sk_buff *skb, 442 + int ee_origin) 438 443 { 439 - struct in_pktinfo *info = PKTINFO_SKB_CB(skb); 444 + struct in_pktinfo *info; 440 445 441 - if ((ee_origin != SO_EE_ORIGIN_TIMESTAMPING) || 442 - (!(sk->sk_tsflags & SOF_TIMESTAMPING_OPT_CMSG)) || 446 + if (ee_origin == SO_EE_ORIGIN_ICMP) 447 + return true; 448 + 449 + if (ee_origin == SO_EE_ORIGIN_LOCAL) 450 + return false; 451 + 452 + /* Support IP_PKTINFO on tstamp packets if requested, to correlate 453 + * timestamp with egress dev. Not possible for packets without dev 454 + * or without payload (SOF_TIMESTAMPING_OPT_TSONLY). 455 + */ 456 + if ((!(sk->sk_tsflags & SOF_TIMESTAMPING_OPT_CMSG)) || 443 457 (!skb->dev)) 444 458 return false; 445 459 460 + info = PKTINFO_SKB_CB(skb); 446 461 info->ipi_spec_dst.s_addr = ip_hdr(skb)->saddr; 447 462 info->ipi_ifindex = skb->dev->ifindex; 448 463 return true; ··· 498 483 499 484 serr = SKB_EXT_ERR(skb); 500 485 501 - if (sin && skb->len) { 486 + if (sin && serr->port) { 502 487 sin->sin_family = AF_INET; 503 488 sin->sin_addr.s_addr = *(__be32 *)(skb_network_header(skb) + 504 489 serr->addr_offset); ··· 511 496 sin = &errhdr.offender; 512 497 memset(sin, 0, sizeof(*sin)); 513 498 514 - if (skb->len && 515 - (serr->ee.ee_origin == SO_EE_ORIGIN_ICMP || 516 - ipv4_pktinfo_prepare_errqueue(sk, skb, serr->ee.ee_origin))) { 499 + if (ipv4_datagram_support_cmsg(sk, skb, serr->ee.ee_origin)) { 517 500 sin->sin_family = AF_INET; 518 501 sin->sin_addr.s_addr = ip_hdr(skb)->saddr; 519 502 if (inet_sk(sk)->cmsg_flags)
+10 -2
net/ipv4/ping.c
··· 259 259 kgid_t low, high; 260 260 int ret = 0; 261 261 262 + if (sk->sk_family == AF_INET6) 263 + sk->sk_ipv6only = 1; 264 + 262 265 inet_get_ping_group_range_net(net, &low, &high); 263 266 if (gid_lte(low, group) && gid_lte(group, high)) 264 267 return 0; ··· 308 305 if (addr_len < sizeof(*addr)) 309 306 return -EINVAL; 310 307 308 + if (addr->sin_family != AF_INET && 309 + !(addr->sin_family == AF_UNSPEC && 310 + addr->sin_addr.s_addr == htonl(INADDR_ANY))) 311 + return -EAFNOSUPPORT; 312 + 311 313 pr_debug("ping_check_bind_addr(sk=%p,addr=%pI4,port=%d)\n", 312 314 sk, &addr->sin_addr.s_addr, ntohs(addr->sin_port)); 313 315 ··· 338 330 return -EINVAL; 339 331 340 332 if (addr->sin6_family != AF_INET6) 341 - return -EINVAL; 333 + return -EAFNOSUPPORT; 342 334 343 335 pr_debug("ping_check_bind_addr(sk=%p,addr=%pI6c,port=%d)\n", 344 336 sk, addr->sin6_addr.s6_addr, ntohs(addr->sin6_port)); ··· 724 716 if (msg->msg_namelen < sizeof(*usin)) 725 717 return -EINVAL; 726 718 if (usin->sin_family != AF_INET) 727 - return -EINVAL; 719 + return -EAFNOSUPPORT; 728 720 daddr = usin->sin_addr.s_addr; 729 721 /* no remote port */ 730 722 } else {
+3 -7
net/ipv4/tcp.c
··· 835 835 int large_allowed) 836 836 { 837 837 struct tcp_sock *tp = tcp_sk(sk); 838 - u32 new_size_goal, size_goal, hlen; 838 + u32 new_size_goal, size_goal; 839 839 840 840 if (!large_allowed || !sk_can_gso(sk)) 841 841 return mss_now; 842 842 843 - /* Maybe we should/could use sk->sk_prot->max_header here ? */ 844 - hlen = inet_csk(sk)->icsk_af_ops->net_header_len + 845 - inet_csk(sk)->icsk_ext_hdr_len + 846 - tp->tcp_header_len; 847 - 848 - new_size_goal = sk->sk_gso_max_size - 1 - hlen; 843 + /* Note : tcp_tso_autosize() will eventually split this later */ 844 + new_size_goal = sk->sk_gso_max_size - 1 - MAX_TCP_HEADER; 849 845 new_size_goal = tcp_bound_to_half_wnd(tp, new_size_goal); 850 846 851 847 /* We try hard to avoid divides here */
+28 -11
net/ipv6/datagram.c
··· 325 325 kfree_skb(skb); 326 326 } 327 327 328 - static void ip6_datagram_prepare_pktinfo_errqueue(struct sk_buff *skb) 328 + /* IPv6 supports cmsg on all origins aside from SO_EE_ORIGIN_LOCAL. 329 + * 330 + * At one point, excluding local errors was a quick test to identify icmp/icmp6 331 + * errors. This is no longer true, but the test remained, so the v6 stack, 332 + * unlike v4, also honors cmsg requests on all wifi and timestamp errors. 333 + * 334 + * Timestamp code paths do not initialize the fields expected by cmsg: 335 + * the PKTINFO fields in skb->cb[]. Fill those in here. 336 + */ 337 + static bool ip6_datagram_support_cmsg(struct sk_buff *skb, 338 + struct sock_exterr_skb *serr) 329 339 { 330 - int ifindex = skb->dev ? skb->dev->ifindex : -1; 340 + if (serr->ee.ee_origin == SO_EE_ORIGIN_ICMP || 341 + serr->ee.ee_origin == SO_EE_ORIGIN_ICMP6) 342 + return true; 343 + 344 + if (serr->ee.ee_origin == SO_EE_ORIGIN_LOCAL) 345 + return false; 346 + 347 + if (!skb->dev) 348 + return false; 331 349 332 350 if (skb->protocol == htons(ETH_P_IPV6)) 333 - IP6CB(skb)->iif = ifindex; 351 + IP6CB(skb)->iif = skb->dev->ifindex; 334 352 else 335 - PKTINFO_SKB_CB(skb)->ipi_ifindex = ifindex; 353 + PKTINFO_SKB_CB(skb)->ipi_ifindex = skb->dev->ifindex; 354 + 355 + return true; 336 356 } 337 357 338 358 /* ··· 389 369 390 370 serr = SKB_EXT_ERR(skb); 391 371 392 - if (sin && skb->len) { 372 + if (sin && serr->port) { 393 373 const unsigned char *nh = skb_network_header(skb); 394 374 sin->sin6_family = AF_INET6; 395 375 sin->sin6_flowinfo = 0; ··· 414 394 memcpy(&errhdr.ee, &serr->ee, sizeof(struct sock_extended_err)); 415 395 sin = &errhdr.offender; 416 396 memset(sin, 0, sizeof(*sin)); 417 - if (serr->ee.ee_origin != SO_EE_ORIGIN_LOCAL && skb->len) { 397 + 398 + if (ip6_datagram_support_cmsg(skb, serr)) { 418 399 sin->sin6_family = AF_INET6; 419 - if (np->rxopt.all) { 420 - if (serr->ee.ee_origin != SO_EE_ORIGIN_ICMP && 421 - serr->ee.ee_origin != SO_EE_ORIGIN_ICMP6) 422 - ip6_datagram_prepare_pktinfo_errqueue(skb); 400 + if (np->rxopt.all) 423 401 ip6_datagram_recv_common_ctl(sk, msg, skb); 424 - } 425 402 if (skb->protocol == htons(ETH_P_IPV6)) { 426 403 sin->sin6_addr = ipv6_hdr(skb)->saddr; 427 404 if (np->rxopt.all)
+3 -2
net/ipv6/ping.c
··· 102 102 103 103 if (msg->msg_name) { 104 104 DECLARE_SOCKADDR(struct sockaddr_in6 *, u, msg->msg_name); 105 - if (msg->msg_namelen < sizeof(struct sockaddr_in6) || 106 - u->sin6_family != AF_INET6) { 105 + if (msg->msg_namelen < sizeof(*u)) 107 106 return -EINVAL; 107 + if (u->sin6_family != AF_INET6) { 108 + return -EAFNOSUPPORT; 108 109 } 109 110 if (sk->sk_bound_dev_if && 110 111 sk->sk_bound_dev_if != u->sin6_scope_id) {
+3
net/netfilter/ipvs/ip_vs_sync.c
··· 896 896 IP_VS_DBG(2, "BACKUP, add new conn. failed\n"); 897 897 return; 898 898 } 899 + if (!(flags & IP_VS_CONN_F_TEMPLATE)) 900 + kfree(param->pe_data); 899 901 } 900 902 901 903 if (opt) ··· 1171 1169 (opt_flags & IPVS_OPT_F_SEQ_DATA ? &opt : NULL) 1172 1170 ); 1173 1171 #endif 1172 + ip_vs_pe_put(param.pe); 1174 1173 return 0; 1175 1174 /* Error exit */ 1176 1175 out:
+36 -25
net/netfilter/nf_tables_api.c
··· 227 227 228 228 static inline void nft_rule_clear(struct net *net, struct nft_rule *rule) 229 229 { 230 - rule->genmask = 0; 230 + rule->genmask &= ~(1 << gencursor_next(net)); 231 231 } 232 232 233 233 static int ··· 1711 1711 } 1712 1712 nla_nest_end(skb, list); 1713 1713 1714 - if (rule->ulen && 1715 - nla_put(skb, NFTA_RULE_USERDATA, rule->ulen, nft_userdata(rule))) 1716 - goto nla_put_failure; 1714 + if (rule->udata) { 1715 + struct nft_userdata *udata = nft_userdata(rule); 1716 + if (nla_put(skb, NFTA_RULE_USERDATA, udata->len + 1, 1717 + udata->data) < 0) 1718 + goto nla_put_failure; 1719 + } 1717 1720 1718 1721 nlmsg_end(skb, nlh); 1719 1722 return 0; ··· 1899 1896 struct nft_table *table; 1900 1897 struct nft_chain *chain; 1901 1898 struct nft_rule *rule, *old_rule = NULL; 1899 + struct nft_userdata *udata; 1902 1900 struct nft_trans *trans = NULL; 1903 1901 struct nft_expr *expr; 1904 1902 struct nft_ctx ctx; 1905 1903 struct nlattr *tmp; 1906 - unsigned int size, i, n, ulen = 0; 1904 + unsigned int size, i, n, ulen = 0, usize = 0; 1907 1905 int err, rem; 1908 1906 bool create; 1909 1907 u64 handle, pos_handle; ··· 1972 1968 n++; 1973 1969 } 1974 1970 } 1971 + /* Check for overflow of dlen field */ 1972 + err = -EFBIG; 1973 + if (size >= 1 << 12) 1974 + goto err1; 1975 1975 1976 - if (nla[NFTA_RULE_USERDATA]) 1976 + if (nla[NFTA_RULE_USERDATA]) { 1977 1977 ulen = nla_len(nla[NFTA_RULE_USERDATA]); 1978 + if (ulen > 0) 1979 + usize = sizeof(struct nft_userdata) + ulen; 1980 + } 1978 1981 1979 1982 err = -ENOMEM; 1980 - rule = kzalloc(sizeof(*rule) + size + ulen, GFP_KERNEL); 1983 + rule = kzalloc(sizeof(*rule) + size + usize, GFP_KERNEL); 1981 1984 if (rule == NULL) 1982 1985 goto err1; 1983 1986 ··· 1992 1981 1993 1982 rule->handle = handle; 1994 1983 rule->dlen = size; 1995 - rule->ulen = ulen; 1984 + rule->udata = ulen ? 1 : 0; 1996 1985 1997 - if (ulen) 1998 - nla_memcpy(nft_userdata(rule), nla[NFTA_RULE_USERDATA], ulen); 1986 + if (ulen) { 1987 + udata = nft_userdata(rule); 1988 + udata->len = ulen - 1; 1989 + nla_memcpy(udata->data, nla[NFTA_RULE_USERDATA], ulen); 1990 + } 1999 1991 2000 1992 expr = nft_expr_first(rule); 2001 1993 for (i = 0; i < n; i++) { ··· 2045 2031 2046 2032 err3: 2047 2033 list_del_rcu(&rule->list); 2048 - if (trans) { 2049 - list_del_rcu(&nft_trans_rule(trans)->list); 2050 - nft_rule_clear(net, nft_trans_rule(trans)); 2051 - nft_trans_destroy(trans); 2052 - chain->use++; 2053 - } 2054 2034 err2: 2055 2035 nf_tables_rule_destroy(&ctx, rule); 2056 2036 err1: ··· 3620 3612 &te->elem, 3621 3613 NFT_MSG_DELSETELEM, 0); 3622 3614 te->set->ops->get(te->set, &te->elem); 3623 - te->set->ops->remove(te->set, &te->elem); 3624 3615 nft_data_uninit(&te->elem.key, NFT_DATA_VALUE); 3625 - if (te->elem.flags & NFT_SET_MAP) { 3626 - nft_data_uninit(&te->elem.data, 3627 - te->set->dtype); 3628 - } 3616 + if (te->set->flags & NFT_SET_MAP && 3617 + !(te->elem.flags & NFT_SET_ELEM_INTERVAL_END)) 3618 + nft_data_uninit(&te->elem.data, te->set->dtype); 3619 + te->set->ops->remove(te->set, &te->elem); 3629 3620 nft_trans_destroy(trans); 3630 3621 break; 3631 3622 } ··· 3665 3658 { 3666 3659 struct net *net = sock_net(skb->sk); 3667 3660 struct nft_trans *trans, *next; 3668 - struct nft_set *set; 3661 + struct nft_trans_elem *te; 3669 3662 3670 3663 list_for_each_entry_safe(trans, next, &net->nft.commit_list, list) { 3671 3664 switch (trans->msg_type) { ··· 3726 3719 break; 3727 3720 case NFT_MSG_NEWSETELEM: 3728 3721 nft_trans_elem_set(trans)->nelems--; 3729 - set = nft_trans_elem_set(trans); 3730 - set->ops->get(set, &nft_trans_elem(trans)); 3731 - set->ops->remove(set, &nft_trans_elem(trans)); 3722 + te = (struct nft_trans_elem *)trans->data; 3723 + te->set->ops->get(te->set, &te->elem); 3724 + nft_data_uninit(&te->elem.key, NFT_DATA_VALUE); 3725 + if (te->set->flags & NFT_SET_MAP && 3726 + !(te->elem.flags & NFT_SET_ELEM_INTERVAL_END)) 3727 + nft_data_uninit(&te->elem.data, te->set->dtype); 3728 + te->set->ops->remove(te->set, &te->elem); 3732 3729 nft_trans_destroy(trans); 3733 3730 break; 3734 3731 case NFT_MSG_DELSETELEM:
+7 -7
net/netfilter/nft_compat.c
··· 123 123 nft_target_set_tgchk_param(struct xt_tgchk_param *par, 124 124 const struct nft_ctx *ctx, 125 125 struct xt_target *target, void *info, 126 - union nft_entry *entry, u8 proto, bool inv) 126 + union nft_entry *entry, u16 proto, bool inv) 127 127 { 128 128 par->net = ctx->net; 129 129 par->table = ctx->table->name; ··· 137 137 entry->e6.ipv6.invflags = inv ? IP6T_INV_PROTO : 0; 138 138 break; 139 139 case NFPROTO_BRIDGE: 140 - entry->ebt.ethproto = proto; 140 + entry->ebt.ethproto = (__force __be16)proto; 141 141 entry->ebt.invflags = inv ? EBT_IPROTO : 0; 142 142 break; 143 143 } ··· 171 171 [NFTA_RULE_COMPAT_FLAGS] = { .type = NLA_U32 }, 172 172 }; 173 173 174 - static int nft_parse_compat(const struct nlattr *attr, u8 *proto, bool *inv) 174 + static int nft_parse_compat(const struct nlattr *attr, u16 *proto, bool *inv) 175 175 { 176 176 struct nlattr *tb[NFTA_RULE_COMPAT_MAX+1]; 177 177 u32 flags; ··· 203 203 struct xt_target *target = expr->ops->data; 204 204 struct xt_tgchk_param par; 205 205 size_t size = XT_ALIGN(nla_len(tb[NFTA_TARGET_INFO])); 206 - u8 proto = 0; 206 + u16 proto = 0; 207 207 bool inv = false; 208 208 union nft_entry e = {}; 209 209 int ret; ··· 334 334 static void 335 335 nft_match_set_mtchk_param(struct xt_mtchk_param *par, const struct nft_ctx *ctx, 336 336 struct xt_match *match, void *info, 337 - union nft_entry *entry, u8 proto, bool inv) 337 + union nft_entry *entry, u16 proto, bool inv) 338 338 { 339 339 par->net = ctx->net; 340 340 par->table = ctx->table->name; ··· 348 348 entry->e6.ipv6.invflags = inv ? IP6T_INV_PROTO : 0; 349 349 break; 350 350 case NFPROTO_BRIDGE: 351 - entry->ebt.ethproto = proto; 351 + entry->ebt.ethproto = (__force __be16)proto; 352 352 entry->ebt.invflags = inv ? EBT_IPROTO : 0; 353 353 break; 354 354 } ··· 385 385 struct xt_match *match = expr->ops->data; 386 386 struct xt_mtchk_param par; 387 387 size_t size = XT_ALIGN(nla_len(tb[NFTA_MATCH_INFO])); 388 - u8 proto = 0; 388 + u16 proto = 0; 389 389 bool inv = false; 390 390 union nft_entry e = {}; 391 391 int ret;
+14 -8
net/packet/af_packet.c
··· 3123 3123 return 0; 3124 3124 } 3125 3125 3126 - static void packet_dev_mclist(struct net_device *dev, struct packet_mclist *i, int what) 3126 + static void packet_dev_mclist_delete(struct net_device *dev, 3127 + struct packet_mclist **mlp) 3127 3128 { 3128 - for ( ; i; i = i->next) { 3129 - if (i->ifindex == dev->ifindex) 3130 - packet_dev_mc(dev, i, what); 3129 + struct packet_mclist *ml; 3130 + 3131 + while ((ml = *mlp) != NULL) { 3132 + if (ml->ifindex == dev->ifindex) { 3133 + packet_dev_mc(dev, ml, -1); 3134 + *mlp = ml->next; 3135 + kfree(ml); 3136 + } else 3137 + mlp = &ml->next; 3131 3138 } 3132 3139 } 3133 3140 ··· 3211 3204 packet_dev_mc(dev, ml, -1); 3212 3205 kfree(ml); 3213 3206 } 3214 - rtnl_unlock(); 3215 - return 0; 3207 + break; 3216 3208 } 3217 3209 } 3218 3210 rtnl_unlock(); 3219 - return -EADDRNOTAVAIL; 3211 + return 0; 3220 3212 } 3221 3213 3222 3214 static void packet_flush_mclist(struct sock *sk) ··· 3565 3559 switch (msg) { 3566 3560 case NETDEV_UNREGISTER: 3567 3561 if (po->mclist) 3568 - packet_dev_mclist(dev, po->mclist, -1); 3562 + packet_dev_mclist_delete(dev, &po->mclist); 3569 3563 /* fallthrough */ 3570 3564 3571 3565 case NETDEV_DOWN:
+2 -2
net/rxrpc/ar-error.c
··· 42 42 _leave("UDP socket errqueue empty"); 43 43 return; 44 44 } 45 - if (!skb->len) { 45 + serr = SKB_EXT_ERR(skb); 46 + if (!skb->len && serr->ee.ee_origin == SO_EE_ORIGIN_TIMESTAMPING) { 46 47 _leave("UDP empty message"); 47 48 kfree_skb(skb); 48 49 return; ··· 51 50 52 51 rxrpc_new_skb(skb); 53 52 54 - serr = SKB_EXT_ERR(skb); 55 53 addr = *(__be32 *)(skb_network_header(skb) + serr->addr_offset); 56 54 port = serr->port; 57 55
+4 -3
net/tipc/link.c
··· 464 464 /* Clean up all queues, except inputq: */ 465 465 __skb_queue_purge(&l_ptr->outqueue); 466 466 __skb_queue_purge(&l_ptr->deferred_queue); 467 - skb_queue_splice_init(&l_ptr->wakeupq, &l_ptr->inputq); 468 - if (!skb_queue_empty(&l_ptr->inputq)) 467 + if (!owner->inputq) 468 + owner->inputq = &l_ptr->inputq; 469 + skb_queue_splice_init(&l_ptr->wakeupq, owner->inputq); 470 + if (!skb_queue_empty(owner->inputq)) 469 471 owner->action_flags |= TIPC_MSG_EVT; 470 - owner->inputq = &l_ptr->inputq; 471 472 l_ptr->next_out = NULL; 472 473 l_ptr->unacked_window = 0; 473 474 l_ptr->checkpoint = 1;