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

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

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (73 commits)
netfilter: Remove ADVANCED dependency from NF_CONNTRACK_NETBIOS_NS
ipv4: flush route cache after change accept_local
sch_red: fix red_change
Revert "udp: remove redundant variable"
bridge: master device stuck in no-carrier state forever when in user-stp mode
ipv4: Perform peer validation on cached route lookup.
net/core: fix rollback handler in register_netdevice_notifier
sch_red: fix red_calc_qavg_from_idle_time
bonding: only use primary address for ARP
ipv4: fix lockdep splat in rt_cache_seq_show
sch_teql: fix lockdep splat
net: fec: Select the FEC driver by default for i.MX SoCs
isdn: avoid copying too long drvid
isdn: make sure strings are null terminated
netlabel: Fix build problems when IPv6 is not enabled
sctp: better integer overflow check in sctp_auth_create_key()
sctp: integer overflow in sctp_auth_create_key()
ipv6: Set mcast_hops to IPV6_DEFAULT_MCASTHOPS when -1 was given.
net: Fix corruption in /proc/*/net/dev_mcast
mac80211: fix race between the AGG SM and the Tx data path
...

+589 -280
+6
drivers/isdn/divert/divert_procfs.c
··· 242 242 case IIOCDOCFINT: 243 243 if (!divert_if.drv_to_name(dioctl.cf_ctrl.drvid)) 244 244 return (-EINVAL); /* invalid driver */ 245 + if (strnlen(dioctl.cf_ctrl.msn, sizeof(dioctl.cf_ctrl.msn)) == 246 + sizeof(dioctl.cf_ctrl.msn)) 247 + return -EINVAL; 248 + if (strnlen(dioctl.cf_ctrl.fwd_nr, sizeof(dioctl.cf_ctrl.fwd_nr)) == 249 + sizeof(dioctl.cf_ctrl.fwd_nr)) 250 + return -EINVAL; 245 251 if ((i = cf_command(dioctl.cf_ctrl.drvid, 246 252 (cmd == IIOCDOCFACT) ? 1 : (cmd == IIOCDOCFDIS) ? 0 : 2, 247 253 dioctl.cf_ctrl.cfproc,
+3
drivers/isdn/i4l/isdn_net.c
··· 2756 2756 char *c, 2757 2757 *e; 2758 2758 2759 + if (strnlen(cfg->drvid, sizeof(cfg->drvid)) == 2760 + sizeof(cfg->drvid)) 2761 + return -EINVAL; 2759 2762 drvidx = -1; 2760 2763 chidx = -1; 2761 2764 strcpy(drvid, cfg->drvid);
+1 -1
drivers/net/arcnet/Kconfig
··· 4 4 5 5 menuconfig ARCNET 6 6 depends on NETDEVICES && (ISA || PCI || PCMCIA) 7 - bool "ARCnet support" 7 + tristate "ARCnet support" 8 8 ---help--- 9 9 If you have a network card of this type, say Y and check out the 10 10 (arguably) beautiful poetry in
+6 -27
drivers/net/bonding/bond_main.c
··· 2553 2553 } 2554 2554 } 2555 2555 2556 - static __be32 bond_glean_dev_ip(struct net_device *dev) 2557 - { 2558 - struct in_device *idev; 2559 - struct in_ifaddr *ifa; 2560 - __be32 addr = 0; 2561 - 2562 - if (!dev) 2563 - return 0; 2564 - 2565 - rcu_read_lock(); 2566 - idev = __in_dev_get_rcu(dev); 2567 - if (!idev) 2568 - goto out; 2569 - 2570 - ifa = idev->ifa_list; 2571 - if (!ifa) 2572 - goto out; 2573 - 2574 - addr = ifa->ifa_local; 2575 - out: 2576 - rcu_read_unlock(); 2577 - return addr; 2578 - } 2579 - 2580 2556 static int bond_has_this_ip(struct bonding *bond, __be32 ip) 2581 2557 { 2582 2558 struct vlan_entry *vlan; ··· 3298 3322 struct bonding *bond; 3299 3323 struct vlan_entry *vlan; 3300 3324 3325 + /* we only care about primary address */ 3326 + if(ifa->ifa_flags & IFA_F_SECONDARY) 3327 + return NOTIFY_DONE; 3328 + 3301 3329 list_for_each_entry(bond, &bn->dev_list, bond_list) { 3302 3330 if (bond->dev == event_dev) { 3303 3331 switch (event) { ··· 3309 3329 bond->master_ip = ifa->ifa_local; 3310 3330 return NOTIFY_OK; 3311 3331 case NETDEV_DOWN: 3312 - bond->master_ip = bond_glean_dev_ip(bond->dev); 3332 + bond->master_ip = 0; 3313 3333 return NOTIFY_OK; 3314 3334 default: 3315 3335 return NOTIFY_DONE; ··· 3325 3345 vlan->vlan_ip = ifa->ifa_local; 3326 3346 return NOTIFY_OK; 3327 3347 case NETDEV_DOWN: 3328 - vlan->vlan_ip = 3329 - bond_glean_dev_ip(vlan_dev); 3348 + vlan->vlan_ip = 0; 3330 3349 return NOTIFY_OK; 3331 3350 default: 3332 3351 return NOTIFY_DONE;
-1
drivers/net/can/sja1000/peak_pci.c
··· 20 20 */ 21 21 22 22 #include <linux/kernel.h> 23 - #include <linux/version.h> 24 23 #include <linux/module.h> 25 24 #include <linux/interrupt.h> 26 25 #include <linux/netdevice.h>
+1 -1
drivers/net/ethernet/broadcom/b44.c
··· 608 608 skb->len, 609 609 DMA_TO_DEVICE); 610 610 rp->skb = NULL; 611 - dev_kfree_skb(skb); 611 + dev_kfree_skb_irq(skb); 612 612 } 613 613 614 614 bp->tx_cons = cons;
+38 -1
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
··· 10327 10327 return 0; 10328 10328 } 10329 10329 10330 + 10331 + static void bnx2x_5461x_set_link_led(struct bnx2x_phy *phy, 10332 + struct link_params *params, u8 mode) 10333 + { 10334 + struct bnx2x *bp = params->bp; 10335 + u16 temp; 10336 + 10337 + bnx2x_cl22_write(bp, phy, 10338 + MDIO_REG_GPHY_SHADOW, 10339 + MDIO_REG_GPHY_SHADOW_LED_SEL1); 10340 + bnx2x_cl22_read(bp, phy, 10341 + MDIO_REG_GPHY_SHADOW, 10342 + &temp); 10343 + temp &= 0xff00; 10344 + 10345 + DP(NETIF_MSG_LINK, "54618x set link led (mode=%x)\n", mode); 10346 + switch (mode) { 10347 + case LED_MODE_FRONT_PANEL_OFF: 10348 + case LED_MODE_OFF: 10349 + temp |= 0x00ee; 10350 + break; 10351 + case LED_MODE_OPER: 10352 + temp |= 0x0001; 10353 + break; 10354 + case LED_MODE_ON: 10355 + temp |= 0x00ff; 10356 + break; 10357 + default: 10358 + break; 10359 + } 10360 + bnx2x_cl22_write(bp, phy, 10361 + MDIO_REG_GPHY_SHADOW, 10362 + MDIO_REG_GPHY_SHADOW_WR_ENA | temp); 10363 + return; 10364 + } 10365 + 10366 + 10330 10367 static void bnx2x_54618se_link_reset(struct bnx2x_phy *phy, 10331 10368 struct link_params *params) 10332 10369 { ··· 11140 11103 .config_loopback = (config_loopback_t)bnx2x_54618se_config_loopback, 11141 11104 .format_fw_ver = (format_fw_ver_t)NULL, 11142 11105 .hw_reset = (hw_reset_t)NULL, 11143 - .set_link_led = (set_link_led_t)NULL, 11106 + .set_link_led = (set_link_led_t)bnx2x_5461x_set_link_led, 11144 11107 .phy_specific_func = (phy_specific_func_t)NULL 11145 11108 }; 11146 11109 /*****************************************************************/
+1
drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h
··· 6990 6990 #define MDIO_REG_INTR_MASK 0x1b 6991 6991 #define MDIO_REG_INTR_MASK_LINK_STATUS (0x1 << 1) 6992 6992 #define MDIO_REG_GPHY_SHADOW 0x1c 6993 + #define MDIO_REG_GPHY_SHADOW_LED_SEL1 (0x0d << 10) 6993 6994 #define MDIO_REG_GPHY_SHADOW_LED_SEL2 (0x0e << 10) 6994 6995 #define MDIO_REG_GPHY_SHADOW_WR_ENA (0x1 << 15) 6995 6996 #define MDIO_REG_GPHY_SHADOW_AUTO_DET_MED (0x1e << 10)
+1 -1
drivers/net/ethernet/davicom/dm9000.c
··· 613 613 614 614 if (!dm->wake_state) 615 615 irq_set_irq_wake(dm->irq_wake, 1); 616 - else if (dm->wake_state & !opts) 616 + else if (dm->wake_state && !opts) 617 617 irq_set_irq_wake(dm->irq_wake, 0); 618 618 } 619 619
+1
drivers/net/ethernet/freescale/Kconfig
··· 24 24 bool "FEC ethernet controller (of ColdFire and some i.MX CPUs)" 25 25 depends on (M523x || M527x || M5272 || M528x || M520x || M532x || \ 26 26 ARCH_MXC || ARCH_MXS) 27 + default ARCH_MXC || ARCH_MXS if ARM 27 28 select PHYLIB 28 29 ---help--- 29 30 Say Y here if you want to use the built-in 10/100 Fast ethernet
+2 -2
drivers/net/ethernet/ibm/ehea/ehea.h
··· 61 61 #ifdef EHEA_SMALL_QUEUES 62 62 #define EHEA_MAX_CQE_COUNT 1023 63 63 #define EHEA_DEF_ENTRIES_SQ 1023 64 - #define EHEA_DEF_ENTRIES_RQ1 4095 64 + #define EHEA_DEF_ENTRIES_RQ1 1023 65 65 #define EHEA_DEF_ENTRIES_RQ2 1023 66 - #define EHEA_DEF_ENTRIES_RQ3 1023 66 + #define EHEA_DEF_ENTRIES_RQ3 511 67 67 #else 68 68 #define EHEA_MAX_CQE_COUNT 4080 69 69 #define EHEA_DEF_ENTRIES_SQ 4080
+4 -2
drivers/net/ethernet/ibm/ehea/ehea_main.c
··· 371 371 out_herr: 372 372 free_page((unsigned long)cb2); 373 373 resched: 374 - schedule_delayed_work(&port->stats_work, msecs_to_jiffies(1000)); 374 + schedule_delayed_work(&port->stats_work, 375 + round_jiffies_relative(msecs_to_jiffies(1000))); 375 376 } 376 377 377 378 static void ehea_refill_rq1(struct ehea_port_res *pr, int index, int nr_of_wqes) ··· 2435 2434 } 2436 2435 2437 2436 mutex_unlock(&port->port_lock); 2438 - schedule_delayed_work(&port->stats_work, msecs_to_jiffies(1000)); 2437 + schedule_delayed_work(&port->stats_work, 2438 + round_jiffies_relative(msecs_to_jiffies(1000))); 2439 2439 2440 2440 return ret; 2441 2441 }
+1 -1
drivers/net/ethernet/ibm/iseries_veth.c
··· 1421 1421 1422 1422 /* FIXME: do we need this? */ 1423 1423 memset(local_list, 0, sizeof(local_list)); 1424 - memset(remote_list, 0, sizeof(VETH_MAX_FRAMES_PER_MSG)); 1424 + memset(remote_list, 0, sizeof(remote_list)); 1425 1425 1426 1426 /* a 0 address marks the end of the valid entries */ 1427 1427 if (senddata->addr[startchunk] == 0)
+110 -3
drivers/net/ethernet/jme.c
··· 1745 1745 } 1746 1746 1747 1747 static int 1748 + jme_phy_specreg_read(struct jme_adapter *jme, u32 specreg) 1749 + { 1750 + u32 phy_addr; 1751 + 1752 + phy_addr = JM_PHY_SPEC_REG_READ | specreg; 1753 + jme_mdio_write(jme->dev, jme->mii_if.phy_id, JM_PHY_SPEC_ADDR_REG, 1754 + phy_addr); 1755 + return jme_mdio_read(jme->dev, jme->mii_if.phy_id, 1756 + JM_PHY_SPEC_DATA_REG); 1757 + } 1758 + 1759 + static void 1760 + jme_phy_specreg_write(struct jme_adapter *jme, u32 ext_reg, u32 phy_data) 1761 + { 1762 + u32 phy_addr; 1763 + 1764 + phy_addr = JM_PHY_SPEC_REG_WRITE | ext_reg; 1765 + jme_mdio_write(jme->dev, jme->mii_if.phy_id, JM_PHY_SPEC_DATA_REG, 1766 + phy_data); 1767 + jme_mdio_write(jme->dev, jme->mii_if.phy_id, JM_PHY_SPEC_ADDR_REG, 1768 + phy_addr); 1769 + } 1770 + 1771 + static int 1772 + jme_phy_calibration(struct jme_adapter *jme) 1773 + { 1774 + u32 ctrl1000, phy_data; 1775 + 1776 + jme_phy_off(jme); 1777 + jme_phy_on(jme); 1778 + /* Enabel PHY test mode 1 */ 1779 + ctrl1000 = jme_mdio_read(jme->dev, jme->mii_if.phy_id, MII_CTRL1000); 1780 + ctrl1000 &= ~PHY_GAD_TEST_MODE_MSK; 1781 + ctrl1000 |= PHY_GAD_TEST_MODE_1; 1782 + jme_mdio_write(jme->dev, jme->mii_if.phy_id, MII_CTRL1000, ctrl1000); 1783 + 1784 + phy_data = jme_phy_specreg_read(jme, JM_PHY_EXT_COMM_2_REG); 1785 + phy_data &= ~JM_PHY_EXT_COMM_2_CALI_MODE_0; 1786 + phy_data |= JM_PHY_EXT_COMM_2_CALI_LATCH | 1787 + JM_PHY_EXT_COMM_2_CALI_ENABLE; 1788 + jme_phy_specreg_write(jme, JM_PHY_EXT_COMM_2_REG, phy_data); 1789 + msleep(20); 1790 + phy_data = jme_phy_specreg_read(jme, JM_PHY_EXT_COMM_2_REG); 1791 + phy_data &= ~(JM_PHY_EXT_COMM_2_CALI_ENABLE | 1792 + JM_PHY_EXT_COMM_2_CALI_MODE_0 | 1793 + JM_PHY_EXT_COMM_2_CALI_LATCH); 1794 + jme_phy_specreg_write(jme, JM_PHY_EXT_COMM_2_REG, phy_data); 1795 + 1796 + /* Disable PHY test mode */ 1797 + ctrl1000 = jme_mdio_read(jme->dev, jme->mii_if.phy_id, MII_CTRL1000); 1798 + ctrl1000 &= ~PHY_GAD_TEST_MODE_MSK; 1799 + jme_mdio_write(jme->dev, jme->mii_if.phy_id, MII_CTRL1000, ctrl1000); 1800 + return 0; 1801 + } 1802 + 1803 + static int 1804 + jme_phy_setEA(struct jme_adapter *jme) 1805 + { 1806 + u32 phy_comm0 = 0, phy_comm1 = 0; 1807 + u8 nic_ctrl; 1808 + 1809 + pci_read_config_byte(jme->pdev, PCI_PRIV_SHARE_NICCTRL, &nic_ctrl); 1810 + if ((nic_ctrl & 0x3) == JME_FLAG_PHYEA_ENABLE) 1811 + return 0; 1812 + 1813 + switch (jme->pdev->device) { 1814 + case PCI_DEVICE_ID_JMICRON_JMC250: 1815 + if (((jme->chip_main_rev == 5) && 1816 + ((jme->chip_sub_rev == 0) || (jme->chip_sub_rev == 1) || 1817 + (jme->chip_sub_rev == 3))) || 1818 + (jme->chip_main_rev >= 6)) { 1819 + phy_comm0 = 0x008A; 1820 + phy_comm1 = 0x4109; 1821 + } 1822 + if ((jme->chip_main_rev == 3) && 1823 + ((jme->chip_sub_rev == 1) || (jme->chip_sub_rev == 2))) 1824 + phy_comm0 = 0xE088; 1825 + break; 1826 + case PCI_DEVICE_ID_JMICRON_JMC260: 1827 + if (((jme->chip_main_rev == 5) && 1828 + ((jme->chip_sub_rev == 0) || (jme->chip_sub_rev == 1) || 1829 + (jme->chip_sub_rev == 3))) || 1830 + (jme->chip_main_rev >= 6)) { 1831 + phy_comm0 = 0x008A; 1832 + phy_comm1 = 0x4109; 1833 + } 1834 + if ((jme->chip_main_rev == 3) && 1835 + ((jme->chip_sub_rev == 1) || (jme->chip_sub_rev == 2))) 1836 + phy_comm0 = 0xE088; 1837 + if ((jme->chip_main_rev == 2) && (jme->chip_sub_rev == 0)) 1838 + phy_comm0 = 0x608A; 1839 + if ((jme->chip_main_rev == 2) && (jme->chip_sub_rev == 2)) 1840 + phy_comm0 = 0x408A; 1841 + break; 1842 + default: 1843 + return -ENODEV; 1844 + } 1845 + if (phy_comm0) 1846 + jme_phy_specreg_write(jme, JM_PHY_EXT_COMM_0_REG, phy_comm0); 1847 + if (phy_comm1) 1848 + jme_phy_specreg_write(jme, JM_PHY_EXT_COMM_1_REG, phy_comm1); 1849 + 1850 + return 0; 1851 + } 1852 + 1853 + static int 1748 1854 jme_open(struct net_device *netdev) 1749 1855 { 1750 1856 struct jme_adapter *jme = netdev_priv(netdev); ··· 1875 1769 jme_set_settings(netdev, &jme->old_ecmd); 1876 1770 else 1877 1771 jme_reset_phy_processor(jme); 1878 - 1772 + jme_phy_calibration(jme); 1773 + jme_phy_setEA(jme); 1879 1774 jme_reset_link(jme); 1880 1775 1881 1776 return 0; ··· 3291 3184 jme_set_settings(netdev, &jme->old_ecmd); 3292 3185 else 3293 3186 jme_reset_phy_processor(jme); 3294 - 3187 + jme_phy_calibration(jme); 3188 + jme_phy_setEA(jme); 3295 3189 jme_start_irq(jme); 3296 3190 netif_device_attach(netdev); 3297 3191 ··· 3347 3239 MODULE_LICENSE("GPL"); 3348 3240 MODULE_VERSION(DRV_VERSION); 3349 3241 MODULE_DEVICE_TABLE(pci, jme_pci_tbl); 3350 -
+19
drivers/net/ethernet/jme.h
··· 760 760 RXMCS_CHECKSUM, 761 761 }; 762 762 763 + /* Extern PHY common register 2 */ 764 + 765 + #define PHY_GAD_TEST_MODE_1 0x00002000 766 + #define PHY_GAD_TEST_MODE_MSK 0x0000E000 767 + #define JM_PHY_SPEC_REG_READ 0x00004000 768 + #define JM_PHY_SPEC_REG_WRITE 0x00008000 769 + #define PHY_CALIBRATION_DELAY 20 770 + #define JM_PHY_SPEC_ADDR_REG 0x1E 771 + #define JM_PHY_SPEC_DATA_REG 0x1F 772 + 773 + #define JM_PHY_EXT_COMM_0_REG 0x30 774 + #define JM_PHY_EXT_COMM_1_REG 0x31 775 + #define JM_PHY_EXT_COMM_2_REG 0x32 776 + #define JM_PHY_EXT_COMM_2_CALI_ENABLE 0x01 777 + #define JM_PHY_EXT_COMM_2_CALI_MODE_0 0x02 778 + #define JM_PHY_EXT_COMM_2_CALI_LATCH 0x10 779 + #define PCI_PRIV_SHARE_NICCTRL 0xF5 780 + #define JME_FLAG_PHYEA_ENABLE 0x2 781 + 763 782 /* 764 783 * Wakeup Frame setup interface registers 765 784 */
+3 -5
drivers/net/ethernet/qlogic/qlge/qlge.h
··· 58 58 59 59 60 60 #define TX_DESC_PER_IOCB 8 61 - /* The maximum number of frags we handle is based 62 - * on PAGE_SIZE... 63 - */ 64 - #if (PAGE_SHIFT == 12) || (PAGE_SHIFT == 13) /* 4k & 8k pages */ 61 + 62 + #if ((MAX_SKB_FRAGS - TX_DESC_PER_IOCB) + 2) > 0 65 63 #define TX_DESC_PER_OAL ((MAX_SKB_FRAGS - TX_DESC_PER_IOCB) + 2) 66 64 #else /* all other page sizes */ 67 65 #define TX_DESC_PER_OAL 0 ··· 1351 1353 struct ob_mac_iocb_req *queue_entry; 1352 1354 u32 index; 1353 1355 struct oal oal; 1354 - struct map_list map[MAX_SKB_FRAGS + 1]; 1356 + struct map_list map[MAX_SKB_FRAGS + 2]; 1355 1357 int map_cnt; 1356 1358 struct tx_ring_desc *next; 1357 1359 };
+9 -5
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 781 781 unsigned int mode = MMC_CNTRL_RESET_ON_READ | MMC_CNTRL_COUNTER_RESET | 782 782 MMC_CNTRL_PRESET | MMC_CNTRL_FULL_HALF_PRESET; 783 783 784 - /* Do not manage MMC IRQ (FIXME) */ 784 + /* Mask MMC irq, counters are managed in SW and registers 785 + * are cleared on each READ eventually. */ 785 786 dwmac_mmc_intr_all_mask(priv->ioaddr); 786 - dwmac_mmc_ctrl(priv->ioaddr, mode); 787 - memset(&priv->mmc, 0, sizeof(struct stmmac_counters)); 787 + 788 + if (priv->dma_cap.rmon) { 789 + dwmac_mmc_ctrl(priv->ioaddr, mode); 790 + memset(&priv->mmc, 0, sizeof(struct stmmac_counters)); 791 + } else 792 + pr_info(" No MAC Management Counters available"); 788 793 } 789 794 790 795 static u32 stmmac_get_synopsys_id(struct stmmac_priv *priv) ··· 1017 1012 memset(&priv->xstats, 0, sizeof(struct stmmac_extra_stats)); 1018 1013 priv->xstats.threshold = tc; 1019 1014 1020 - if (priv->dma_cap.rmon) 1021 - stmmac_mmc_setup(priv); 1015 + stmmac_mmc_setup(priv); 1022 1016 1023 1017 /* Start the ball rolling... */ 1024 1018 DBG(probe, DEBUG, "%s: DMA RX/TX processes started...\n", dev->name);
+1 -1
drivers/net/phy/Kconfig
··· 3 3 # 4 4 5 5 menuconfig PHYLIB 6 - bool "PHY Device support and infrastructure" 6 + tristate "PHY Device support and infrastructure" 7 7 depends on !S390 8 8 depends on NETDEVICES 9 9 help
+3 -2
drivers/net/wireless/p54/p54spi.c
··· 588 588 589 589 WARN_ON(priv->fw_state != FW_STATE_READY); 590 590 591 - cancel_work_sync(&priv->work); 592 - 593 591 p54spi_power_off(priv); 594 592 spin_lock_irqsave(&priv->tx_lock, flags); 595 593 INIT_LIST_HEAD(&priv->tx_pending); ··· 595 597 596 598 priv->fw_state = FW_STATE_OFF; 597 599 mutex_unlock(&priv->mutex); 600 + 601 + cancel_work_sync(&priv->work); 598 602 } 599 603 600 604 static int __devinit p54spi_probe(struct spi_device *spi) ··· 656 656 init_completion(&priv->fw_comp); 657 657 INIT_LIST_HEAD(&priv->tx_pending); 658 658 mutex_init(&priv->mutex); 659 + spin_lock_init(&priv->tx_lock); 659 660 SET_IEEE80211_DEV(hw, &spi->dev); 660 661 priv->common.open = p54spi_op_start; 661 662 priv->common.stop = p54spi_op_stop;
+1 -1
drivers/net/wireless/prism54/isl_ioctl.c
··· 778 778 dwrq->flags = 0; 779 779 dwrq->length = 0; 780 780 } 781 - essid->octets[essid->length] = '\0'; 781 + essid->octets[dwrq->length] = '\0'; 782 782 memcpy(extra, essid->octets, dwrq->length); 783 783 kfree(essid); 784 784
+1 -1
drivers/net/wireless/rt2x00/rt2800lib.c
··· 3771 3771 /* Apparently the data is read from end to start */ 3772 3772 rt2800_register_read_lock(rt2x00dev, EFUSE_DATA3, &reg); 3773 3773 /* The returned value is in CPU order, but eeprom is le */ 3774 - rt2x00dev->eeprom[i] = cpu_to_le32(reg); 3774 + *(u32 *)&rt2x00dev->eeprom[i] = cpu_to_le32(reg); 3775 3775 rt2800_register_read_lock(rt2x00dev, EFUSE_DATA2, &reg); 3776 3776 *(u32 *)&rt2x00dev->eeprom[i + 2] = cpu_to_le32(reg); 3777 3777 rt2800_register_read_lock(rt2x00dev, EFUSE_DATA1, &reg);
+9 -8
drivers/net/wireless/rtlwifi/ps.c
··· 395 395 if (mac->link_state != MAC80211_LINKED) 396 396 return; 397 397 398 - spin_lock(&rtlpriv->locks.lps_lock); 398 + spin_lock_irq(&rtlpriv->locks.lps_lock); 399 399 400 400 /* Idle for a while if we connect to AP a while ago. */ 401 401 if (mac->cnt_after_linked >= 2) { ··· 407 407 } 408 408 } 409 409 410 - spin_unlock(&rtlpriv->locks.lps_lock); 410 + spin_unlock_irq(&rtlpriv->locks.lps_lock); 411 411 } 412 412 413 413 /*Leave the leisure power save mode.*/ ··· 416 416 struct rtl_priv *rtlpriv = rtl_priv(hw); 417 417 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); 418 418 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); 419 + unsigned long flags; 419 420 420 - spin_lock(&rtlpriv->locks.lps_lock); 421 + spin_lock_irqsave(&rtlpriv->locks.lps_lock, flags); 421 422 422 423 if (ppsc->fwctrl_lps) { 423 424 if (ppsc->dot11_psmode != EACTIVE) { ··· 439 438 rtl_lps_set_psmode(hw, EACTIVE); 440 439 } 441 440 } 442 - spin_unlock(&rtlpriv->locks.lps_lock); 441 + spin_unlock_irqrestore(&rtlpriv->locks.lps_lock, flags); 443 442 } 444 443 445 444 /* For sw LPS*/ ··· 540 539 RT_CLEAR_PS_LEVEL(ppsc, RT_PS_LEVEL_ASPM); 541 540 } 542 541 543 - spin_lock(&rtlpriv->locks.lps_lock); 542 + spin_lock_irq(&rtlpriv->locks.lps_lock); 544 543 rtl_ps_set_rf_state(hw, ERFON, RF_CHANGE_BY_PS); 545 - spin_unlock(&rtlpriv->locks.lps_lock); 544 + spin_unlock_irq(&rtlpriv->locks.lps_lock); 546 545 } 547 546 548 547 void rtl_swlps_rfon_wq_callback(void *data) ··· 575 574 if (rtlpriv->link_info.busytraffic) 576 575 return; 577 576 578 - spin_lock(&rtlpriv->locks.lps_lock); 577 + spin_lock_irq(&rtlpriv->locks.lps_lock); 579 578 rtl_ps_set_rf_state(hw, ERFSLEEP, RF_CHANGE_BY_PS); 580 - spin_unlock(&rtlpriv->locks.lps_lock); 579 + spin_unlock_irq(&rtlpriv->locks.lps_lock); 581 580 582 581 if (ppsc->reg_rfps_level & RT_RF_OFF_LEVL_ASPM && 583 582 !RT_IN_PS_LEVEL(ppsc, RT_PS_LEVEL_ASPM)) {
+1 -1
drivers/net/xen-netback/netback.c
··· 1021 1021 pending_idx = *((u16 *)skb->data); 1022 1022 xen_netbk_idx_release(netbk, pending_idx); 1023 1023 for (j = start; j < i; j++) { 1024 - pending_idx = frag_get_pending_idx(&shinfo->frags[i]); 1024 + pending_idx = frag_get_pending_idx(&shinfo->frags[j]); 1025 1025 xen_netbk_idx_release(netbk, pending_idx); 1026 1026 } 1027 1027
+2
include/linux/netdevice.h
··· 2536 2536 extern void *dev_seq_start(struct seq_file *seq, loff_t *pos); 2537 2537 extern void *dev_seq_next(struct seq_file *seq, void *v, loff_t *pos); 2538 2538 extern void dev_seq_stop(struct seq_file *seq, void *v); 2539 + extern int dev_seq_open_ops(struct inode *inode, struct file *file, 2540 + const struct seq_operations *ops); 2539 2541 #endif 2540 2542 2541 2543 extern int netdev_class_create_file(struct class_attribute *class_attr);
+3 -3
include/linux/pkt_sched.h
··· 30 30 */ 31 31 32 32 struct tc_stats { 33 - __u64 bytes; /* NUmber of enqueues bytes */ 33 + __u64 bytes; /* Number of enqueued bytes */ 34 34 __u32 packets; /* Number of enqueued packets */ 35 35 __u32 drops; /* Packets dropped because of lack of resources */ 36 36 __u32 overlimits; /* Number of throttle events when this ··· 297 297 __u32 debug; /* debug flags */ 298 298 299 299 /* stats */ 300 - __u32 direct_pkts; /* count of non shapped packets */ 300 + __u32 direct_pkts; /* count of non shaped packets */ 301 301 }; 302 302 enum { 303 303 TCA_HTB_UNSPEC, ··· 503 503 }; 504 504 #define NETEM_LOSS_MAX (__NETEM_LOSS_MAX - 1) 505 505 506 - /* State transition probablities for 4 state model */ 506 + /* State transition probabilities for 4 state model */ 507 507 struct tc_netem_gimodel { 508 508 __u32 p13; 509 509 __u32 p31;
+1 -6
include/net/dst.h
··· 205 205 206 206 static inline u32 dst_mtu(const struct dst_entry *dst) 207 207 { 208 - u32 mtu = dst_metric_raw(dst, RTAX_MTU); 209 - 210 - if (!mtu) 211 - mtu = dst->ops->default_mtu(dst); 212 - 213 - return mtu; 208 + return dst->ops->mtu(dst); 214 209 } 215 210 216 211 /* RTT metrics are stored in milliseconds for user ABI, but used as jiffies */
+1 -1
include/net/dst_ops.h
··· 17 17 int (*gc)(struct dst_ops *ops); 18 18 struct dst_entry * (*check)(struct dst_entry *, __u32 cookie); 19 19 unsigned int (*default_advmss)(const struct dst_entry *); 20 - unsigned int (*default_mtu)(const struct dst_entry *); 20 + unsigned int (*mtu)(const struct dst_entry *); 21 21 u32 * (*cow_metrics)(struct dst_entry *, unsigned long); 22 22 void (*destroy)(struct dst_entry *); 23 23 void (*ifdown)(struct dst_entry *,
+2
include/net/inet_sock.h
··· 31 31 /** struct ip_options - IP Options 32 32 * 33 33 * @faddr - Saved first hop address 34 + * @nexthop - Saved nexthop address in LSRR and SSRR 34 35 * @is_data - Options in __data, rather than skb 35 36 * @is_strictroute - Strict source route 36 37 * @srr_is_hit - Packet destination addr was our one ··· 42 41 */ 43 42 struct ip_options { 44 43 __be32 faddr; 44 + __be32 nexthop; 45 45 unsigned char optlen; 46 46 unsigned char srr; 47 47 unsigned char rr;
+1
include/net/inetpeer.h
··· 35 35 36 36 u32 metrics[RTAX_MAX]; 37 37 u32 rate_tokens; /* rate limiting for ICMP */ 38 + int redirect_genid; 38 39 unsigned long rate_last; 39 40 unsigned long pmtu_expires; 40 41 u32 pmtu_orig;
+10 -9
include/net/netfilter/nf_conntrack_ecache.h
··· 67 67 int (*fcn)(unsigned int events, struct nf_ct_event *item); 68 68 }; 69 69 70 - extern struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb; 71 - extern int nf_conntrack_register_notifier(struct nf_ct_event_notifier *nb); 72 - extern void nf_conntrack_unregister_notifier(struct nf_ct_event_notifier *nb); 70 + extern int nf_conntrack_register_notifier(struct net *net, struct nf_ct_event_notifier *nb); 71 + extern void nf_conntrack_unregister_notifier(struct net *net, struct nf_ct_event_notifier *nb); 73 72 74 73 extern void nf_ct_deliver_cached_events(struct nf_conn *ct); 75 74 76 75 static inline void 77 76 nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct) 78 77 { 78 + struct net *net = nf_ct_net(ct); 79 79 struct nf_conntrack_ecache *e; 80 80 81 - if (nf_conntrack_event_cb == NULL) 81 + if (net->ct.nf_conntrack_event_cb == NULL) 82 82 return; 83 83 84 84 e = nf_ct_ecache_find(ct); ··· 95 95 int report) 96 96 { 97 97 int ret = 0; 98 + struct net *net = nf_ct_net(ct); 98 99 struct nf_ct_event_notifier *notify; 99 100 struct nf_conntrack_ecache *e; 100 101 101 102 rcu_read_lock(); 102 - notify = rcu_dereference(nf_conntrack_event_cb); 103 + notify = rcu_dereference(net->ct.nf_conntrack_event_cb); 103 104 if (notify == NULL) 104 105 goto out_unlock; 105 106 ··· 165 164 int (*fcn)(unsigned int events, struct nf_exp_event *item); 166 165 }; 167 166 168 - extern struct nf_exp_event_notifier __rcu *nf_expect_event_cb; 169 - extern int nf_ct_expect_register_notifier(struct nf_exp_event_notifier *nb); 170 - extern void nf_ct_expect_unregister_notifier(struct nf_exp_event_notifier *nb); 167 + extern int nf_ct_expect_register_notifier(struct net *net, struct nf_exp_event_notifier *nb); 168 + extern void nf_ct_expect_unregister_notifier(struct net *net, struct nf_exp_event_notifier *nb); 171 169 172 170 static inline void 173 171 nf_ct_expect_event_report(enum ip_conntrack_expect_events event, ··· 174 174 u32 pid, 175 175 int report) 176 176 { 177 + struct net *net = nf_ct_exp_net(exp); 177 178 struct nf_exp_event_notifier *notify; 178 179 struct nf_conntrack_ecache *e; 179 180 180 181 rcu_read_lock(); 181 - notify = rcu_dereference(nf_expect_event_cb); 182 + notify = rcu_dereference(net->ct.nf_expect_event_cb); 182 183 if (notify == NULL) 183 184 goto out_unlock; 184 185
+2
include/net/netns/conntrack.h
··· 18 18 struct hlist_nulls_head unconfirmed; 19 19 struct hlist_nulls_head dying; 20 20 struct ip_conntrack_stat __percpu *stat; 21 + struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb; 22 + struct nf_exp_event_notifier __rcu *nf_expect_event_cb; 21 23 int sysctl_events; 22 24 unsigned int sysctl_events_retry_timeout; 23 25 int sysctl_acct;
+6 -9
include/net/red.h
··· 116 116 u32 qR; /* Cached random number */ 117 117 118 118 unsigned long qavg; /* Average queue length: A scaled */ 119 - psched_time_t qidlestart; /* Start of current idle period */ 119 + ktime_t qidlestart; /* Start of current idle period */ 120 120 }; 121 121 122 122 static inline u32 red_rmask(u8 Plog) ··· 148 148 149 149 static inline int red_is_idling(struct red_parms *p) 150 150 { 151 - return p->qidlestart != PSCHED_PASTPERFECT; 151 + return p->qidlestart.tv64 != 0; 152 152 } 153 153 154 154 static inline void red_start_of_idle_period(struct red_parms *p) 155 155 { 156 - p->qidlestart = psched_get_time(); 156 + p->qidlestart = ktime_get(); 157 157 } 158 158 159 159 static inline void red_end_of_idle_period(struct red_parms *p) 160 160 { 161 - p->qidlestart = PSCHED_PASTPERFECT; 161 + p->qidlestart.tv64 = 0; 162 162 } 163 163 164 164 static inline void red_restart(struct red_parms *p) ··· 170 170 171 171 static inline unsigned long red_calc_qavg_from_idle_time(struct red_parms *p) 172 172 { 173 - psched_time_t now; 174 - long us_idle; 173 + s64 delta = ktime_us_delta(ktime_get(), p->qidlestart); 174 + long us_idle = min_t(s64, delta, p->Scell_max); 175 175 int shift; 176 - 177 - now = psched_get_time(); 178 - us_idle = psched_tdiff_bounded(now, p->qidlestart, p->Scell_max); 179 176 180 177 /* 181 178 * The problem: ideally, average length queue recalcultion should
+2 -2
include/net/route.h
··· 71 71 struct fib_info *fi; /* for client ref to shared metrics */ 72 72 }; 73 73 74 - static inline bool rt_is_input_route(struct rtable *rt) 74 + static inline bool rt_is_input_route(const struct rtable *rt) 75 75 { 76 76 return rt->rt_route_iif != 0; 77 77 } 78 78 79 - static inline bool rt_is_output_route(struct rtable *rt) 79 + static inline bool rt_is_output_route(const struct rtable *rt) 80 80 { 81 81 return rt->rt_route_iif == 0; 82 82 }
+6
net/bridge/br_netlink.c
··· 18 18 #include <net/sock.h> 19 19 20 20 #include "br_private.h" 21 + #include "br_private_stp.h" 21 22 22 23 static inline size_t br_nlmsg_size(void) 23 24 { ··· 189 188 190 189 p->state = new_state; 191 190 br_log_state(p); 191 + 192 + spin_lock_bh(&p->br->lock); 193 + br_port_state_selection(p->br); 194 + spin_unlock_bh(&p->br->lock); 195 + 192 196 br_ifinfo_notify(RTM_NEWLINK, p); 193 197 194 198 return 0;
+14 -15
net/bridge/br_stp.c
··· 399 399 struct net_bridge_port *p; 400 400 unsigned int liveports = 0; 401 401 402 - /* Don't change port states if userspace is handling STP */ 403 - if (br->stp_enabled == BR_USER_STP) 404 - return; 405 - 406 402 list_for_each_entry(p, &br->port_list, list) { 407 403 if (p->state == BR_STATE_DISABLED) 408 404 continue; 409 405 410 - if (p->port_no == br->root_port) { 411 - p->config_pending = 0; 412 - p->topology_change_ack = 0; 413 - br_make_forwarding(p); 414 - } else if (br_is_designated_port(p)) { 415 - del_timer(&p->message_age_timer); 416 - br_make_forwarding(p); 417 - } else { 418 - p->config_pending = 0; 419 - p->topology_change_ack = 0; 420 - br_make_blocking(p); 406 + /* Don't change port states if userspace is handling STP */ 407 + if (br->stp_enabled != BR_USER_STP) { 408 + if (p->port_no == br->root_port) { 409 + p->config_pending = 0; 410 + p->topology_change_ack = 0; 411 + br_make_forwarding(p); 412 + } else if (br_is_designated_port(p)) { 413 + del_timer(&p->message_age_timer); 414 + br_make_forwarding(p); 415 + } else { 416 + p->config_pending = 0; 417 + p->topology_change_ack = 0; 418 + br_make_blocking(p); 419 + } 421 420 } 422 421 423 422 if (p->state == BR_STATE_FORWARDING)
+6 -5
net/caif/cffrml.c
··· 136 136 137 137 static int cffrml_transmit(struct cflayer *layr, struct cfpkt *pkt) 138 138 { 139 - int tmp; 140 139 u16 chks; 141 140 u16 len; 141 + __le16 data; 142 + 142 143 struct cffrml *this = container_obj(layr); 143 144 if (this->dofcs) { 144 145 chks = cfpkt_iterate(pkt, cffrml_checksum, 0xffff); 145 - tmp = cpu_to_le16(chks); 146 - cfpkt_add_trail(pkt, &tmp, 2); 146 + data = cpu_to_le16(chks); 147 + cfpkt_add_trail(pkt, &data, 2); 147 148 } else { 148 149 cfpkt_pad_trail(pkt, 2); 149 150 } 150 151 len = cfpkt_getlen(pkt); 151 - tmp = cpu_to_le16(len); 152 - cfpkt_add_head(pkt, &tmp, 2); 152 + data = cpu_to_le16(len); 153 + cfpkt_add_head(pkt, &data, 2); 153 154 cfpkt_info(pkt)->hdr_len += 2; 154 155 if (cfpkt_erroneous(pkt)) { 155 156 pr_err("Packet is erroneous!\n");
+8 -1
net/core/dev.c
··· 1396 1396 for_each_net(net) { 1397 1397 for_each_netdev(net, dev) { 1398 1398 if (dev == last) 1399 - break; 1399 + goto outroll; 1400 1400 1401 1401 if (dev->flags & IFF_UP) { 1402 1402 nb->notifier_call(nb, NETDEV_GOING_DOWN, dev); ··· 1407 1407 } 1408 1408 } 1409 1409 1410 + outroll: 1410 1411 raw_notifier_chain_unregister(&netdev_chain, nb); 1411 1412 goto unlock; 1412 1413 } ··· 4281 4280 { 4282 4281 return seq_open_net(inode, file, &dev_seq_ops, 4283 4282 sizeof(struct dev_iter_state)); 4283 + } 4284 + 4285 + int dev_seq_open_ops(struct inode *inode, struct file *file, 4286 + const struct seq_operations *ops) 4287 + { 4288 + return seq_open_net(inode, file, ops, sizeof(struct dev_iter_state)); 4284 4289 } 4285 4290 4286 4291 static const struct file_operations dev_seq_fops = {
+1 -2
net/core/dev_addr_lists.c
··· 696 696 697 697 static int dev_mc_seq_open(struct inode *inode, struct file *file) 698 698 { 699 - return seq_open_net(inode, file, &dev_mc_seq_ops, 700 - sizeof(struct seq_net_private)); 699 + return dev_seq_open_ops(inode, file, &dev_mc_seq_ops); 701 700 } 702 701 703 702 static const struct file_operations dev_mc_seq_fops = {
+4 -1
net/core/neighbour.c
··· 2397 2397 struct net *net = seq_file_net(seq); 2398 2398 struct neigh_table *tbl = state->tbl; 2399 2399 2400 - pn = pn->next; 2400 + do { 2401 + pn = pn->next; 2402 + } while (pn && !net_eq(pneigh_net(pn), net)); 2403 + 2401 2404 while (!pn) { 2402 2405 if (++state->bucket > PNEIGH_HASHMASK) 2403 2406 break;
+1 -1
net/core/skbuff.c
··· 2230 2230 * @shiftlen: shift up to this many bytes 2231 2231 * 2232 2232 * Attempts to shift up to shiftlen worth of bytes, which may be less than 2233 - * the length of the skb, from tgt to skb. Returns number bytes shifted. 2233 + * the length of the skb, from skb to tgt. Returns number bytes shifted. 2234 2234 * It's up to caller to free skb if everything was shifted. 2235 2235 * 2236 2236 * If @tgt runs out of frags, the whole operation is aborted.
+1
net/dccp/ipv4.c
··· 111 111 rt = ip_route_newports(fl4, rt, orig_sport, orig_dport, 112 112 inet->inet_sport, inet->inet_dport, sk); 113 113 if (IS_ERR(rt)) { 114 + err = PTR_ERR(rt); 114 115 rt = NULL; 115 116 goto failure; 116 117 }
+6 -4
net/decnet/dn_route.c
··· 112 112 static int dn_dst_gc(struct dst_ops *ops); 113 113 static struct dst_entry *dn_dst_check(struct dst_entry *, __u32); 114 114 static unsigned int dn_dst_default_advmss(const struct dst_entry *dst); 115 - static unsigned int dn_dst_default_mtu(const struct dst_entry *dst); 115 + static unsigned int dn_dst_mtu(const struct dst_entry *dst); 116 116 static void dn_dst_destroy(struct dst_entry *); 117 117 static struct dst_entry *dn_dst_negative_advice(struct dst_entry *); 118 118 static void dn_dst_link_failure(struct sk_buff *); ··· 135 135 .gc = dn_dst_gc, 136 136 .check = dn_dst_check, 137 137 .default_advmss = dn_dst_default_advmss, 138 - .default_mtu = dn_dst_default_mtu, 138 + .mtu = dn_dst_mtu, 139 139 .cow_metrics = dst_cow_metrics_generic, 140 140 .destroy = dn_dst_destroy, 141 141 .negative_advice = dn_dst_negative_advice, ··· 825 825 return dn_mss_from_pmtu(dst->dev, dst_mtu(dst)); 826 826 } 827 827 828 - static unsigned int dn_dst_default_mtu(const struct dst_entry *dst) 828 + static unsigned int dn_dst_mtu(const struct dst_entry *dst) 829 829 { 830 - return dst->dev->mtu; 830 + unsigned int mtu = dst_metric_raw(dst, RTAX_MTU); 831 + 832 + return mtu ? : dst->dev->mtu; 831 833 } 832 834 833 835 static struct neighbour *dn_dst_neigh_lookup(const struct dst_entry *dst, const void *daddr)
+5 -12
net/decnet/dn_timer.c
··· 36 36 37 37 void dn_start_slow_timer(struct sock *sk) 38 38 { 39 - sk->sk_timer.expires = jiffies + SLOW_INTERVAL; 40 - sk->sk_timer.function = dn_slow_timer; 41 - sk->sk_timer.data = (unsigned long)sk; 42 - 43 - add_timer(&sk->sk_timer); 39 + setup_timer(&sk->sk_timer, dn_slow_timer, (unsigned long)sk); 40 + sk_reset_timer(sk, &sk->sk_timer, jiffies + SLOW_INTERVAL); 44 41 } 45 42 46 43 void dn_stop_slow_timer(struct sock *sk) 47 44 { 48 - del_timer(&sk->sk_timer); 45 + sk_stop_timer(sk, &sk->sk_timer); 49 46 } 50 47 51 48 static void dn_slow_timer(unsigned long arg) ··· 50 53 struct sock *sk = (struct sock *)arg; 51 54 struct dn_scp *scp = DN_SK(sk); 52 55 53 - sock_hold(sk); 54 56 bh_lock_sock(sk); 55 57 56 58 if (sock_owned_by_user(sk)) { 57 - sk->sk_timer.expires = jiffies + HZ / 10; 58 - add_timer(&sk->sk_timer); 59 + sk_reset_timer(sk, &sk->sk_timer, jiffies + HZ / 10); 59 60 goto out; 60 61 } 61 62 ··· 95 100 scp->keepalive_fxn(sk); 96 101 } 97 102 98 - sk->sk_timer.expires = jiffies + SLOW_INTERVAL; 99 - 100 - add_timer(&sk->sk_timer); 103 + sk_reset_timer(sk, &sk->sk_timer, jiffies + SLOW_INTERVAL); 101 104 out: 102 105 bh_unlock_sock(sk); 103 106 sock_put(sk);
+5
net/ipv4/devinet.c
··· 1490 1490 void __user *buffer, 1491 1491 size_t *lenp, loff_t *ppos) 1492 1492 { 1493 + int old_value = *(int *)ctl->data; 1493 1494 int ret = proc_dointvec(ctl, write, buffer, lenp, ppos); 1495 + int new_value = *(int *)ctl->data; 1494 1496 1495 1497 if (write) { 1496 1498 struct ipv4_devconf *cnf = ctl->extra1; ··· 1503 1501 1504 1502 if (cnf == net->ipv4.devconf_dflt) 1505 1503 devinet_copy_dflt_conf(net, i); 1504 + if (i == IPV4_DEVCONF_ACCEPT_LOCAL - 1) 1505 + if ((new_value == 0) && (old_value != 0)) 1506 + rt_cache_flush(net, 0); 1506 1507 } 1507 1508 1508 1509 return ret;
+2 -1
net/ipv4/igmp.c
··· 1716 1716 if (err) { 1717 1717 int j; 1718 1718 1719 - pmc->sfcount[sfmode]--; 1719 + if (!delta) 1720 + pmc->sfcount[sfmode]--; 1720 1721 for (j=0; j<i; j++) 1721 1722 (void) ip_mc_del1_src(pmc, sfmode, &psfsrc[j]); 1722 1723 } else if (isexclude != (pmc->sfcount[MCAST_EXCLUDE] != 0)) {
+9 -5
net/ipv4/inet_diag.c
··· 108 108 icsk->icsk_ca_ops->name); 109 109 } 110 110 111 - if ((ext & (1 << (INET_DIAG_TOS - 1))) && (sk->sk_family != AF_INET6)) 112 - RTA_PUT_U8(skb, INET_DIAG_TOS, inet->tos); 113 - 114 111 r->idiag_family = sk->sk_family; 115 112 r->idiag_state = sk->sk_state; 116 113 r->idiag_timer = 0; ··· 122 125 r->id.idiag_src[0] = inet->inet_rcv_saddr; 123 126 r->id.idiag_dst[0] = inet->inet_daddr; 124 127 128 + /* IPv6 dual-stack sockets use inet->tos for IPv4 connections, 129 + * hence this needs to be included regardless of socket family. 130 + */ 131 + if (ext & (1 << (INET_DIAG_TOS - 1))) 132 + RTA_PUT_U8(skb, INET_DIAG_TOS, inet->tos); 133 + 125 134 #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 126 135 if (r->idiag_family == AF_INET6) { 127 136 const struct ipv6_pinfo *np = inet6_sk(sk); 137 + 138 + if (ext & (1 << (INET_DIAG_TCLASS - 1))) 139 + RTA_PUT_U8(skb, INET_DIAG_TCLASS, np->tclass); 128 140 129 141 ipv6_addr_copy((struct in6_addr *)r->id.idiag_src, 130 142 &np->rcv_saddr); 131 143 ipv6_addr_copy((struct in6_addr *)r->id.idiag_dst, 132 144 &np->daddr); 133 - if (ext & (1 << (INET_DIAG_TCLASS - 1))) 134 - RTA_PUT_U8(skb, INET_DIAG_TCLASS, np->tclass); 135 145 } 136 146 #endif 137 147
+1 -1
net/ipv4/ip_forward.c
··· 84 84 85 85 rt = skb_rtable(skb); 86 86 87 - if (opt->is_strictroute && ip_hdr(skb)->daddr != rt->rt_gateway) 87 + if (opt->is_strictroute && opt->nexthop != rt->rt_gateway) 88 88 goto sr_failed; 89 89 90 90 if (unlikely(skb->len > dst_mtu(&rt->dst) && !skb_is_gso(skb) &&
+3 -2
net/ipv4/ip_options.c
··· 568 568 ) { 569 569 if (srrptr + 3 > srrspace) 570 570 break; 571 - if (memcmp(&ip_hdr(skb)->daddr, &optptr[srrptr-1], 4) == 0) 571 + if (memcmp(&opt->nexthop, &optptr[srrptr-1], 4) == 0) 572 572 break; 573 573 } 574 574 if (srrptr + 3 <= srrspace) { 575 575 opt->is_changed = 1; 576 576 ip_rt_get_source(&optptr[srrptr-1], skb, rt); 577 + ip_hdr(skb)->daddr = opt->nexthop; 577 578 optptr[2] = srrptr+4; 578 579 } else if (net_ratelimit()) 579 580 printk(KERN_CRIT "ip_forward(): Argh! Destination lost!\n"); ··· 641 640 } 642 641 if (srrptr <= srrspace) { 643 642 opt->srr_is_hit = 1; 644 - iph->daddr = nexthop; 643 + opt->nexthop = nexthop; 645 644 opt->is_changed = 1; 646 645 } 647 646 return 0;
+2 -1
net/ipv4/netfilter.c
··· 64 64 /* Change in oif may mean change in hh_len. */ 65 65 hh_len = skb_dst(skb)->dev->hard_header_len; 66 66 if (skb_headroom(skb) < hh_len && 67 - pskb_expand_head(skb, hh_len - skb_headroom(skb), 0, GFP_ATOMIC)) 67 + pskb_expand_head(skb, HH_DATA_ALIGN(hh_len - skb_headroom(skb)), 68 + 0, GFP_ATOMIC)) 68 69 return -1; 69 70 70 71 return 0;
-1
net/ipv4/netfilter/Kconfig
··· 325 325 # raw + specific targets 326 326 config IP_NF_RAW 327 327 tristate 'raw table support (required for NOTRACK/TRACE)' 328 - depends on NETFILTER_ADVANCED 329 328 help 330 329 This option adds a `raw' table to iptables. This table is the very 331 330 first in the netfilter framework and hooks in at the PREROUTING
+49 -18
net/ipv4/route.c
··· 131 131 static int ip_rt_min_pmtu __read_mostly = 512 + 20 + 20; 132 132 static int ip_rt_min_advmss __read_mostly = 256; 133 133 static int rt_chain_length_max __read_mostly = 20; 134 + static int redirect_genid; 134 135 135 136 /* 136 137 * Interface to generic destination cache. ··· 139 138 140 139 static struct dst_entry *ipv4_dst_check(struct dst_entry *dst, u32 cookie); 141 140 static unsigned int ipv4_default_advmss(const struct dst_entry *dst); 142 - static unsigned int ipv4_default_mtu(const struct dst_entry *dst); 141 + static unsigned int ipv4_mtu(const struct dst_entry *dst); 143 142 static void ipv4_dst_destroy(struct dst_entry *dst); 144 143 static struct dst_entry *ipv4_negative_advice(struct dst_entry *dst); 145 144 static void ipv4_link_failure(struct sk_buff *skb); ··· 194 193 .gc = rt_garbage_collect, 195 194 .check = ipv4_dst_check, 196 195 .default_advmss = ipv4_default_advmss, 197 - .default_mtu = ipv4_default_mtu, 196 + .mtu = ipv4_mtu, 198 197 .cow_metrics = ipv4_cow_metrics, 199 198 .destroy = ipv4_dst_destroy, 200 199 .ifdown = ipv4_dst_ifdown, ··· 417 416 else { 418 417 struct rtable *r = v; 419 418 struct neighbour *n; 420 - int len; 419 + int len, HHUptod; 421 420 421 + rcu_read_lock(); 422 422 n = dst_get_neighbour(&r->dst); 423 + HHUptod = (n && (n->nud_state & NUD_CONNECTED)) ? 1 : 0; 424 + rcu_read_unlock(); 425 + 423 426 seq_printf(seq, "%s\t%08X\t%08X\t%8X\t%d\t%u\t%d\t" 424 427 "%08X\t%d\t%u\t%u\t%02X\t%d\t%1d\t%08X%n", 425 428 r->dst.dev ? r->dst.dev->name : "*", ··· 437 432 dst_metric(&r->dst, RTAX_RTTVAR)), 438 433 r->rt_key_tos, 439 434 -1, 440 - (n && (n->nud_state & NUD_CONNECTED)) ? 1 : 0, 435 + HHUptod, 441 436 r->rt_spec_dst, &len); 442 437 443 438 seq_printf(seq, "%*s\n", 127 - len, ""); ··· 842 837 843 838 get_random_bytes(&shuffle, sizeof(shuffle)); 844 839 atomic_add(shuffle + 1U, &net->ipv4.rt_genid); 840 + redirect_genid++; 845 841 } 846 842 847 843 /* ··· 1397 1391 1398 1392 peer = rt->peer; 1399 1393 if (peer) { 1400 - if (peer->redirect_learned.a4 != new_gw) { 1394 + if (peer->redirect_learned.a4 != new_gw || 1395 + peer->redirect_genid != redirect_genid) { 1401 1396 peer->redirect_learned.a4 = new_gw; 1397 + peer->redirect_genid = redirect_genid; 1402 1398 atomic_inc(&__rt_peer_genid); 1403 1399 } 1404 1400 check_peer_redir(&rt->dst, peer); ··· 1693 1685 } 1694 1686 1695 1687 1696 - static struct dst_entry *ipv4_dst_check(struct dst_entry *dst, u32 cookie) 1688 + static struct rtable *ipv4_validate_peer(struct rtable *rt) 1697 1689 { 1698 - struct rtable *rt = (struct rtable *) dst; 1699 - 1700 - if (rt_is_expired(rt)) 1701 - return NULL; 1702 1690 if (rt->rt_peer_genid != rt_peer_genid()) { 1703 1691 struct inet_peer *peer; 1704 1692 ··· 1703 1699 1704 1700 peer = rt->peer; 1705 1701 if (peer) { 1706 - check_peer_pmtu(dst, peer); 1702 + check_peer_pmtu(&rt->dst, peer); 1707 1703 1704 + if (peer->redirect_genid != redirect_genid) 1705 + peer->redirect_learned.a4 = 0; 1708 1706 if (peer->redirect_learned.a4 && 1709 1707 peer->redirect_learned.a4 != rt->rt_gateway) { 1710 - if (check_peer_redir(dst, peer)) 1708 + if (check_peer_redir(&rt->dst, peer)) 1711 1709 return NULL; 1712 1710 } 1713 1711 } 1714 1712 1715 1713 rt->rt_peer_genid = rt_peer_genid(); 1716 1714 } 1715 + return rt; 1716 + } 1717 + 1718 + static struct dst_entry *ipv4_dst_check(struct dst_entry *dst, u32 cookie) 1719 + { 1720 + struct rtable *rt = (struct rtable *) dst; 1721 + 1722 + if (rt_is_expired(rt)) 1723 + return NULL; 1724 + dst = (struct dst_entry *) ipv4_validate_peer(rt); 1717 1725 return dst; 1718 1726 } 1719 1727 ··· 1830 1814 return advmss; 1831 1815 } 1832 1816 1833 - static unsigned int ipv4_default_mtu(const struct dst_entry *dst) 1817 + static unsigned int ipv4_mtu(const struct dst_entry *dst) 1834 1818 { 1835 - unsigned int mtu = dst->dev->mtu; 1819 + const struct rtable *rt = (const struct rtable *) dst; 1820 + unsigned int mtu = dst_metric_raw(dst, RTAX_MTU); 1821 + 1822 + if (mtu && rt_is_output_route(rt)) 1823 + return mtu; 1824 + 1825 + mtu = dst->dev->mtu; 1836 1826 1837 1827 if (unlikely(dst_metric_locked(dst, RTAX_MTU))) { 1838 - const struct rtable *rt = (const struct rtable *) dst; 1839 1828 1840 1829 if (rt->rt_gateway != rt->rt_dst && mtu > 576) 1841 1830 mtu = 576; ··· 1873 1852 dst_init_metrics(&rt->dst, peer->metrics, false); 1874 1853 1875 1854 check_peer_pmtu(&rt->dst, peer); 1855 + if (peer->redirect_genid != redirect_genid) 1856 + peer->redirect_learned.a4 = 0; 1876 1857 if (peer->redirect_learned.a4 && 1877 1858 peer->redirect_learned.a4 != rt->rt_gateway) { 1878 1859 rt->rt_gateway = peer->redirect_learned.a4; ··· 2380 2357 rth->rt_mark == skb->mark && 2381 2358 net_eq(dev_net(rth->dst.dev), net) && 2382 2359 !rt_is_expired(rth)) { 2360 + rth = ipv4_validate_peer(rth); 2361 + if (!rth) 2362 + continue; 2383 2363 if (noref) { 2384 2364 dst_use_noref(&rth->dst, jiffies); 2385 2365 skb_dst_set_noref(skb, &rth->dst); ··· 2758 2732 (IPTOS_RT_MASK | RTO_ONLINK)) && 2759 2733 net_eq(dev_net(rth->dst.dev), net) && 2760 2734 !rt_is_expired(rth)) { 2735 + rth = ipv4_validate_peer(rth); 2736 + if (!rth) 2737 + continue; 2761 2738 dst_use(&rth->dst, jiffies); 2762 2739 RT_CACHE_STAT_INC(out_hit); 2763 2740 rcu_read_unlock_bh(); ··· 2784 2755 return NULL; 2785 2756 } 2786 2757 2787 - static unsigned int ipv4_blackhole_default_mtu(const struct dst_entry *dst) 2758 + static unsigned int ipv4_blackhole_mtu(const struct dst_entry *dst) 2788 2759 { 2789 - return 0; 2760 + unsigned int mtu = dst_metric_raw(dst, RTAX_MTU); 2761 + 2762 + return mtu ? : dst->dev->mtu; 2790 2763 } 2791 2764 2792 2765 static void ipv4_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu) ··· 2806 2775 .protocol = cpu_to_be16(ETH_P_IP), 2807 2776 .destroy = ipv4_dst_destroy, 2808 2777 .check = ipv4_blackhole_dst_check, 2809 - .default_mtu = ipv4_blackhole_default_mtu, 2778 + .mtu = ipv4_blackhole_mtu, 2810 2779 .default_advmss = ipv4_default_advmss, 2811 2780 .update_pmtu = ipv4_rt_blackhole_update_pmtu, 2812 2781 .cow_metrics = ipv4_rt_blackhole_cow_metrics,
+8 -7
net/ipv4/udp.c
··· 1164 1164 struct inet_sock *inet = inet_sk(sk); 1165 1165 struct sockaddr_in *sin = (struct sockaddr_in *)msg->msg_name; 1166 1166 struct sk_buff *skb; 1167 - unsigned int ulen; 1167 + unsigned int ulen, copied; 1168 1168 int peeked; 1169 1169 int err; 1170 1170 int is_udplite = IS_UDPLITE(sk); ··· 1186 1186 goto out; 1187 1187 1188 1188 ulen = skb->len - sizeof(struct udphdr); 1189 - if (len > ulen) 1190 - len = ulen; 1191 - else if (len < ulen) 1189 + copied = len; 1190 + if (copied > ulen) 1191 + copied = ulen; 1192 + else if (copied < ulen) 1192 1193 msg->msg_flags |= MSG_TRUNC; 1193 1194 1194 1195 /* ··· 1198 1197 * coverage checksum (UDP-Lite), do it before the copy. 1199 1198 */ 1200 1199 1201 - if (len < ulen || UDP_SKB_CB(skb)->partial_cov) { 1200 + if (copied < ulen || UDP_SKB_CB(skb)->partial_cov) { 1202 1201 if (udp_lib_checksum_complete(skb)) 1203 1202 goto csum_copy_err; 1204 1203 } 1205 1204 1206 1205 if (skb_csum_unnecessary(skb)) 1207 1206 err = skb_copy_datagram_iovec(skb, sizeof(struct udphdr), 1208 - msg->msg_iov, len); 1207 + msg->msg_iov, copied); 1209 1208 else { 1210 1209 err = skb_copy_and_csum_datagram_iovec(skb, 1211 1210 sizeof(struct udphdr), ··· 1234 1233 if (inet->cmsg_flags) 1235 1234 ip_cmsg_recv(msg, skb); 1236 1235 1237 - err = len; 1236 + err = copied; 1238 1237 if (flags & MSG_TRUNC) 1239 1238 err = ulen; 1240 1239
+1 -1
net/ipv6/inet6_connection_sock.c
··· 85 85 * request_sock (formerly open request) hash tables. 86 86 */ 87 87 static u32 inet6_synq_hash(const struct in6_addr *raddr, const __be16 rport, 88 - const u32 rnd, const u16 synq_hsize) 88 + const u32 rnd, const u32 synq_hsize) 89 89 { 90 90 u32 c; 91 91
+1 -1
net/ipv6/ipv6_sockglue.c
··· 503 503 goto e_inval; 504 504 if (val > 255 || val < -1) 505 505 goto e_inval; 506 - np->mcast_hops = val; 506 + np->mcast_hops = (val == -1 ? IPV6_DEFAULT_MCASTHOPS : val); 507 507 retv = 0; 508 508 break; 509 509
+1 -1
net/ipv6/ndisc.c
··· 1571 1571 } 1572 1572 if (!rt->rt6i_peer) 1573 1573 rt6_bind_peer(rt, 1); 1574 - if (inet_peer_xrlim_allow(rt->rt6i_peer, 1*HZ)) 1574 + if (!inet_peer_xrlim_allow(rt->rt6i_peer, 1*HZ)) 1575 1575 goto release; 1576 1576 1577 1577 if (dev->addr_len) {
-1
net/ipv6/netfilter/Kconfig
··· 186 186 187 187 config IP6_NF_RAW 188 188 tristate 'raw table support (required for TRACE)' 189 - depends on NETFILTER_ADVANCED 190 189 help 191 190 This option adds a `raw' table to ip6tables. This table is the very 192 191 first in the netfilter framework and hooks in at the PREROUTING
+14 -7
net/ipv6/route.c
··· 77 77 const struct in6_addr *dest); 78 78 static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie); 79 79 static unsigned int ip6_default_advmss(const struct dst_entry *dst); 80 - static unsigned int ip6_default_mtu(const struct dst_entry *dst); 80 + static unsigned int ip6_mtu(const struct dst_entry *dst); 81 81 static struct dst_entry *ip6_negative_advice(struct dst_entry *); 82 82 static void ip6_dst_destroy(struct dst_entry *); 83 83 static void ip6_dst_ifdown(struct dst_entry *, ··· 144 144 .gc_thresh = 1024, 145 145 .check = ip6_dst_check, 146 146 .default_advmss = ip6_default_advmss, 147 - .default_mtu = ip6_default_mtu, 147 + .mtu = ip6_mtu, 148 148 .cow_metrics = ipv6_cow_metrics, 149 149 .destroy = ip6_dst_destroy, 150 150 .ifdown = ip6_dst_ifdown, ··· 155 155 .neigh_lookup = ip6_neigh_lookup, 156 156 }; 157 157 158 - static unsigned int ip6_blackhole_default_mtu(const struct dst_entry *dst) 158 + static unsigned int ip6_blackhole_mtu(const struct dst_entry *dst) 159 159 { 160 - return 0; 160 + unsigned int mtu = dst_metric_raw(dst, RTAX_MTU); 161 + 162 + return mtu ? : dst->dev->mtu; 161 163 } 162 164 163 165 static void ip6_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu) ··· 177 175 .protocol = cpu_to_be16(ETH_P_IPV6), 178 176 .destroy = ip6_dst_destroy, 179 177 .check = ip6_dst_check, 180 - .default_mtu = ip6_blackhole_default_mtu, 178 + .mtu = ip6_blackhole_mtu, 181 179 .default_advmss = ip6_default_advmss, 182 180 .update_pmtu = ip6_rt_blackhole_update_pmtu, 183 181 .cow_metrics = ip6_rt_blackhole_cow_metrics, ··· 1043 1041 return mtu; 1044 1042 } 1045 1043 1046 - static unsigned int ip6_default_mtu(const struct dst_entry *dst) 1044 + static unsigned int ip6_mtu(const struct dst_entry *dst) 1047 1045 { 1048 - unsigned int mtu = IPV6_MIN_MTU; 1049 1046 struct inet6_dev *idev; 1047 + unsigned int mtu = dst_metric_raw(dst, RTAX_MTU); 1048 + 1049 + if (mtu) 1050 + return mtu; 1051 + 1052 + mtu = IPV6_MIN_MTU; 1050 1053 1051 1054 rcu_read_lock(); 1052 1055 idev = __in6_dev_get(dst->dev);
+7 -6
net/ipv6/tcp_ipv6.c
··· 1255 1255 if (!want_cookie || tmp_opt.tstamp_ok) 1256 1256 TCP_ECN_create_request(req, tcp_hdr(skb)); 1257 1257 1258 + treq->iif = sk->sk_bound_dev_if; 1259 + 1260 + /* So that link locals have meaning */ 1261 + if (!sk->sk_bound_dev_if && 1262 + ipv6_addr_type(&treq->rmt_addr) & IPV6_ADDR_LINKLOCAL) 1263 + treq->iif = inet6_iif(skb); 1264 + 1258 1265 if (!isn) { 1259 1266 struct inet_peer *peer = NULL; 1260 1267 ··· 1271 1264 atomic_inc(&skb->users); 1272 1265 treq->pktopts = skb; 1273 1266 } 1274 - treq->iif = sk->sk_bound_dev_if; 1275 - 1276 - /* So that link locals have meaning */ 1277 - if (!sk->sk_bound_dev_if && 1278 - ipv6_addr_type(&treq->rmt_addr) & IPV6_ADDR_LINKLOCAL) 1279 - treq->iif = inet6_iif(skb); 1280 1267 1281 1268 if (want_cookie) { 1282 1269 isn = cookie_v6_init_sequence(sk, skb, &req->mss);
+8 -7
net/ipv6/udp.c
··· 340 340 struct ipv6_pinfo *np = inet6_sk(sk); 341 341 struct inet_sock *inet = inet_sk(sk); 342 342 struct sk_buff *skb; 343 - unsigned int ulen; 343 + unsigned int ulen, copied; 344 344 int peeked; 345 345 int err; 346 346 int is_udplite = IS_UDPLITE(sk); ··· 363 363 goto out; 364 364 365 365 ulen = skb->len - sizeof(struct udphdr); 366 - if (len > ulen) 367 - len = ulen; 368 - else if (len < ulen) 366 + copied = len; 367 + if (copied > ulen) 368 + copied = ulen; 369 + else if (copied < ulen) 369 370 msg->msg_flags |= MSG_TRUNC; 370 371 371 372 is_udp4 = (skb->protocol == htons(ETH_P_IP)); ··· 377 376 * coverage checksum (UDP-Lite), do it before the copy. 378 377 */ 379 378 380 - if (len < ulen || UDP_SKB_CB(skb)->partial_cov) { 379 + if (copied < ulen || UDP_SKB_CB(skb)->partial_cov) { 381 380 if (udp_lib_checksum_complete(skb)) 382 381 goto csum_copy_err; 383 382 } 384 383 385 384 if (skb_csum_unnecessary(skb)) 386 385 err = skb_copy_datagram_iovec(skb, sizeof(struct udphdr), 387 - msg->msg_iov,len); 386 + msg->msg_iov, copied ); 388 387 else { 389 388 err = skb_copy_and_csum_datagram_iovec(skb, sizeof(struct udphdr), msg->msg_iov); 390 389 if (err == -EINVAL) ··· 433 432 datagram_recv_ctl(sk, msg, skb); 434 433 } 435 434 436 - err = len; 435 + err = copied; 437 436 if (flags & MSG_TRUNC) 438 437 err = ulen; 439 438
+1 -1
net/l2tp/l2tp_core.c
··· 1072 1072 1073 1073 /* Get routing info from the tunnel socket */ 1074 1074 skb_dst_drop(skb); 1075 - skb_dst_set(skb, dst_clone(__sk_dst_get(sk))); 1075 + skb_dst_set(skb, dst_clone(__sk_dst_check(sk, 0))); 1076 1076 1077 1077 inet = inet_sk(sk); 1078 1078 fl = &inet->cork.fl;
+39 -3
net/mac80211/agg-tx.c
··· 161 161 return -ENOENT; 162 162 } 163 163 164 + /* if we're already stopping ignore any new requests to stop */ 165 + if (test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) { 166 + spin_unlock_bh(&sta->lock); 167 + return -EALREADY; 168 + } 169 + 164 170 if (test_bit(HT_AGG_STATE_WANT_START, &tid_tx->state)) { 165 171 /* not even started yet! */ 166 172 ieee80211_assign_tid_tx(sta, tid, NULL); ··· 175 169 return 0; 176 170 } 177 171 172 + set_bit(HT_AGG_STATE_STOPPING, &tid_tx->state); 173 + 178 174 spin_unlock_bh(&sta->lock); 179 175 180 176 #ifdef CONFIG_MAC80211_HT_DEBUG 181 177 printk(KERN_DEBUG "Tx BA session stop requested for %pM tid %u\n", 182 178 sta->sta.addr, tid); 183 179 #endif /* CONFIG_MAC80211_HT_DEBUG */ 184 - 185 - set_bit(HT_AGG_STATE_STOPPING, &tid_tx->state); 186 180 187 181 del_timer_sync(&tid_tx->addba_resp_timer); 188 182 ··· 192 186 * with locking to ensure proper access. 193 187 */ 194 188 clear_bit(HT_AGG_STATE_OPERATIONAL, &tid_tx->state); 189 + 190 + /* 191 + * There might be a few packets being processed right now (on 192 + * another CPU) that have already gotten past the aggregation 193 + * check when it was still OPERATIONAL and consequently have 194 + * IEEE80211_TX_CTL_AMPDU set. In that case, this code might 195 + * call into the driver at the same time or even before the 196 + * TX paths calls into it, which could confuse the driver. 197 + * 198 + * Wait for all currently running TX paths to finish before 199 + * telling the driver. New packets will not go through since 200 + * the aggregation session is no longer OPERATIONAL. 201 + */ 202 + synchronize_net(); 195 203 196 204 tid_tx->stop_initiator = initiator; 197 205 tid_tx->tx_stop = tx; ··· 777 757 goto out; 778 758 } 779 759 780 - del_timer(&tid_tx->addba_resp_timer); 760 + del_timer_sync(&tid_tx->addba_resp_timer); 781 761 782 762 #ifdef CONFIG_MAC80211_HT_DEBUG 783 763 printk(KERN_DEBUG "switched off addBA timer for tid %d\n", tid); 784 764 #endif 765 + 766 + /* 767 + * addba_resp_timer may have fired before we got here, and 768 + * caused WANT_STOP to be set. If the stop then was already 769 + * processed further, STOPPING might be set. 770 + */ 771 + if (test_bit(HT_AGG_STATE_WANT_STOP, &tid_tx->state) || 772 + test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) { 773 + #ifdef CONFIG_MAC80211_HT_DEBUG 774 + printk(KERN_DEBUG 775 + "got addBA resp for tid %d but we already gave up\n", 776 + tid); 777 + #endif 778 + goto out; 779 + } 780 + 785 781 /* 786 782 * IEEE 802.11-2007 7.3.1.14: 787 783 * In an ADDBA Response frame, when the Status Code field
+2 -2
net/mac80211/debugfs_sta.c
··· 274 274 275 275 PRINT_HT_CAP((htc->cap & BIT(10)), "HT Delayed Block Ack"); 276 276 277 - PRINT_HT_CAP((htc->cap & BIT(11)), "Max AMSDU length: " 278 - "3839 bytes"); 279 277 PRINT_HT_CAP(!(htc->cap & BIT(11)), "Max AMSDU length: " 278 + "3839 bytes"); 279 + PRINT_HT_CAP((htc->cap & BIT(11)), "Max AMSDU length: " 280 280 "7935 bytes"); 281 281 282 282 /*
+4 -4
net/mac80211/status.c
··· 260 260 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 261 261 struct ieee80211_radiotap_header *rthdr; 262 262 unsigned char *pos; 263 - __le16 txflags; 263 + u16 txflags; 264 264 265 265 rthdr = (struct ieee80211_radiotap_header *) skb_push(skb, rtap_len); 266 266 ··· 290 290 txflags = 0; 291 291 if (!(info->flags & IEEE80211_TX_STAT_ACK) && 292 292 !is_multicast_ether_addr(hdr->addr1)) 293 - txflags |= cpu_to_le16(IEEE80211_RADIOTAP_F_TX_FAIL); 293 + txflags |= IEEE80211_RADIOTAP_F_TX_FAIL; 294 294 295 295 if ((info->status.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS) || 296 296 (info->status.rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT)) 297 - txflags |= cpu_to_le16(IEEE80211_RADIOTAP_F_TX_CTS); 297 + txflags |= IEEE80211_RADIOTAP_F_TX_CTS; 298 298 else if (info->status.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS) 299 - txflags |= cpu_to_le16(IEEE80211_RADIOTAP_F_TX_RTS); 299 + txflags |= IEEE80211_RADIOTAP_F_TX_RTS; 300 300 301 301 put_unaligned_le16(txflags, pos); 302 302 pos += 2;
-2
net/netfilter/Kconfig
··· 201 201 202 202 config NF_CONNTRACK_NETBIOS_NS 203 203 tristate "NetBIOS name service protocol support" 204 - depends on NETFILTER_ADVANCED 205 204 select NF_CONNTRACK_BROADCAST 206 205 help 207 206 NetBIOS name service requests are sent as broadcast messages from an ··· 541 542 tristate '"NOTRACK" target support' 542 543 depends on IP_NF_RAW || IP6_NF_RAW 543 544 depends on NF_CONNTRACK 544 - depends on NETFILTER_ADVANCED 545 545 help 546 546 The NOTRACK target allows a select rule to specify 547 547 which packets *not* to enter the conntrack/NAT
+1 -1
net/netfilter/ipset/ip_set_hash_ipport.c
··· 158 158 const struct ip_set_hash *h = set->data; 159 159 ipset_adtfn adtfn = set->variant->adt[adt]; 160 160 struct hash_ipport4_elem data = { }; 161 - u32 ip, ip_to, p = 0, port, port_to; 161 + u32 ip, ip_to = 0, p = 0, port, port_to; 162 162 u32 timeout = h->timeout; 163 163 bool with_ports = false; 164 164 int ret;
+1 -1
net/netfilter/ipset/ip_set_hash_ipportip.c
··· 162 162 const struct ip_set_hash *h = set->data; 163 163 ipset_adtfn adtfn = set->variant->adt[adt]; 164 164 struct hash_ipportip4_elem data = { }; 165 - u32 ip, ip_to, p = 0, port, port_to; 165 + u32 ip, ip_to = 0, p = 0, port, port_to; 166 166 u32 timeout = h->timeout; 167 167 bool with_ports = false; 168 168 int ret;
+1 -1
net/netfilter/ipset/ip_set_hash_ipportnet.c
··· 184 184 const struct ip_set_hash *h = set->data; 185 185 ipset_adtfn adtfn = set->variant->adt[adt]; 186 186 struct hash_ipportnet4_elem data = { .cidr = HOST_MASK }; 187 - u32 ip, ip_to, p = 0, port, port_to; 187 + u32 ip, ip_to = 0, p = 0, port, port_to; 188 188 u32 ip2_from = 0, ip2_to, ip2_last, ip2; 189 189 u32 timeout = h->timeout; 190 190 bool with_ports = false;
+18 -19
net/netfilter/nf_conntrack_ecache.c
··· 27 27 28 28 static DEFINE_MUTEX(nf_ct_ecache_mutex); 29 29 30 - struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb __read_mostly; 31 - EXPORT_SYMBOL_GPL(nf_conntrack_event_cb); 32 - 33 - struct nf_exp_event_notifier __rcu *nf_expect_event_cb __read_mostly; 34 - EXPORT_SYMBOL_GPL(nf_expect_event_cb); 35 - 36 30 /* deliver cached events and clear cache entry - must be called with locally 37 31 * disabled softirqs */ 38 32 void nf_ct_deliver_cached_events(struct nf_conn *ct) 39 33 { 34 + struct net *net = nf_ct_net(ct); 40 35 unsigned long events; 41 36 struct nf_ct_event_notifier *notify; 42 37 struct nf_conntrack_ecache *e; 43 38 44 39 rcu_read_lock(); 45 - notify = rcu_dereference(nf_conntrack_event_cb); 40 + notify = rcu_dereference(net->ct.nf_conntrack_event_cb); 46 41 if (notify == NULL) 47 42 goto out_unlock; 48 43 ··· 78 83 } 79 84 EXPORT_SYMBOL_GPL(nf_ct_deliver_cached_events); 80 85 81 - int nf_conntrack_register_notifier(struct nf_ct_event_notifier *new) 86 + int nf_conntrack_register_notifier(struct net *net, 87 + struct nf_ct_event_notifier *new) 82 88 { 83 89 int ret = 0; 84 90 struct nf_ct_event_notifier *notify; 85 91 86 92 mutex_lock(&nf_ct_ecache_mutex); 87 - notify = rcu_dereference_protected(nf_conntrack_event_cb, 93 + notify = rcu_dereference_protected(net->ct.nf_conntrack_event_cb, 88 94 lockdep_is_held(&nf_ct_ecache_mutex)); 89 95 if (notify != NULL) { 90 96 ret = -EBUSY; 91 97 goto out_unlock; 92 98 } 93 - RCU_INIT_POINTER(nf_conntrack_event_cb, new); 99 + RCU_INIT_POINTER(net->ct.nf_conntrack_event_cb, new); 94 100 mutex_unlock(&nf_ct_ecache_mutex); 95 101 return ret; 96 102 ··· 101 105 } 102 106 EXPORT_SYMBOL_GPL(nf_conntrack_register_notifier); 103 107 104 - void nf_conntrack_unregister_notifier(struct nf_ct_event_notifier *new) 108 + void nf_conntrack_unregister_notifier(struct net *net, 109 + struct nf_ct_event_notifier *new) 105 110 { 106 111 struct nf_ct_event_notifier *notify; 107 112 108 113 mutex_lock(&nf_ct_ecache_mutex); 109 - notify = rcu_dereference_protected(nf_conntrack_event_cb, 114 + notify = rcu_dereference_protected(net->ct.nf_conntrack_event_cb, 110 115 lockdep_is_held(&nf_ct_ecache_mutex)); 111 116 BUG_ON(notify != new); 112 - RCU_INIT_POINTER(nf_conntrack_event_cb, NULL); 117 + RCU_INIT_POINTER(net->ct.nf_conntrack_event_cb, NULL); 113 118 mutex_unlock(&nf_ct_ecache_mutex); 114 119 } 115 120 EXPORT_SYMBOL_GPL(nf_conntrack_unregister_notifier); 116 121 117 - int nf_ct_expect_register_notifier(struct nf_exp_event_notifier *new) 122 + int nf_ct_expect_register_notifier(struct net *net, 123 + struct nf_exp_event_notifier *new) 118 124 { 119 125 int ret = 0; 120 126 struct nf_exp_event_notifier *notify; 121 127 122 128 mutex_lock(&nf_ct_ecache_mutex); 123 - notify = rcu_dereference_protected(nf_expect_event_cb, 129 + notify = rcu_dereference_protected(net->ct.nf_expect_event_cb, 124 130 lockdep_is_held(&nf_ct_ecache_mutex)); 125 131 if (notify != NULL) { 126 132 ret = -EBUSY; 127 133 goto out_unlock; 128 134 } 129 - RCU_INIT_POINTER(nf_expect_event_cb, new); 135 + RCU_INIT_POINTER(net->ct.nf_expect_event_cb, new); 130 136 mutex_unlock(&nf_ct_ecache_mutex); 131 137 return ret; 132 138 ··· 138 140 } 139 141 EXPORT_SYMBOL_GPL(nf_ct_expect_register_notifier); 140 142 141 - void nf_ct_expect_unregister_notifier(struct nf_exp_event_notifier *new) 143 + void nf_ct_expect_unregister_notifier(struct net *net, 144 + struct nf_exp_event_notifier *new) 142 145 { 143 146 struct nf_exp_event_notifier *notify; 144 147 145 148 mutex_lock(&nf_ct_ecache_mutex); 146 - notify = rcu_dereference_protected(nf_expect_event_cb, 149 + notify = rcu_dereference_protected(net->ct.nf_expect_event_cb, 147 150 lockdep_is_held(&nf_ct_ecache_mutex)); 148 151 BUG_ON(notify != new); 149 - RCU_INIT_POINTER(nf_expect_event_cb, NULL); 152 + RCU_INIT_POINTER(net->ct.nf_expect_event_cb, NULL); 150 153 mutex_unlock(&nf_ct_ecache_mutex); 151 154 } 152 155 EXPORT_SYMBOL_GPL(nf_ct_expect_unregister_notifier);
+52 -21
net/netfilter/nf_conntrack_netlink.c
··· 4 4 * (C) 2001 by Jay Schulist <jschlst@samba.org> 5 5 * (C) 2002-2006 by Harald Welte <laforge@gnumonks.org> 6 6 * (C) 2003 by Patrick Mchardy <kaber@trash.net> 7 - * (C) 2005-2008 by Pablo Neira Ayuso <pablo@netfilter.org> 7 + * (C) 2005-2011 by Pablo Neira Ayuso <pablo@netfilter.org> 8 8 * 9 9 * Initial connection tracking via netlink development funded and 10 10 * generally made possible by Network Robots, Inc. (www.networkrobots.com) ··· 2163 2163 MODULE_ALIAS_NFNL_SUBSYS(NFNL_SUBSYS_CTNETLINK); 2164 2164 MODULE_ALIAS_NFNL_SUBSYS(NFNL_SUBSYS_CTNETLINK_EXP); 2165 2165 2166 + static int __net_init ctnetlink_net_init(struct net *net) 2167 + { 2168 + #ifdef CONFIG_NF_CONNTRACK_EVENTS 2169 + int ret; 2170 + 2171 + ret = nf_conntrack_register_notifier(net, &ctnl_notifier); 2172 + if (ret < 0) { 2173 + pr_err("ctnetlink_init: cannot register notifier.\n"); 2174 + goto err_out; 2175 + } 2176 + 2177 + ret = nf_ct_expect_register_notifier(net, &ctnl_notifier_exp); 2178 + if (ret < 0) { 2179 + pr_err("ctnetlink_init: cannot expect register notifier.\n"); 2180 + goto err_unreg_notifier; 2181 + } 2182 + #endif 2183 + return 0; 2184 + 2185 + #ifdef CONFIG_NF_CONNTRACK_EVENTS 2186 + err_unreg_notifier: 2187 + nf_conntrack_unregister_notifier(net, &ctnl_notifier); 2188 + err_out: 2189 + return ret; 2190 + #endif 2191 + } 2192 + 2193 + static void ctnetlink_net_exit(struct net *net) 2194 + { 2195 + #ifdef CONFIG_NF_CONNTRACK_EVENTS 2196 + nf_ct_expect_unregister_notifier(net, &ctnl_notifier_exp); 2197 + nf_conntrack_unregister_notifier(net, &ctnl_notifier); 2198 + #endif 2199 + } 2200 + 2201 + static void __net_exit ctnetlink_net_exit_batch(struct list_head *net_exit_list) 2202 + { 2203 + struct net *net; 2204 + 2205 + list_for_each_entry(net, net_exit_list, exit_list) 2206 + ctnetlink_net_exit(net); 2207 + } 2208 + 2209 + static struct pernet_operations ctnetlink_net_ops = { 2210 + .init = ctnetlink_net_init, 2211 + .exit_batch = ctnetlink_net_exit_batch, 2212 + }; 2213 + 2166 2214 static int __init ctnetlink_init(void) 2167 2215 { 2168 2216 int ret; ··· 2228 2180 goto err_unreg_subsys; 2229 2181 } 2230 2182 2231 - #ifdef CONFIG_NF_CONNTRACK_EVENTS 2232 - ret = nf_conntrack_register_notifier(&ctnl_notifier); 2233 - if (ret < 0) { 2234 - pr_err("ctnetlink_init: cannot register notifier.\n"); 2183 + if (register_pernet_subsys(&ctnetlink_net_ops)) { 2184 + pr_err("ctnetlink_init: cannot register pernet operations\n"); 2235 2185 goto err_unreg_exp_subsys; 2236 2186 } 2237 2187 2238 - ret = nf_ct_expect_register_notifier(&ctnl_notifier_exp); 2239 - if (ret < 0) { 2240 - pr_err("ctnetlink_init: cannot expect register notifier.\n"); 2241 - goto err_unreg_notifier; 2242 - } 2243 - #endif 2244 - 2245 2188 return 0; 2246 2189 2247 - #ifdef CONFIG_NF_CONNTRACK_EVENTS 2248 - err_unreg_notifier: 2249 - nf_conntrack_unregister_notifier(&ctnl_notifier); 2250 2190 err_unreg_exp_subsys: 2251 2191 nfnetlink_subsys_unregister(&ctnl_exp_subsys); 2252 - #endif 2253 2192 err_unreg_subsys: 2254 2193 nfnetlink_subsys_unregister(&ctnl_subsys); 2255 2194 err_out: ··· 2248 2213 pr_info("ctnetlink: unregistering from nfnetlink.\n"); 2249 2214 2250 2215 nf_ct_remove_userspace_expectations(); 2251 - #ifdef CONFIG_NF_CONNTRACK_EVENTS 2252 - nf_ct_expect_unregister_notifier(&ctnl_notifier_exp); 2253 - nf_conntrack_unregister_notifier(&ctnl_notifier); 2254 - #endif 2255 - 2216 + unregister_pernet_subsys(&ctnetlink_net_ops); 2256 2217 nfnetlink_subsys_unregister(&ctnl_exp_subsys); 2257 2218 nfnetlink_subsys_unregister(&ctnl_subsys); 2258 2219 }
+16 -10
net/netlabel/netlabel_kapi.c
··· 111 111 struct netlbl_domaddr_map *addrmap = NULL; 112 112 struct netlbl_domaddr4_map *map4 = NULL; 113 113 struct netlbl_domaddr6_map *map6 = NULL; 114 - const struct in_addr *addr4, *mask4; 115 - const struct in6_addr *addr6, *mask6; 116 114 117 115 entry = kzalloc(sizeof(*entry), GFP_ATOMIC); 118 116 if (entry == NULL) ··· 131 133 INIT_LIST_HEAD(&addrmap->list6); 132 134 133 135 switch (family) { 134 - case AF_INET: 135 - addr4 = addr; 136 - mask4 = mask; 136 + case AF_INET: { 137 + const struct in_addr *addr4 = addr; 138 + const struct in_addr *mask4 = mask; 137 139 map4 = kzalloc(sizeof(*map4), GFP_ATOMIC); 138 140 if (map4 == NULL) 139 141 goto cfg_unlbl_map_add_failure; ··· 146 148 if (ret_val != 0) 147 149 goto cfg_unlbl_map_add_failure; 148 150 break; 149 - case AF_INET6: 150 - addr6 = addr; 151 - mask6 = mask; 151 + } 152 + #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 153 + case AF_INET6: { 154 + const struct in6_addr *addr6 = addr; 155 + const struct in6_addr *mask6 = mask; 152 156 map6 = kzalloc(sizeof(*map6), GFP_ATOMIC); 153 157 if (map6 == NULL) 154 158 goto cfg_unlbl_map_add_failure; ··· 162 162 map6->list.addr.s6_addr32[3] &= mask6->s6_addr32[3]; 163 163 ipv6_addr_copy(&map6->list.mask, mask6); 164 164 map6->list.valid = 1; 165 - ret_val = netlbl_af4list_add(&map4->list, 166 - &addrmap->list4); 165 + ret_val = netlbl_af6list_add(&map6->list, 166 + &addrmap->list6); 167 167 if (ret_val != 0) 168 168 goto cfg_unlbl_map_add_failure; 169 169 break; 170 + } 171 + #endif /* IPv6 */ 170 172 default: 171 173 goto cfg_unlbl_map_add_failure; 172 174 break; ··· 227 225 case AF_INET: 228 226 addr_len = sizeof(struct in_addr); 229 227 break; 228 + #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 230 229 case AF_INET6: 231 230 addr_len = sizeof(struct in6_addr); 232 231 break; 232 + #endif /* IPv6 */ 233 233 default: 234 234 return -EPFNOSUPPORT; 235 235 } ··· 270 266 case AF_INET: 271 267 addr_len = sizeof(struct in_addr); 272 268 break; 269 + #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 273 270 case AF_INET6: 274 271 addr_len = sizeof(struct in6_addr); 275 272 break; 273 + #endif /* IPv6 */ 276 274 default: 277 275 return -EPFNOSUPPORT; 278 276 }
+2 -2
net/sched/sch_red.c
··· 209 209 ctl->Plog, ctl->Scell_log, 210 210 nla_data(tb[TCA_RED_STAB])); 211 211 212 - if (skb_queue_empty(&sch->q)) 213 - red_end_of_idle_period(&q->parms); 212 + if (!q->qdisc->q.qlen) 213 + red_start_of_idle_period(&q->parms); 214 214 215 215 sch_tree_unlock(sch); 216 216 return 0;
+20 -11
net/sched/sch_teql.c
··· 225 225 226 226 227 227 static int 228 - __teql_resolve(struct sk_buff *skb, struct sk_buff *skb_res, struct net_device *dev) 228 + __teql_resolve(struct sk_buff *skb, struct sk_buff *skb_res, 229 + struct net_device *dev, struct netdev_queue *txq, 230 + struct neighbour *mn) 229 231 { 230 - struct netdev_queue *dev_queue = netdev_get_tx_queue(dev, 0); 231 - struct teql_sched_data *q = qdisc_priv(dev_queue->qdisc); 232 - struct neighbour *mn = dst_get_neighbour(skb_dst(skb)); 232 + struct teql_sched_data *q = qdisc_priv(txq->qdisc); 233 233 struct neighbour *n = q->ncache; 234 234 235 235 if (mn->tbl == NULL) ··· 262 262 } 263 263 264 264 static inline int teql_resolve(struct sk_buff *skb, 265 - struct sk_buff *skb_res, struct net_device *dev) 265 + struct sk_buff *skb_res, 266 + struct net_device *dev, 267 + struct netdev_queue *txq) 266 268 { 267 - struct netdev_queue *txq = netdev_get_tx_queue(dev, 0); 269 + struct dst_entry *dst = skb_dst(skb); 270 + struct neighbour *mn; 271 + int res; 272 + 268 273 if (txq->qdisc == &noop_qdisc) 269 274 return -ENODEV; 270 275 271 - if (dev->header_ops == NULL || 272 - skb_dst(skb) == NULL || 273 - dst_get_neighbour(skb_dst(skb)) == NULL) 276 + if (!dev->header_ops || !dst) 274 277 return 0; 275 - return __teql_resolve(skb, skb_res, dev); 278 + 279 + rcu_read_lock(); 280 + mn = dst_get_neighbour(dst); 281 + res = mn ? __teql_resolve(skb, skb_res, dev, txq, mn) : 0; 282 + rcu_read_unlock(); 283 + 284 + return res; 276 285 } 277 286 278 287 static netdev_tx_t teql_master_xmit(struct sk_buff *skb, struct net_device *dev) ··· 316 307 continue; 317 308 } 318 309 319 - switch (teql_resolve(skb, skb_res, slave)) { 310 + switch (teql_resolve(skb, skb_res, slave, slave_txq)) { 320 311 case 0: 321 312 if (__netif_tx_trylock(slave_txq)) { 322 313 unsigned int length = qdisc_pkt_len(skb);
+1 -1
net/sctp/auth.c
··· 82 82 struct sctp_auth_bytes *key; 83 83 84 84 /* Verify that we are not going to overflow INT_MAX */ 85 - if ((INT_MAX - key_len) < sizeof(struct sctp_auth_bytes)) 85 + if (key_len > (INT_MAX - sizeof(struct sctp_auth_bytes))) 86 86 return NULL; 87 87 88 88 /* Allocate the shared key */
+4
net/unix/af_unix.c
··· 1957 1957 if ((UNIXCB(skb).pid != siocb->scm->pid) || 1958 1958 (UNIXCB(skb).cred != siocb->scm->cred)) { 1959 1959 skb_queue_head(&sk->sk_receive_queue, skb); 1960 + sk->sk_data_ready(sk, skb->len); 1960 1961 break; 1961 1962 } 1962 1963 } else { ··· 1975 1974 chunk = min_t(unsigned int, skb->len, size); 1976 1975 if (memcpy_toiovec(msg->msg_iov, skb->data, chunk)) { 1977 1976 skb_queue_head(&sk->sk_receive_queue, skb); 1977 + sk->sk_data_ready(sk, skb->len); 1978 1978 if (copied == 0) 1979 1979 copied = -EFAULT; 1980 1980 break; ··· 1993 1991 /* put the skb back if we didn't use it up.. */ 1994 1992 if (skb->len) { 1995 1993 skb_queue_head(&sk->sk_receive_queue, skb); 1994 + sk->sk_data_ready(sk, skb->len); 1996 1995 break; 1997 1996 } 1998 1997 ··· 2009 2006 2010 2007 /* put message back and return */ 2011 2008 skb_queue_head(&sk->sk_receive_queue, skb); 2009 + sk->sk_data_ready(sk, skb->len); 2012 2010 break; 2013 2011 } 2014 2012 } while (size);
+2 -2
net/wireless/nl80211.c
··· 89 89 [NL80211_ATTR_IFINDEX] = { .type = NLA_U32 }, 90 90 [NL80211_ATTR_IFNAME] = { .type = NLA_NUL_STRING, .len = IFNAMSIZ-1 }, 91 91 92 - [NL80211_ATTR_MAC] = { .type = NLA_BINARY, .len = ETH_ALEN }, 93 - [NL80211_ATTR_PREV_BSSID] = { .type = NLA_BINARY, .len = ETH_ALEN }, 92 + [NL80211_ATTR_MAC] = { .len = ETH_ALEN }, 93 + [NL80211_ATTR_PREV_BSSID] = { .len = ETH_ALEN }, 94 94 95 95 [NL80211_ATTR_KEY] = { .type = NLA_NESTED, }, 96 96 [NL80211_ATTR_KEY_DATA] = { .type = NLA_BINARY,
+4
net/wireless/reg.c
··· 2037 2037 } 2038 2038 2039 2039 request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx); 2040 + if (!request_wiphy) { 2041 + reg_set_request_processed(); 2042 + return -ENODEV; 2043 + } 2040 2044 2041 2045 if (!last_request->intersect) { 2042 2046 int r;
+6 -4
net/xfrm/xfrm_policy.c
··· 2382 2382 return dst_metric_advmss(dst->path); 2383 2383 } 2384 2384 2385 - static unsigned int xfrm_default_mtu(const struct dst_entry *dst) 2385 + static unsigned int xfrm_mtu(const struct dst_entry *dst) 2386 2386 { 2387 - return dst_mtu(dst->path); 2387 + unsigned int mtu = dst_metric_raw(dst, RTAX_MTU); 2388 + 2389 + return mtu ? : dst_mtu(dst->path); 2388 2390 } 2389 2391 2390 2392 static struct neighbour *xfrm_neigh_lookup(const struct dst_entry *dst, const void *daddr) ··· 2413 2411 dst_ops->check = xfrm_dst_check; 2414 2412 if (likely(dst_ops->default_advmss == NULL)) 2415 2413 dst_ops->default_advmss = xfrm_default_advmss; 2416 - if (likely(dst_ops->default_mtu == NULL)) 2417 - dst_ops->default_mtu = xfrm_default_mtu; 2414 + if (likely(dst_ops->mtu == NULL)) 2415 + dst_ops->mtu = xfrm_mtu; 2418 2416 if (likely(dst_ops->negative_advice == NULL)) 2419 2417 dst_ops->negative_advice = xfrm_negative_advice; 2420 2418 if (likely(dst_ops->link_failure == NULL))