diff options
77 files changed, 589 insertions, 280 deletions
diff --git a/drivers/isdn/divert/divert_procfs.c b/drivers/isdn/divert/divert_procfs.c index 33ec9e467772..9021182c4b76 100644 --- a/drivers/isdn/divert/divert_procfs.c +++ b/drivers/isdn/divert/divert_procfs.c | |||
| @@ -242,6 +242,12 @@ static int isdn_divert_ioctl_unlocked(struct file *file, uint cmd, ulong arg) | |||
| 242 | case IIOCDOCFINT: | 242 | case IIOCDOCFINT: |
| 243 | if (!divert_if.drv_to_name(dioctl.cf_ctrl.drvid)) | 243 | if (!divert_if.drv_to_name(dioctl.cf_ctrl.drvid)) |
| 244 | return (-EINVAL); /* invalid driver */ | 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 | if ((i = cf_command(dioctl.cf_ctrl.drvid, | 251 | if ((i = cf_command(dioctl.cf_ctrl.drvid, |
| 246 | (cmd == IIOCDOCFACT) ? 1 : (cmd == IIOCDOCFDIS) ? 0 : 2, | 252 | (cmd == IIOCDOCFACT) ? 1 : (cmd == IIOCDOCFDIS) ? 0 : 2, |
| 247 | dioctl.cf_ctrl.cfproc, | 253 | dioctl.cf_ctrl.cfproc, |
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c index 1f73d7f7e024..2339d7396b9e 100644 --- a/drivers/isdn/i4l/isdn_net.c +++ b/drivers/isdn/i4l/isdn_net.c | |||
| @@ -2756,6 +2756,9 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg) | |||
| 2756 | char *c, | 2756 | char *c, |
| 2757 | *e; | 2757 | *e; |
| 2758 | 2758 | ||
| 2759 | if (strnlen(cfg->drvid, sizeof(cfg->drvid)) == | ||
| 2760 | sizeof(cfg->drvid)) | ||
| 2761 | return -EINVAL; | ||
| 2759 | drvidx = -1; | 2762 | drvidx = -1; |
| 2760 | chidx = -1; | 2763 | chidx = -1; |
| 2761 | strcpy(drvid, cfg->drvid); | 2764 | strcpy(drvid, cfg->drvid); |
diff --git a/drivers/net/arcnet/Kconfig b/drivers/net/arcnet/Kconfig index a73d9dc80ff6..84fb6349a59a 100644 --- a/drivers/net/arcnet/Kconfig +++ b/drivers/net/arcnet/Kconfig | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | menuconfig ARCNET | 5 | menuconfig ARCNET |
| 6 | depends on NETDEVICES && (ISA || PCI || PCMCIA) | 6 | depends on NETDEVICES && (ISA || PCI || PCMCIA) |
| 7 | bool "ARCnet support" | 7 | tristate "ARCnet support" |
| 8 | ---help--- | 8 | ---help--- |
| 9 | If you have a network card of this type, say Y and check out the | 9 | If you have a network card of this type, say Y and check out the |
| 10 | (arguably) beautiful poetry in | 10 | (arguably) beautiful poetry in |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index b0c577256487..7f8756825b8a 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
| @@ -2553,30 +2553,6 @@ re_arm: | |||
| 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 | static int bond_has_this_ip(struct bonding *bond, __be32 ip) | 2556 | static int bond_has_this_ip(struct bonding *bond, __be32 ip) |
| 2581 | { | 2557 | { |
| 2582 | struct vlan_entry *vlan; | 2558 | struct vlan_entry *vlan; |
| @@ -3322,6 +3298,10 @@ static int bond_inetaddr_event(struct notifier_block *this, unsigned long event, | |||
| 3322 | struct bonding *bond; | 3298 | struct bonding *bond; |
| 3323 | struct vlan_entry *vlan; | 3299 | struct vlan_entry *vlan; |
| 3324 | 3300 | ||
| 3301 | /* we only care about primary address */ | ||
| 3302 | if(ifa->ifa_flags & IFA_F_SECONDARY) | ||
| 3303 | return NOTIFY_DONE; | ||
| 3304 | |||
| 3325 | list_for_each_entry(bond, &bn->dev_list, bond_list) { | 3305 | list_for_each_entry(bond, &bn->dev_list, bond_list) { |
| 3326 | if (bond->dev == event_dev) { | 3306 | if (bond->dev == event_dev) { |
| 3327 | switch (event) { | 3307 | switch (event) { |
| @@ -3329,7 +3309,7 @@ static int bond_inetaddr_event(struct notifier_block *this, unsigned long event, | |||
| 3329 | bond->master_ip = ifa->ifa_local; | 3309 | bond->master_ip = ifa->ifa_local; |
| 3330 | return NOTIFY_OK; | 3310 | return NOTIFY_OK; |
| 3331 | case NETDEV_DOWN: | 3311 | case NETDEV_DOWN: |
| 3332 | bond->master_ip = bond_glean_dev_ip(bond->dev); | 3312 | bond->master_ip = 0; |
| 3333 | return NOTIFY_OK; | 3313 | return NOTIFY_OK; |
| 3334 | default: | 3314 | default: |
| 3335 | return NOTIFY_DONE; | 3315 | return NOTIFY_DONE; |
| @@ -3345,8 +3325,7 @@ static int bond_inetaddr_event(struct notifier_block *this, unsigned long event, | |||
| 3345 | vlan->vlan_ip = ifa->ifa_local; | 3325 | vlan->vlan_ip = ifa->ifa_local; |
| 3346 | return NOTIFY_OK; | 3326 | return NOTIFY_OK; |
| 3347 | case NETDEV_DOWN: | 3327 | case NETDEV_DOWN: |
| 3348 | vlan->vlan_ip = | 3328 | vlan->vlan_ip = 0; |
| 3349 | bond_glean_dev_ip(vlan_dev); | ||
| 3350 | return NOTIFY_OK; | 3329 | return NOTIFY_OK; |
| 3351 | default: | 3330 | default: |
| 3352 | return NOTIFY_DONE; | 3331 | return NOTIFY_DONE; |
diff --git a/drivers/net/can/sja1000/peak_pci.c b/drivers/net/can/sja1000/peak_pci.c index 905bce0b3a43..2c7f5036f570 100644 --- a/drivers/net/can/sja1000/peak_pci.c +++ b/drivers/net/can/sja1000/peak_pci.c | |||
| @@ -20,7 +20,6 @@ | |||
| 20 | */ | 20 | */ |
| 21 | 21 | ||
| 22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
| 23 | #include <linux/version.h> | ||
| 24 | #include <linux/module.h> | 23 | #include <linux/module.h> |
| 25 | #include <linux/interrupt.h> | 24 | #include <linux/interrupt.h> |
| 26 | #include <linux/netdevice.h> | 25 | #include <linux/netdevice.h> |
diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c index 4cf835dbc122..3fb66d09ece5 100644 --- a/drivers/net/ethernet/broadcom/b44.c +++ b/drivers/net/ethernet/broadcom/b44.c | |||
| @@ -608,7 +608,7 @@ static void b44_tx(struct b44 *bp) | |||
| 608 | skb->len, | 608 | skb->len, |
| 609 | DMA_TO_DEVICE); | 609 | DMA_TO_DEVICE); |
| 610 | rp->skb = NULL; | 610 | rp->skb = NULL; |
| 611 | dev_kfree_skb(skb); | 611 | dev_kfree_skb_irq(skb); |
| 612 | } | 612 | } |
| 613 | 613 | ||
| 614 | bp->tx_cons = cons; | 614 | bp->tx_cons = cons; |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c index bce203fa4b9e..882f48f0a03c 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | |||
| @@ -10327,6 +10327,43 @@ static int bnx2x_54618se_config_init(struct bnx2x_phy *phy, | |||
| 10327 | return 0; | 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 | static void bnx2x_54618se_link_reset(struct bnx2x_phy *phy, | 10367 | static void bnx2x_54618se_link_reset(struct bnx2x_phy *phy, |
| 10331 | struct link_params *params) | 10368 | struct link_params *params) |
| 10332 | { | 10369 | { |
| @@ -11103,7 +11140,7 @@ static struct bnx2x_phy phy_54618se = { | |||
| 11103 | .config_loopback = (config_loopback_t)bnx2x_54618se_config_loopback, | 11140 | .config_loopback = (config_loopback_t)bnx2x_54618se_config_loopback, |
| 11104 | .format_fw_ver = (format_fw_ver_t)NULL, | 11141 | .format_fw_ver = (format_fw_ver_t)NULL, |
| 11105 | .hw_reset = (hw_reset_t)NULL, | 11142 | .hw_reset = (hw_reset_t)NULL, |
| 11106 | .set_link_led = (set_link_led_t)NULL, | 11143 | .set_link_led = (set_link_led_t)bnx2x_5461x_set_link_led, |
| 11107 | .phy_specific_func = (phy_specific_func_t)NULL | 11144 | .phy_specific_func = (phy_specific_func_t)NULL |
| 11108 | }; | 11145 | }; |
| 11109 | /*****************************************************************/ | 11146 | /*****************************************************************/ |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h index fc7bd0f23c0b..e58073ef33b4 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h | |||
| @@ -6990,6 +6990,7 @@ Theotherbitsarereservedandshouldbezero*/ | |||
| 6990 | #define MDIO_REG_INTR_MASK 0x1b | 6990 | #define MDIO_REG_INTR_MASK 0x1b |
| 6991 | #define MDIO_REG_INTR_MASK_LINK_STATUS (0x1 << 1) | 6991 | #define MDIO_REG_INTR_MASK_LINK_STATUS (0x1 << 1) |
| 6992 | #define MDIO_REG_GPHY_SHADOW 0x1c | 6992 | #define MDIO_REG_GPHY_SHADOW 0x1c |
| 6993 | #define MDIO_REG_GPHY_SHADOW_LED_SEL1 (0x0d << 10) | ||
| 6993 | #define MDIO_REG_GPHY_SHADOW_LED_SEL2 (0x0e << 10) | 6994 | #define MDIO_REG_GPHY_SHADOW_LED_SEL2 (0x0e << 10) |
| 6994 | #define MDIO_REG_GPHY_SHADOW_WR_ENA (0x1 << 15) | 6995 | #define MDIO_REG_GPHY_SHADOW_WR_ENA (0x1 << 15) |
| 6995 | #define MDIO_REG_GPHY_SHADOW_AUTO_DET_MED (0x1e << 10) | 6996 | #define MDIO_REG_GPHY_SHADOW_AUTO_DET_MED (0x1e << 10) |
diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c index 438f4580bf66..2a22f5256353 100644 --- a/drivers/net/ethernet/davicom/dm9000.c +++ b/drivers/net/ethernet/davicom/dm9000.c | |||
| @@ -613,7 +613,7 @@ static int dm9000_set_wol(struct net_device *dev, struct ethtool_wolinfo *w) | |||
| 613 | 613 | ||
| 614 | if (!dm->wake_state) | 614 | if (!dm->wake_state) |
| 615 | irq_set_irq_wake(dm->irq_wake, 1); | 615 | irq_set_irq_wake(dm->irq_wake, 1); |
| 616 | else if (dm->wake_state & !opts) | 616 | else if (dm->wake_state && !opts) |
| 617 | irq_set_irq_wake(dm->irq_wake, 0); | 617 | irq_set_irq_wake(dm->irq_wake, 0); |
| 618 | } | 618 | } |
| 619 | 619 | ||
diff --git a/drivers/net/ethernet/freescale/Kconfig b/drivers/net/ethernet/freescale/Kconfig index c520cfd3b298..5272f9d4dda9 100644 --- a/drivers/net/ethernet/freescale/Kconfig +++ b/drivers/net/ethernet/freescale/Kconfig | |||
| @@ -24,6 +24,7 @@ config FEC | |||
| 24 | bool "FEC ethernet controller (of ColdFire and some i.MX CPUs)" | 24 | bool "FEC ethernet controller (of ColdFire and some i.MX CPUs)" |
| 25 | depends on (M523x || M527x || M5272 || M528x || M520x || M532x || \ | 25 | depends on (M523x || M527x || M5272 || M528x || M520x || M532x || \ |
| 26 | ARCH_MXC || ARCH_MXS) | 26 | ARCH_MXC || ARCH_MXS) |
| 27 | default ARCH_MXC || ARCH_MXS if ARM | ||
| 27 | select PHYLIB | 28 | select PHYLIB |
| 28 | ---help--- | 29 | ---help--- |
| 29 | Say Y here if you want to use the built-in 10/100 Fast ethernet | 30 | Say Y here if you want to use the built-in 10/100 Fast ethernet |
diff --git a/drivers/net/ethernet/ibm/ehea/ehea.h b/drivers/net/ethernet/ibm/ehea/ehea.h index 410d6a1984ed..6650068c996c 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea.h +++ b/drivers/net/ethernet/ibm/ehea/ehea.h | |||
| @@ -61,9 +61,9 @@ | |||
| 61 | #ifdef EHEA_SMALL_QUEUES | 61 | #ifdef EHEA_SMALL_QUEUES |
| 62 | #define EHEA_MAX_CQE_COUNT 1023 | 62 | #define EHEA_MAX_CQE_COUNT 1023 |
| 63 | #define EHEA_DEF_ENTRIES_SQ 1023 | 63 | #define EHEA_DEF_ENTRIES_SQ 1023 |
| 64 | #define EHEA_DEF_ENTRIES_RQ1 4095 | 64 | #define EHEA_DEF_ENTRIES_RQ1 1023 |
| 65 | #define EHEA_DEF_ENTRIES_RQ2 1023 | 65 | #define EHEA_DEF_ENTRIES_RQ2 1023 |
| 66 | #define EHEA_DEF_ENTRIES_RQ3 1023 | 66 | #define EHEA_DEF_ENTRIES_RQ3 511 |
| 67 | #else | 67 | #else |
| 68 | #define EHEA_MAX_CQE_COUNT 4080 | 68 | #define EHEA_MAX_CQE_COUNT 4080 |
| 69 | #define EHEA_DEF_ENTRIES_SQ 4080 | 69 | #define EHEA_DEF_ENTRIES_SQ 4080 |
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c index 37b70f7052b6..bfeccbfde236 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea_main.c +++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c | |||
| @@ -371,7 +371,8 @@ static void ehea_update_stats(struct work_struct *work) | |||
| 371 | out_herr: | 371 | out_herr: |
| 372 | free_page((unsigned long)cb2); | 372 | free_page((unsigned long)cb2); |
| 373 | resched: | 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 | static void ehea_refill_rq1(struct ehea_port_res *pr, int index, int nr_of_wqes) | 378 | static void ehea_refill_rq1(struct ehea_port_res *pr, int index, int nr_of_wqes) |
| @@ -2434,7 +2435,8 @@ static int ehea_open(struct net_device *dev) | |||
| 2434 | } | 2435 | } |
| 2435 | 2436 | ||
| 2436 | mutex_unlock(&port->port_lock); | 2437 | mutex_unlock(&port->port_lock); |
| 2437 | schedule_delayed_work(&port->stats_work, msecs_to_jiffies(1000)); | 2438 | schedule_delayed_work(&port->stats_work, |
| 2439 | round_jiffies_relative(msecs_to_jiffies(1000))); | ||
| 2438 | 2440 | ||
| 2439 | return ret; | 2441 | return ret; |
| 2440 | } | 2442 | } |
diff --git a/drivers/net/ethernet/ibm/iseries_veth.c b/drivers/net/ethernet/ibm/iseries_veth.c index 4326681df382..acc31af6594a 100644 --- a/drivers/net/ethernet/ibm/iseries_veth.c +++ b/drivers/net/ethernet/ibm/iseries_veth.c | |||
| @@ -1421,7 +1421,7 @@ static void veth_receive(struct veth_lpar_connection *cnx, | |||
| 1421 | 1421 | ||
| 1422 | /* FIXME: do we need this? */ | 1422 | /* FIXME: do we need this? */ |
| 1423 | memset(local_list, 0, sizeof(local_list)); | 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 | /* a 0 address marks the end of the valid entries */ | 1426 | /* a 0 address marks the end of the valid entries */ |
| 1427 | if (senddata->addr[startchunk] == 0) | 1427 | if (senddata->addr[startchunk] == 0) |
diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c index 7becff1f387d..76b84573566b 100644 --- a/drivers/net/ethernet/jme.c +++ b/drivers/net/ethernet/jme.c | |||
| @@ -1745,6 +1745,112 @@ jme_phy_off(struct jme_adapter *jme) | |||
| 1745 | } | 1745 | } |
| 1746 | 1746 | ||
| 1747 | static int | 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 | jme_open(struct net_device *netdev) | 1854 | jme_open(struct net_device *netdev) |
| 1749 | { | 1855 | { |
| 1750 | struct jme_adapter *jme = netdev_priv(netdev); | 1856 | struct jme_adapter *jme = netdev_priv(netdev); |
| @@ -1769,7 +1875,8 @@ jme_open(struct net_device *netdev) | |||
| 1769 | jme_set_settings(netdev, &jme->old_ecmd); | 1875 | jme_set_settings(netdev, &jme->old_ecmd); |
| 1770 | else | 1876 | else |
| 1771 | jme_reset_phy_processor(jme); | 1877 | jme_reset_phy_processor(jme); |
| 1772 | 1878 | jme_phy_calibration(jme); | |
| 1879 | jme_phy_setEA(jme); | ||
| 1773 | jme_reset_link(jme); | 1880 | jme_reset_link(jme); |
| 1774 | 1881 | ||
| 1775 | return 0; | 1882 | return 0; |
| @@ -3184,7 +3291,8 @@ jme_resume(struct device *dev) | |||
| 3184 | jme_set_settings(netdev, &jme->old_ecmd); | 3291 | jme_set_settings(netdev, &jme->old_ecmd); |
| 3185 | else | 3292 | else |
| 3186 | jme_reset_phy_processor(jme); | 3293 | jme_reset_phy_processor(jme); |
| 3187 | 3294 | jme_phy_calibration(jme); | |
| 3295 | jme_phy_setEA(jme); | ||
| 3188 | jme_start_irq(jme); | 3296 | jme_start_irq(jme); |
| 3189 | netif_device_attach(netdev); | 3297 | netif_device_attach(netdev); |
| 3190 | 3298 | ||
| @@ -3239,4 +3347,3 @@ MODULE_DESCRIPTION("JMicron JMC2x0 PCI Express Ethernet driver"); | |||
| 3239 | MODULE_LICENSE("GPL"); | 3347 | MODULE_LICENSE("GPL"); |
| 3240 | MODULE_VERSION(DRV_VERSION); | 3348 | MODULE_VERSION(DRV_VERSION); |
| 3241 | MODULE_DEVICE_TABLE(pci, jme_pci_tbl); | 3349 | MODULE_DEVICE_TABLE(pci, jme_pci_tbl); |
| 3242 | |||
diff --git a/drivers/net/ethernet/jme.h b/drivers/net/ethernet/jme.h index 02ea27c1dcb5..4304072bd3c5 100644 --- a/drivers/net/ethernet/jme.h +++ b/drivers/net/ethernet/jme.h | |||
| @@ -760,6 +760,25 @@ enum jme_rxmcs_bits { | |||
| 760 | RXMCS_CHECKSUM, | 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 | * Wakeup Frame setup interface registers | 783 | * Wakeup Frame setup interface registers |
| 765 | */ | 784 | */ |
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge.h b/drivers/net/ethernet/qlogic/qlge/qlge.h index 8731f79c9efc..b8478aab050e 100644 --- a/drivers/net/ethernet/qlogic/qlge/qlge.h +++ b/drivers/net/ethernet/qlogic/qlge/qlge.h | |||
| @@ -58,10 +58,8 @@ | |||
| 58 | 58 | ||
| 59 | 59 | ||
| 60 | #define TX_DESC_PER_IOCB 8 | 60 | #define TX_DESC_PER_IOCB 8 |
| 61 | /* The maximum number of frags we handle is based | 61 | |
| 62 | * on PAGE_SIZE... | 62 | #if ((MAX_SKB_FRAGS - TX_DESC_PER_IOCB) + 2) > 0 |
| 63 | */ | ||
| 64 | #if (PAGE_SHIFT == 12) || (PAGE_SHIFT == 13) /* 4k & 8k pages */ | ||
| 65 | #define TX_DESC_PER_OAL ((MAX_SKB_FRAGS - TX_DESC_PER_IOCB) + 2) | 63 | #define TX_DESC_PER_OAL ((MAX_SKB_FRAGS - TX_DESC_PER_IOCB) + 2) |
| 66 | #else /* all other page sizes */ | 64 | #else /* all other page sizes */ |
| 67 | #define TX_DESC_PER_OAL 0 | 65 | #define TX_DESC_PER_OAL 0 |
| @@ -1353,7 +1351,7 @@ struct tx_ring_desc { | |||
| 1353 | struct ob_mac_iocb_req *queue_entry; | 1351 | struct ob_mac_iocb_req *queue_entry; |
| 1354 | u32 index; | 1352 | u32 index; |
| 1355 | struct oal oal; | 1353 | struct oal oal; |
| 1356 | struct map_list map[MAX_SKB_FRAGS + 1]; | 1354 | struct map_list map[MAX_SKB_FRAGS + 2]; |
| 1357 | int map_cnt; | 1355 | int map_cnt; |
| 1358 | struct tx_ring_desc *next; | 1356 | struct tx_ring_desc *next; |
| 1359 | }; | 1357 | }; |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 8ea770a89f25..72cd190b9c1a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | |||
| @@ -781,10 +781,15 @@ static void stmmac_mmc_setup(struct stmmac_priv *priv) | |||
| 781 | unsigned int mode = MMC_CNTRL_RESET_ON_READ | MMC_CNTRL_COUNTER_RESET | | 781 | unsigned int mode = MMC_CNTRL_RESET_ON_READ | MMC_CNTRL_COUNTER_RESET | |
| 782 | MMC_CNTRL_PRESET | MMC_CNTRL_FULL_HALF_PRESET; | 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 | dwmac_mmc_intr_all_mask(priv->ioaddr); | 786 | dwmac_mmc_intr_all_mask(priv->ioaddr); |
| 786 | dwmac_mmc_ctrl(priv->ioaddr, mode); | 787 | |
| 787 | memset(&priv->mmc, 0, sizeof(struct stmmac_counters)); | 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 | static u32 stmmac_get_synopsys_id(struct stmmac_priv *priv) | 795 | static u32 stmmac_get_synopsys_id(struct stmmac_priv *priv) |
| @@ -1012,8 +1017,7 @@ static int stmmac_open(struct net_device *dev) | |||
| 1012 | memset(&priv->xstats, 0, sizeof(struct stmmac_extra_stats)); | 1017 | memset(&priv->xstats, 0, sizeof(struct stmmac_extra_stats)); |
| 1013 | priv->xstats.threshold = tc; | 1018 | priv->xstats.threshold = tc; |
| 1014 | 1019 | ||
| 1015 | if (priv->dma_cap.rmon) | 1020 | stmmac_mmc_setup(priv); |
| 1016 | stmmac_mmc_setup(priv); | ||
| 1017 | 1021 | ||
| 1018 | /* Start the ball rolling... */ | 1022 | /* Start the ball rolling... */ |
| 1019 | DBG(probe, DEBUG, "%s: DMA RX/TX processes started...\n", dev->name); | 1023 | DBG(probe, DEBUG, "%s: DMA RX/TX processes started...\n", dev->name); |
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index bb88e12101c7..a70244306c94 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | menuconfig PHYLIB | 5 | menuconfig PHYLIB |
| 6 | bool "PHY Device support and infrastructure" | 6 | tristate "PHY Device support and infrastructure" |
| 7 | depends on !S390 | 7 | depends on !S390 |
| 8 | depends on NETDEVICES | 8 | depends on NETDEVICES |
| 9 | help | 9 | help |
diff --git a/drivers/net/wireless/p54/p54spi.c b/drivers/net/wireless/p54/p54spi.c index f18df82eeb92..78d0d6988553 100644 --- a/drivers/net/wireless/p54/p54spi.c +++ b/drivers/net/wireless/p54/p54spi.c | |||
| @@ -588,8 +588,6 @@ static void p54spi_op_stop(struct ieee80211_hw *dev) | |||
| 588 | 588 | ||
| 589 | WARN_ON(priv->fw_state != FW_STATE_READY); | 589 | WARN_ON(priv->fw_state != FW_STATE_READY); |
| 590 | 590 | ||
| 591 | cancel_work_sync(&priv->work); | ||
| 592 | |||
| 593 | p54spi_power_off(priv); | 591 | p54spi_power_off(priv); |
| 594 | spin_lock_irqsave(&priv->tx_lock, flags); | 592 | spin_lock_irqsave(&priv->tx_lock, flags); |
| 595 | INIT_LIST_HEAD(&priv->tx_pending); | 593 | INIT_LIST_HEAD(&priv->tx_pending); |
| @@ -597,6 +595,8 @@ static void p54spi_op_stop(struct ieee80211_hw *dev) | |||
| 597 | 595 | ||
| 598 | priv->fw_state = FW_STATE_OFF; | 596 | priv->fw_state = FW_STATE_OFF; |
| 599 | mutex_unlock(&priv->mutex); | 597 | mutex_unlock(&priv->mutex); |
| 598 | |||
| 599 | cancel_work_sync(&priv->work); | ||
| 600 | } | 600 | } |
| 601 | 601 | ||
| 602 | static int __devinit p54spi_probe(struct spi_device *spi) | 602 | static int __devinit p54spi_probe(struct spi_device *spi) |
| @@ -656,6 +656,7 @@ static int __devinit p54spi_probe(struct spi_device *spi) | |||
| 656 | init_completion(&priv->fw_comp); | 656 | init_completion(&priv->fw_comp); |
| 657 | INIT_LIST_HEAD(&priv->tx_pending); | 657 | INIT_LIST_HEAD(&priv->tx_pending); |
| 658 | mutex_init(&priv->mutex); | 658 | mutex_init(&priv->mutex); |
| 659 | spin_lock_init(&priv->tx_lock); | ||
| 659 | SET_IEEE80211_DEV(hw, &spi->dev); | 660 | SET_IEEE80211_DEV(hw, &spi->dev); |
| 660 | priv->common.open = p54spi_op_start; | 661 | priv->common.open = p54spi_op_start; |
| 661 | priv->common.stop = p54spi_op_stop; | 662 | priv->common.stop = p54spi_op_stop; |
diff --git a/drivers/net/wireless/prism54/isl_ioctl.c b/drivers/net/wireless/prism54/isl_ioctl.c index d97a2caf582b..bc2ba80c47bb 100644 --- a/drivers/net/wireless/prism54/isl_ioctl.c +++ b/drivers/net/wireless/prism54/isl_ioctl.c | |||
| @@ -778,7 +778,7 @@ prism54_get_essid(struct net_device *ndev, struct iw_request_info *info, | |||
| 778 | dwrq->flags = 0; | 778 | dwrq->flags = 0; |
| 779 | dwrq->length = 0; | 779 | dwrq->length = 0; |
| 780 | } | 780 | } |
| 781 | essid->octets[essid->length] = '\0'; | 781 | essid->octets[dwrq->length] = '\0'; |
| 782 | memcpy(extra, essid->octets, dwrq->length); | 782 | memcpy(extra, essid->octets, dwrq->length); |
| 783 | kfree(essid); | 783 | kfree(essid); |
| 784 | 784 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index 3f183a15186e..1ba079dffb11 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
| @@ -3771,7 +3771,7 @@ static void rt2800_efuse_read(struct rt2x00_dev *rt2x00dev, unsigned int i) | |||
| 3771 | /* Apparently the data is read from end to start */ | 3771 | /* Apparently the data is read from end to start */ |
| 3772 | rt2800_register_read_lock(rt2x00dev, EFUSE_DATA3, ®); | 3772 | rt2800_register_read_lock(rt2x00dev, EFUSE_DATA3, ®); |
| 3773 | /* The returned value is in CPU order, but eeprom is le */ | 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 | rt2800_register_read_lock(rt2x00dev, EFUSE_DATA2, ®); | 3775 | rt2800_register_read_lock(rt2x00dev, EFUSE_DATA2, ®); |
| 3776 | *(u32 *)&rt2x00dev->eeprom[i + 2] = cpu_to_le32(reg); | 3776 | *(u32 *)&rt2x00dev->eeprom[i + 2] = cpu_to_le32(reg); |
| 3777 | rt2800_register_read_lock(rt2x00dev, EFUSE_DATA1, ®); | 3777 | rt2800_register_read_lock(rt2x00dev, EFUSE_DATA1, ®); |
diff --git a/drivers/net/wireless/rtlwifi/ps.c b/drivers/net/wireless/rtlwifi/ps.c index db5262844543..55c8e50f45fd 100644 --- a/drivers/net/wireless/rtlwifi/ps.c +++ b/drivers/net/wireless/rtlwifi/ps.c | |||
| @@ -395,7 +395,7 @@ void rtl_lps_enter(struct ieee80211_hw *hw) | |||
| 395 | if (mac->link_state != MAC80211_LINKED) | 395 | if (mac->link_state != MAC80211_LINKED) |
| 396 | return; | 396 | return; |
| 397 | 397 | ||
| 398 | spin_lock(&rtlpriv->locks.lps_lock); | 398 | spin_lock_irq(&rtlpriv->locks.lps_lock); |
| 399 | 399 | ||
| 400 | /* Idle for a while if we connect to AP a while ago. */ | 400 | /* Idle for a while if we connect to AP a while ago. */ |
| 401 | if (mac->cnt_after_linked >= 2) { | 401 | if (mac->cnt_after_linked >= 2) { |
| @@ -407,7 +407,7 @@ void rtl_lps_enter(struct ieee80211_hw *hw) | |||
| 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 | /*Leave the leisure power save mode.*/ | 413 | /*Leave the leisure power save mode.*/ |
| @@ -416,8 +416,9 @@ void rtl_lps_leave(struct ieee80211_hw *hw) | |||
| 416 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 416 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
| 417 | struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); | 417 | struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); |
| 418 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); | 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 | if (ppsc->fwctrl_lps) { | 423 | if (ppsc->fwctrl_lps) { |
| 423 | if (ppsc->dot11_psmode != EACTIVE) { | 424 | if (ppsc->dot11_psmode != EACTIVE) { |
| @@ -438,7 +439,7 @@ void rtl_lps_leave(struct ieee80211_hw *hw) | |||
| 438 | rtl_lps_set_psmode(hw, EACTIVE); | 439 | rtl_lps_set_psmode(hw, EACTIVE); |
| 439 | } | 440 | } |
| 440 | } | 441 | } |
| 441 | spin_unlock(&rtlpriv->locks.lps_lock); | 442 | spin_unlock_irqrestore(&rtlpriv->locks.lps_lock, flags); |
| 442 | } | 443 | } |
| 443 | 444 | ||
| 444 | /* For sw LPS*/ | 445 | /* For sw LPS*/ |
| @@ -539,9 +540,9 @@ void rtl_swlps_rf_awake(struct ieee80211_hw *hw) | |||
| 539 | RT_CLEAR_PS_LEVEL(ppsc, RT_PS_LEVEL_ASPM); | 540 | RT_CLEAR_PS_LEVEL(ppsc, RT_PS_LEVEL_ASPM); |
| 540 | } | 541 | } |
| 541 | 542 | ||
| 542 | spin_lock(&rtlpriv->locks.lps_lock); | 543 | spin_lock_irq(&rtlpriv->locks.lps_lock); |
| 543 | rtl_ps_set_rf_state(hw, ERFON, RF_CHANGE_BY_PS); | 544 | rtl_ps_set_rf_state(hw, ERFON, RF_CHANGE_BY_PS); |
| 544 | spin_unlock(&rtlpriv->locks.lps_lock); | 545 | spin_unlock_irq(&rtlpriv->locks.lps_lock); |
| 545 | } | 546 | } |
| 546 | 547 | ||
| 547 | void rtl_swlps_rfon_wq_callback(void *data) | 548 | void rtl_swlps_rfon_wq_callback(void *data) |
| @@ -574,9 +575,9 @@ void rtl_swlps_rf_sleep(struct ieee80211_hw *hw) | |||
| 574 | if (rtlpriv->link_info.busytraffic) | 575 | if (rtlpriv->link_info.busytraffic) |
| 575 | return; | 576 | return; |
| 576 | 577 | ||
| 577 | spin_lock(&rtlpriv->locks.lps_lock); | 578 | spin_lock_irq(&rtlpriv->locks.lps_lock); |
| 578 | rtl_ps_set_rf_state(hw, ERFSLEEP, RF_CHANGE_BY_PS); | 579 | rtl_ps_set_rf_state(hw, ERFSLEEP, RF_CHANGE_BY_PS); |
| 579 | spin_unlock(&rtlpriv->locks.lps_lock); | 580 | spin_unlock_irq(&rtlpriv->locks.lps_lock); |
| 580 | 581 | ||
| 581 | if (ppsc->reg_rfps_level & RT_RF_OFF_LEVL_ASPM && | 582 | if (ppsc->reg_rfps_level & RT_RF_OFF_LEVL_ASPM && |
| 582 | !RT_IN_PS_LEVEL(ppsc, RT_PS_LEVEL_ASPM)) { | 583 | !RT_IN_PS_LEVEL(ppsc, RT_PS_LEVEL_ASPM)) { |
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c index 0cb594c86090..1ae270eed51a 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c | |||
| @@ -1021,7 +1021,7 @@ static int xen_netbk_tx_check_gop(struct xen_netbk *netbk, | |||
| 1021 | pending_idx = *((u16 *)skb->data); | 1021 | pending_idx = *((u16 *)skb->data); |
| 1022 | xen_netbk_idx_release(netbk, pending_idx); | 1022 | xen_netbk_idx_release(netbk, pending_idx); |
| 1023 | for (j = start; j < i; j++) { | 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 | xen_netbk_idx_release(netbk, pending_idx); | 1025 | xen_netbk_idx_release(netbk, pending_idx); |
| 1026 | } | 1026 | } |
| 1027 | 1027 | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index cbeb5867cff7..a82ad4dd306a 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -2536,6 +2536,8 @@ extern void net_disable_timestamp(void); | |||
| 2536 | extern void *dev_seq_start(struct seq_file *seq, loff_t *pos); | 2536 | extern void *dev_seq_start(struct seq_file *seq, loff_t *pos); |
| 2537 | extern void *dev_seq_next(struct seq_file *seq, void *v, loff_t *pos); | 2537 | extern void *dev_seq_next(struct seq_file *seq, void *v, loff_t *pos); |
| 2538 | extern void dev_seq_stop(struct seq_file *seq, void *v); | 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 | #endif | 2541 | #endif |
| 2540 | 2542 | ||
| 2541 | extern int netdev_class_create_file(struct class_attribute *class_attr); | 2543 | extern int netdev_class_create_file(struct class_attribute *class_attr); |
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h index c5336705921f..7281d5acf2f9 100644 --- a/include/linux/pkt_sched.h +++ b/include/linux/pkt_sched.h | |||
| @@ -30,7 +30,7 @@ | |||
| 30 | */ | 30 | */ |
| 31 | 31 | ||
| 32 | struct tc_stats { | 32 | struct tc_stats { |
| 33 | __u64 bytes; /* NUmber of enqueues bytes */ | 33 | __u64 bytes; /* Number of enqueued bytes */ |
| 34 | __u32 packets; /* Number of enqueued packets */ | 34 | __u32 packets; /* Number of enqueued packets */ |
| 35 | __u32 drops; /* Packets dropped because of lack of resources */ | 35 | __u32 drops; /* Packets dropped because of lack of resources */ |
| 36 | __u32 overlimits; /* Number of throttle events when this | 36 | __u32 overlimits; /* Number of throttle events when this |
| @@ -297,7 +297,7 @@ struct tc_htb_glob { | |||
| 297 | __u32 debug; /* debug flags */ | 297 | __u32 debug; /* debug flags */ |
| 298 | 298 | ||
| 299 | /* stats */ | 299 | /* stats */ |
| 300 | __u32 direct_pkts; /* count of non shapped packets */ | 300 | __u32 direct_pkts; /* count of non shaped packets */ |
| 301 | }; | 301 | }; |
| 302 | enum { | 302 | enum { |
| 303 | TCA_HTB_UNSPEC, | 303 | TCA_HTB_UNSPEC, |
| @@ -503,7 +503,7 @@ enum { | |||
| 503 | }; | 503 | }; |
| 504 | #define NETEM_LOSS_MAX (__NETEM_LOSS_MAX - 1) | 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 | struct tc_netem_gimodel { | 507 | struct tc_netem_gimodel { |
| 508 | __u32 p13; | 508 | __u32 p13; |
| 509 | __u32 p31; | 509 | __u32 p31; |
diff --git a/include/net/dst.h b/include/net/dst.h index 4fb6c4381791..6faec1a60216 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
| @@ -205,12 +205,7 @@ dst_feature(const struct dst_entry *dst, u32 feature) | |||
| 205 | 205 | ||
| 206 | static inline u32 dst_mtu(const struct dst_entry *dst) | 206 | static inline u32 dst_mtu(const struct dst_entry *dst) |
| 207 | { | 207 | { |
| 208 | u32 mtu = dst_metric_raw(dst, RTAX_MTU); | 208 | return dst->ops->mtu(dst); |
| 209 | |||
| 210 | if (!mtu) | ||
| 211 | mtu = dst->ops->default_mtu(dst); | ||
| 212 | |||
| 213 | return mtu; | ||
| 214 | } | 209 | } |
| 215 | 210 | ||
| 216 | /* RTT metrics are stored in milliseconds for user ABI, but used as jiffies */ | 211 | /* RTT metrics are stored in milliseconds for user ABI, but used as jiffies */ |
diff --git a/include/net/dst_ops.h b/include/net/dst_ops.h index 9adb99845a56..e1c2ee0eef47 100644 --- a/include/net/dst_ops.h +++ b/include/net/dst_ops.h | |||
| @@ -17,7 +17,7 @@ struct dst_ops { | |||
| 17 | int (*gc)(struct dst_ops *ops); | 17 | int (*gc)(struct dst_ops *ops); |
| 18 | struct dst_entry * (*check)(struct dst_entry *, __u32 cookie); | 18 | struct dst_entry * (*check)(struct dst_entry *, __u32 cookie); |
| 19 | unsigned int (*default_advmss)(const struct dst_entry *); | 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 | u32 * (*cow_metrics)(struct dst_entry *, unsigned long); | 21 | u32 * (*cow_metrics)(struct dst_entry *, unsigned long); |
| 22 | void (*destroy)(struct dst_entry *); | 22 | void (*destroy)(struct dst_entry *); |
| 23 | void (*ifdown)(struct dst_entry *, | 23 | void (*ifdown)(struct dst_entry *, |
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index b897d6e6d0a5..f941964a9931 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | /** struct ip_options - IP Options | 31 | /** struct ip_options - IP Options |
| 32 | * | 32 | * |
| 33 | * @faddr - Saved first hop address | 33 | * @faddr - Saved first hop address |
| 34 | * @nexthop - Saved nexthop address in LSRR and SSRR | ||
| 34 | * @is_data - Options in __data, rather than skb | 35 | * @is_data - Options in __data, rather than skb |
| 35 | * @is_strictroute - Strict source route | 36 | * @is_strictroute - Strict source route |
| 36 | * @srr_is_hit - Packet destination addr was our one | 37 | * @srr_is_hit - Packet destination addr was our one |
| @@ -41,6 +42,7 @@ | |||
| 41 | */ | 42 | */ |
| 42 | struct ip_options { | 43 | struct ip_options { |
| 43 | __be32 faddr; | 44 | __be32 faddr; |
| 45 | __be32 nexthop; | ||
| 44 | unsigned char optlen; | 46 | unsigned char optlen; |
| 45 | unsigned char srr; | 47 | unsigned char srr; |
| 46 | unsigned char rr; | 48 | unsigned char rr; |
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index 78c83e62218f..e9ff3fc5e688 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h | |||
| @@ -35,6 +35,7 @@ struct inet_peer { | |||
| 35 | 35 | ||
| 36 | u32 metrics[RTAX_MAX]; | 36 | u32 metrics[RTAX_MAX]; |
| 37 | u32 rate_tokens; /* rate limiting for ICMP */ | 37 | u32 rate_tokens; /* rate limiting for ICMP */ |
| 38 | int redirect_genid; | ||
| 38 | unsigned long rate_last; | 39 | unsigned long rate_last; |
| 39 | unsigned long pmtu_expires; | 40 | unsigned long pmtu_expires; |
| 40 | u32 pmtu_orig; | 41 | u32 pmtu_orig; |
diff --git a/include/net/netfilter/nf_conntrack_ecache.h b/include/net/netfilter/nf_conntrack_ecache.h index 4283508b3e18..a88fb6939387 100644 --- a/include/net/netfilter/nf_conntrack_ecache.h +++ b/include/net/netfilter/nf_conntrack_ecache.h | |||
| @@ -67,18 +67,18 @@ struct nf_ct_event_notifier { | |||
| 67 | int (*fcn)(unsigned int events, struct nf_ct_event *item); | 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; | 70 | extern int nf_conntrack_register_notifier(struct net *net, struct nf_ct_event_notifier *nb); |
| 71 | extern int nf_conntrack_register_notifier(struct nf_ct_event_notifier *nb); | 71 | extern void nf_conntrack_unregister_notifier(struct net *net, struct nf_ct_event_notifier *nb); |
| 72 | extern void nf_conntrack_unregister_notifier(struct nf_ct_event_notifier *nb); | ||
| 73 | 72 | ||
| 74 | extern void nf_ct_deliver_cached_events(struct nf_conn *ct); | 73 | extern void nf_ct_deliver_cached_events(struct nf_conn *ct); |
| 75 | 74 | ||
| 76 | static inline void | 75 | static inline void |
| 77 | nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct) | 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 | struct nf_conntrack_ecache *e; | 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 | return; | 82 | return; |
| 83 | 83 | ||
| 84 | e = nf_ct_ecache_find(ct); | 84 | e = nf_ct_ecache_find(ct); |
| @@ -95,11 +95,12 @@ nf_conntrack_eventmask_report(unsigned int eventmask, | |||
| 95 | int report) | 95 | int report) |
| 96 | { | 96 | { |
| 97 | int ret = 0; | 97 | int ret = 0; |
| 98 | struct net *net = nf_ct_net(ct); | ||
| 98 | struct nf_ct_event_notifier *notify; | 99 | struct nf_ct_event_notifier *notify; |
| 99 | struct nf_conntrack_ecache *e; | 100 | struct nf_conntrack_ecache *e; |
| 100 | 101 | ||
| 101 | rcu_read_lock(); | 102 | rcu_read_lock(); |
| 102 | notify = rcu_dereference(nf_conntrack_event_cb); | 103 | notify = rcu_dereference(net->ct.nf_conntrack_event_cb); |
| 103 | if (notify == NULL) | 104 | if (notify == NULL) |
| 104 | goto out_unlock; | 105 | goto out_unlock; |
| 105 | 106 | ||
| @@ -164,9 +165,8 @@ struct nf_exp_event_notifier { | |||
| 164 | int (*fcn)(unsigned int events, struct nf_exp_event *item); | 165 | int (*fcn)(unsigned int events, struct nf_exp_event *item); |
| 165 | }; | 166 | }; |
| 166 | 167 | ||
| 167 | extern struct nf_exp_event_notifier __rcu *nf_expect_event_cb; | 168 | extern int nf_ct_expect_register_notifier(struct net *net, struct nf_exp_event_notifier *nb); |
| 168 | extern int nf_ct_expect_register_notifier(struct nf_exp_event_notifier *nb); | 169 | extern void nf_ct_expect_unregister_notifier(struct net *net, struct nf_exp_event_notifier *nb); |
| 169 | extern void nf_ct_expect_unregister_notifier(struct nf_exp_event_notifier *nb); | ||
| 170 | 170 | ||
| 171 | static inline void | 171 | static inline void |
| 172 | nf_ct_expect_event_report(enum ip_conntrack_expect_events event, | 172 | nf_ct_expect_event_report(enum ip_conntrack_expect_events event, |
| @@ -174,11 +174,12 @@ nf_ct_expect_event_report(enum ip_conntrack_expect_events event, | |||
| 174 | u32 pid, | 174 | u32 pid, |
| 175 | int report) | 175 | int report) |
| 176 | { | 176 | { |
| 177 | struct net *net = nf_ct_exp_net(exp); | ||
| 177 | struct nf_exp_event_notifier *notify; | 178 | struct nf_exp_event_notifier *notify; |
| 178 | struct nf_conntrack_ecache *e; | 179 | struct nf_conntrack_ecache *e; |
| 179 | 180 | ||
| 180 | rcu_read_lock(); | 181 | rcu_read_lock(); |
| 181 | notify = rcu_dereference(nf_expect_event_cb); | 182 | notify = rcu_dereference(net->ct.nf_expect_event_cb); |
| 182 | if (notify == NULL) | 183 | if (notify == NULL) |
| 183 | goto out_unlock; | 184 | goto out_unlock; |
| 184 | 185 | ||
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h index 0249399e51a7..7a911eca0f18 100644 --- a/include/net/netns/conntrack.h +++ b/include/net/netns/conntrack.h | |||
| @@ -18,6 +18,8 @@ struct netns_ct { | |||
| 18 | struct hlist_nulls_head unconfirmed; | 18 | struct hlist_nulls_head unconfirmed; |
| 19 | struct hlist_nulls_head dying; | 19 | struct hlist_nulls_head dying; |
| 20 | struct ip_conntrack_stat __percpu *stat; | 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 | int sysctl_events; | 23 | int sysctl_events; |
| 22 | unsigned int sysctl_events_retry_timeout; | 24 | unsigned int sysctl_events_retry_timeout; |
| 23 | int sysctl_acct; | 25 | int sysctl_acct; |
diff --git a/include/net/red.h b/include/net/red.h index 3319f16b3beb..b72a3b833936 100644 --- a/include/net/red.h +++ b/include/net/red.h | |||
| @@ -116,7 +116,7 @@ struct red_parms { | |||
| 116 | u32 qR; /* Cached random number */ | 116 | u32 qR; /* Cached random number */ |
| 117 | 117 | ||
| 118 | unsigned long qavg; /* Average queue length: A scaled */ | 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 | static inline u32 red_rmask(u8 Plog) | 122 | static inline u32 red_rmask(u8 Plog) |
| @@ -148,17 +148,17 @@ static inline void red_set_parms(struct red_parms *p, | |||
| 148 | 148 | ||
| 149 | static inline int red_is_idling(struct red_parms *p) | 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 | static inline void red_start_of_idle_period(struct red_parms *p) | 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 | static inline void red_end_of_idle_period(struct red_parms *p) | 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 | static inline void red_restart(struct red_parms *p) | 164 | static inline void red_restart(struct red_parms *p) |
| @@ -170,13 +170,10 @@ static inline void red_restart(struct red_parms *p) | |||
| 170 | 170 | ||
| 171 | static inline unsigned long red_calc_qavg_from_idle_time(struct red_parms *p) | 171 | static inline unsigned long red_calc_qavg_from_idle_time(struct red_parms *p) |
| 172 | { | 172 | { |
| 173 | psched_time_t now; | 173 | s64 delta = ktime_us_delta(ktime_get(), p->qidlestart); |
| 174 | long us_idle; | 174 | long us_idle = min_t(s64, delta, p->Scell_max); |
| 175 | int shift; | 175 | int shift; |
| 176 | 176 | ||
| 177 | now = psched_get_time(); | ||
| 178 | us_idle = psched_tdiff_bounded(now, p->qidlestart, p->Scell_max); | ||
| 179 | |||
| 180 | /* | 177 | /* |
| 181 | * The problem: ideally, average length queue recalcultion should | 178 | * The problem: ideally, average length queue recalcultion should |
| 182 | * be done over constant clock intervals. This is too expensive, so | 179 | * be done over constant clock intervals. This is too expensive, so |
diff --git a/include/net/route.h b/include/net/route.h index db7b3432f07c..91855d185b53 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
| @@ -71,12 +71,12 @@ struct rtable { | |||
| 71 | struct fib_info *fi; /* for client ref to shared metrics */ | 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 | return rt->rt_route_iif != 0; | 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 | return rt->rt_route_iif == 0; | 81 | return rt->rt_route_iif == 0; |
| 82 | } | 82 | } |
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c index e5f9ece3c9a0..a1daf8227ed1 100644 --- a/net/bridge/br_netlink.c +++ b/net/bridge/br_netlink.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <net/sock.h> | 18 | #include <net/sock.h> |
| 19 | 19 | ||
| 20 | #include "br_private.h" | 20 | #include "br_private.h" |
| 21 | #include "br_private_stp.h" | ||
| 21 | 22 | ||
| 22 | static inline size_t br_nlmsg_size(void) | 23 | static inline size_t br_nlmsg_size(void) |
| 23 | { | 24 | { |
| @@ -188,6 +189,11 @@ static int br_rtm_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) | |||
| 188 | 189 | ||
| 189 | p->state = new_state; | 190 | p->state = new_state; |
| 190 | br_log_state(p); | 191 | br_log_state(p); |
| 192 | |||
| 193 | spin_lock_bh(&p->br->lock); | ||
| 194 | br_port_state_selection(p->br); | ||
| 195 | spin_unlock_bh(&p->br->lock); | ||
| 196 | |||
| 191 | br_ifinfo_notify(RTM_NEWLINK, p); | 197 | br_ifinfo_notify(RTM_NEWLINK, p); |
| 192 | 198 | ||
| 193 | return 0; | 199 | return 0; |
diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c index ad0a3f7cf6cc..dd147d78a588 100644 --- a/net/bridge/br_stp.c +++ b/net/bridge/br_stp.c | |||
| @@ -399,25 +399,24 @@ void br_port_state_selection(struct net_bridge *br) | |||
| 399 | struct net_bridge_port *p; | 399 | struct net_bridge_port *p; |
| 400 | unsigned int liveports = 0; | 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 | list_for_each_entry(p, &br->port_list, list) { | 402 | list_for_each_entry(p, &br->port_list, list) { |
| 407 | if (p->state == BR_STATE_DISABLED) | 403 | if (p->state == BR_STATE_DISABLED) |
| 408 | continue; | 404 | continue; |
| 409 | 405 | ||
| 410 | if (p->port_no == br->root_port) { | 406 | /* Don't change port states if userspace is handling STP */ |
| 411 | p->config_pending = 0; | 407 | if (br->stp_enabled != BR_USER_STP) { |
| 412 | p->topology_change_ack = 0; | 408 | if (p->port_no == br->root_port) { |
| 413 | br_make_forwarding(p); | 409 | p->config_pending = 0; |
| 414 | } else if (br_is_designated_port(p)) { | 410 | p->topology_change_ack = 0; |
| 415 | del_timer(&p->message_age_timer); | 411 | br_make_forwarding(p); |
| 416 | br_make_forwarding(p); | 412 | } else if (br_is_designated_port(p)) { |
| 417 | } else { | 413 | del_timer(&p->message_age_timer); |
| 418 | p->config_pending = 0; | 414 | br_make_forwarding(p); |
| 419 | p->topology_change_ack = 0; | 415 | } else { |
| 420 | br_make_blocking(p); | 416 | p->config_pending = 0; |
| 417 | p->topology_change_ack = 0; | ||
| 418 | br_make_blocking(p); | ||
| 419 | } | ||
| 421 | } | 420 | } |
| 422 | 421 | ||
| 423 | if (p->state == BR_STATE_FORWARDING) | 422 | if (p->state == BR_STATE_FORWARDING) |
diff --git a/net/caif/cffrml.c b/net/caif/cffrml.c index f39921171d0d..d3ca87bf23b7 100644 --- a/net/caif/cffrml.c +++ b/net/caif/cffrml.c | |||
| @@ -136,20 +136,21 @@ static int cffrml_receive(struct cflayer *layr, struct cfpkt *pkt) | |||
| 136 | 136 | ||
| 137 | static int cffrml_transmit(struct cflayer *layr, struct cfpkt *pkt) | 137 | static int cffrml_transmit(struct cflayer *layr, struct cfpkt *pkt) |
| 138 | { | 138 | { |
| 139 | int tmp; | ||
| 140 | u16 chks; | 139 | u16 chks; |
| 141 | u16 len; | 140 | u16 len; |
| 141 | __le16 data; | ||
| 142 | |||
| 142 | struct cffrml *this = container_obj(layr); | 143 | struct cffrml *this = container_obj(layr); |
| 143 | if (this->dofcs) { | 144 | if (this->dofcs) { |
| 144 | chks = cfpkt_iterate(pkt, cffrml_checksum, 0xffff); | 145 | chks = cfpkt_iterate(pkt, cffrml_checksum, 0xffff); |
| 145 | tmp = cpu_to_le16(chks); | 146 | data = cpu_to_le16(chks); |
| 146 | cfpkt_add_trail(pkt, &tmp, 2); | 147 | cfpkt_add_trail(pkt, &data, 2); |
| 147 | } else { | 148 | } else { |
| 148 | cfpkt_pad_trail(pkt, 2); | 149 | cfpkt_pad_trail(pkt, 2); |
| 149 | } | 150 | } |
| 150 | len = cfpkt_getlen(pkt); | 151 | len = cfpkt_getlen(pkt); |
| 151 | tmp = cpu_to_le16(len); | 152 | data = cpu_to_le16(len); |
| 152 | cfpkt_add_head(pkt, &tmp, 2); | 153 | cfpkt_add_head(pkt, &data, 2); |
| 153 | cfpkt_info(pkt)->hdr_len += 2; | 154 | cfpkt_info(pkt)->hdr_len += 2; |
| 154 | if (cfpkt_erroneous(pkt)) { | 155 | if (cfpkt_erroneous(pkt)) { |
| 155 | pr_err("Packet is erroneous!\n"); | 156 | pr_err("Packet is erroneous!\n"); |
diff --git a/net/core/dev.c b/net/core/dev.c index 6ba50a1e404c..5a13edfc9f73 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -1396,7 +1396,7 @@ rollback: | |||
| 1396 | for_each_net(net) { | 1396 | for_each_net(net) { |
| 1397 | for_each_netdev(net, dev) { | 1397 | for_each_netdev(net, dev) { |
| 1398 | if (dev == last) | 1398 | if (dev == last) |
| 1399 | break; | 1399 | goto outroll; |
| 1400 | 1400 | ||
| 1401 | if (dev->flags & IFF_UP) { | 1401 | if (dev->flags & IFF_UP) { |
| 1402 | nb->notifier_call(nb, NETDEV_GOING_DOWN, dev); | 1402 | nb->notifier_call(nb, NETDEV_GOING_DOWN, dev); |
| @@ -1407,6 +1407,7 @@ rollback: | |||
| 1407 | } | 1407 | } |
| 1408 | } | 1408 | } |
| 1409 | 1409 | ||
| 1410 | outroll: | ||
| 1410 | raw_notifier_chain_unregister(&netdev_chain, nb); | 1411 | raw_notifier_chain_unregister(&netdev_chain, nb); |
| 1411 | goto unlock; | 1412 | goto unlock; |
| 1412 | } | 1413 | } |
| @@ -4282,6 +4283,12 @@ static int dev_seq_open(struct inode *inode, struct file *file) | |||
| 4282 | sizeof(struct dev_iter_state)); | 4283 | sizeof(struct dev_iter_state)); |
| 4283 | } | 4284 | } |
| 4284 | 4285 | ||
| 4286 | int dev_seq_open_ops(struct inode *inode, struct file *file, | ||
| 4287 | const struct seq_operations *ops) | ||
| 4288 | { | ||
| 4289 | return seq_open_net(inode, file, ops, sizeof(struct dev_iter_state)); | ||
| 4290 | } | ||
| 4291 | |||
| 4285 | static const struct file_operations dev_seq_fops = { | 4292 | static const struct file_operations dev_seq_fops = { |
| 4286 | .owner = THIS_MODULE, | 4293 | .owner = THIS_MODULE, |
| 4287 | .open = dev_seq_open, | 4294 | .open = dev_seq_open, |
diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c index 277faef9148d..febba516db62 100644 --- a/net/core/dev_addr_lists.c +++ b/net/core/dev_addr_lists.c | |||
| @@ -696,8 +696,7 @@ static const struct seq_operations dev_mc_seq_ops = { | |||
| 696 | 696 | ||
| 697 | static int dev_mc_seq_open(struct inode *inode, struct file *file) | 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, | 699 | return dev_seq_open_ops(inode, file, &dev_mc_seq_ops); |
| 700 | sizeof(struct seq_net_private)); | ||
| 701 | } | 700 | } |
| 702 | 701 | ||
| 703 | static const struct file_operations dev_mc_seq_fops = { | 702 | static const struct file_operations dev_mc_seq_fops = { |
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 039d51e6c284..5ac07d31fbc9 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
| @@ -2397,7 +2397,10 @@ static struct pneigh_entry *pneigh_get_next(struct seq_file *seq, | |||
| 2397 | struct net *net = seq_file_net(seq); | 2397 | struct net *net = seq_file_net(seq); |
| 2398 | struct neigh_table *tbl = state->tbl; | 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 | while (!pn) { | 2404 | while (!pn) { |
| 2402 | if (++state->bucket > PNEIGH_HASHMASK) | 2405 | if (++state->bucket > PNEIGH_HASHMASK) |
| 2403 | break; | 2406 | break; |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 18a3cebb753d..3c30ee4a5710 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
| @@ -2230,7 +2230,7 @@ static int skb_prepare_for_shift(struct sk_buff *skb) | |||
| 2230 | * @shiftlen: shift up to this many bytes | 2230 | * @shiftlen: shift up to this many bytes |
| 2231 | * | 2231 | * |
| 2232 | * Attempts to shift up to shiftlen worth of bytes, which may be less than | 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 | * It's up to caller to free skb if everything was shifted. | 2234 | * It's up to caller to free skb if everything was shifted. |
| 2235 | * | 2235 | * |
| 2236 | * If @tgt runs out of frags, the whole operation is aborted. | 2236 | * If @tgt runs out of frags, the whole operation is aborted. |
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index 90a919afbed7..3f4e5414c8e5 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
| @@ -111,6 +111,7 @@ int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
| 111 | rt = ip_route_newports(fl4, rt, orig_sport, orig_dport, | 111 | rt = ip_route_newports(fl4, rt, orig_sport, orig_dport, |
| 112 | inet->inet_sport, inet->inet_dport, sk); | 112 | inet->inet_sport, inet->inet_dport, sk); |
| 113 | if (IS_ERR(rt)) { | 113 | if (IS_ERR(rt)) { |
| 114 | err = PTR_ERR(rt); | ||
| 114 | rt = NULL; | 115 | rt = NULL; |
| 115 | goto failure; | 116 | goto failure; |
| 116 | } | 117 | } |
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c index a77d16158eb6..94f4ec036669 100644 --- a/net/decnet/dn_route.c +++ b/net/decnet/dn_route.c | |||
| @@ -112,7 +112,7 @@ static unsigned long dn_rt_deadline; | |||
| 112 | static int dn_dst_gc(struct dst_ops *ops); | 112 | static int dn_dst_gc(struct dst_ops *ops); |
| 113 | static struct dst_entry *dn_dst_check(struct dst_entry *, __u32); | 113 | static struct dst_entry *dn_dst_check(struct dst_entry *, __u32); |
| 114 | static unsigned int dn_dst_default_advmss(const struct dst_entry *dst); | 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 | static void dn_dst_destroy(struct dst_entry *); | 116 | static void dn_dst_destroy(struct dst_entry *); |
| 117 | static struct dst_entry *dn_dst_negative_advice(struct dst_entry *); | 117 | static struct dst_entry *dn_dst_negative_advice(struct dst_entry *); |
| 118 | static void dn_dst_link_failure(struct sk_buff *); | 118 | static void dn_dst_link_failure(struct sk_buff *); |
| @@ -135,7 +135,7 @@ static struct dst_ops dn_dst_ops = { | |||
| 135 | .gc = dn_dst_gc, | 135 | .gc = dn_dst_gc, |
| 136 | .check = dn_dst_check, | 136 | .check = dn_dst_check, |
| 137 | .default_advmss = dn_dst_default_advmss, | 137 | .default_advmss = dn_dst_default_advmss, |
| 138 | .default_mtu = dn_dst_default_mtu, | 138 | .mtu = dn_dst_mtu, |
| 139 | .cow_metrics = dst_cow_metrics_generic, | 139 | .cow_metrics = dst_cow_metrics_generic, |
| 140 | .destroy = dn_dst_destroy, | 140 | .destroy = dn_dst_destroy, |
| 141 | .negative_advice = dn_dst_negative_advice, | 141 | .negative_advice = dn_dst_negative_advice, |
| @@ -825,9 +825,11 @@ static unsigned int dn_dst_default_advmss(const struct dst_entry *dst) | |||
| 825 | return dn_mss_from_pmtu(dst->dev, dst_mtu(dst)); | 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 | static struct neighbour *dn_dst_neigh_lookup(const struct dst_entry *dst, const void *daddr) | 835 | static struct neighbour *dn_dst_neigh_lookup(const struct dst_entry *dst, const void *daddr) |
diff --git a/net/decnet/dn_timer.c b/net/decnet/dn_timer.c index 67f691bd4acf..d9c150cc59a9 100644 --- a/net/decnet/dn_timer.c +++ b/net/decnet/dn_timer.c | |||
| @@ -36,16 +36,13 @@ static void dn_slow_timer(unsigned long arg); | |||
| 36 | 36 | ||
| 37 | void dn_start_slow_timer(struct sock *sk) | 37 | void dn_start_slow_timer(struct sock *sk) |
| 38 | { | 38 | { |
| 39 | sk->sk_timer.expires = jiffies + SLOW_INTERVAL; | 39 | setup_timer(&sk->sk_timer, dn_slow_timer, (unsigned long)sk); |
| 40 | sk->sk_timer.function = dn_slow_timer; | 40 | sk_reset_timer(sk, &sk->sk_timer, jiffies + SLOW_INTERVAL); |
| 41 | sk->sk_timer.data = (unsigned long)sk; | ||
| 42 | |||
| 43 | add_timer(&sk->sk_timer); | ||
| 44 | } | 41 | } |
| 45 | 42 | ||
| 46 | void dn_stop_slow_timer(struct sock *sk) | 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 | static void dn_slow_timer(unsigned long arg) | 48 | static void dn_slow_timer(unsigned long arg) |
| @@ -53,12 +50,10 @@ static void dn_slow_timer(unsigned long arg) | |||
| 53 | struct sock *sk = (struct sock *)arg; | 50 | struct sock *sk = (struct sock *)arg; |
| 54 | struct dn_scp *scp = DN_SK(sk); | 51 | struct dn_scp *scp = DN_SK(sk); |
| 55 | 52 | ||
| 56 | sock_hold(sk); | ||
| 57 | bh_lock_sock(sk); | 53 | bh_lock_sock(sk); |
| 58 | 54 | ||
| 59 | if (sock_owned_by_user(sk)) { | 55 | if (sock_owned_by_user(sk)) { |
| 60 | sk->sk_timer.expires = jiffies + HZ / 10; | 56 | sk_reset_timer(sk, &sk->sk_timer, jiffies + HZ / 10); |
| 61 | add_timer(&sk->sk_timer); | ||
| 62 | goto out; | 57 | goto out; |
| 63 | } | 58 | } |
| 64 | 59 | ||
| @@ -100,9 +95,7 @@ static void dn_slow_timer(unsigned long arg) | |||
| 100 | scp->keepalive_fxn(sk); | 95 | scp->keepalive_fxn(sk); |
| 101 | } | 96 | } |
| 102 | 97 | ||
| 103 | sk->sk_timer.expires = jiffies + SLOW_INTERVAL; | 98 | sk_reset_timer(sk, &sk->sk_timer, jiffies + SLOW_INTERVAL); |
| 104 | |||
| 105 | add_timer(&sk->sk_timer); | ||
| 106 | out: | 99 | out: |
| 107 | bh_unlock_sock(sk); | 100 | bh_unlock_sock(sk); |
| 108 | sock_put(sk); | 101 | sock_put(sk); |
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index c6b5092f29a1..65f01dc47565 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
| @@ -1490,7 +1490,9 @@ static int devinet_conf_proc(ctl_table *ctl, int write, | |||
| 1490 | void __user *buffer, | 1490 | void __user *buffer, |
| 1491 | size_t *lenp, loff_t *ppos) | 1491 | size_t *lenp, loff_t *ppos) |
| 1492 | { | 1492 | { |
| 1493 | int old_value = *(int *)ctl->data; | ||
| 1493 | int ret = proc_dointvec(ctl, write, buffer, lenp, ppos); | 1494 | int ret = proc_dointvec(ctl, write, buffer, lenp, ppos); |
| 1495 | int new_value = *(int *)ctl->data; | ||
| 1494 | 1496 | ||
| 1495 | if (write) { | 1497 | if (write) { |
| 1496 | struct ipv4_devconf *cnf = ctl->extra1; | 1498 | struct ipv4_devconf *cnf = ctl->extra1; |
| @@ -1501,6 +1503,9 @@ static int devinet_conf_proc(ctl_table *ctl, int write, | |||
| 1501 | 1503 | ||
| 1502 | if (cnf == net->ipv4.devconf_dflt) | 1504 | if (cnf == net->ipv4.devconf_dflt) |
| 1503 | devinet_copy_dflt_conf(net, i); | 1505 | devinet_copy_dflt_conf(net, i); |
| 1506 | if (i == IPV4_DEVCONF_ACCEPT_LOCAL - 1) | ||
| 1507 | if ((new_value == 0) && (old_value != 0)) | ||
| 1508 | rt_cache_flush(net, 0); | ||
| 1504 | } | 1509 | } |
| 1505 | 1510 | ||
| 1506 | return ret; | 1511 | return ret; |
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index c7472eff2d51..b2ca095cb9da 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
| @@ -1716,7 +1716,8 @@ static int ip_mc_add_src(struct in_device *in_dev, __be32 *pmca, int sfmode, | |||
| 1716 | if (err) { | 1716 | if (err) { |
| 1717 | int j; | 1717 | int j; |
| 1718 | 1718 | ||
| 1719 | pmc->sfcount[sfmode]--; | 1719 | if (!delta) |
| 1720 | pmc->sfcount[sfmode]--; | ||
| 1720 | for (j=0; j<i; j++) | 1721 | for (j=0; j<i; j++) |
| 1721 | (void) ip_mc_del1_src(pmc, sfmode, &psfsrc[j]); | 1722 | (void) ip_mc_del1_src(pmc, sfmode, &psfsrc[j]); |
| 1722 | } else if (isexclude != (pmc->sfcount[MCAST_EXCLUDE] != 0)) { | 1723 | } else if (isexclude != (pmc->sfcount[MCAST_EXCLUDE] != 0)) { |
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index 68e8ac514383..ccee270a9b65 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c | |||
| @@ -108,9 +108,6 @@ static int inet_csk_diag_fill(struct sock *sk, | |||
| 108 | icsk->icsk_ca_ops->name); | 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 | r->idiag_family = sk->sk_family; | 111 | r->idiag_family = sk->sk_family; |
| 115 | r->idiag_state = sk->sk_state; | 112 | r->idiag_state = sk->sk_state; |
| 116 | r->idiag_timer = 0; | 113 | r->idiag_timer = 0; |
| @@ -125,16 +122,23 @@ static int inet_csk_diag_fill(struct sock *sk, | |||
| 125 | r->id.idiag_src[0] = inet->inet_rcv_saddr; | 122 | r->id.idiag_src[0] = inet->inet_rcv_saddr; |
| 126 | r->id.idiag_dst[0] = inet->inet_daddr; | 123 | r->id.idiag_dst[0] = inet->inet_daddr; |
| 127 | 124 | ||
| 125 | /* IPv6 dual-stack sockets use inet->tos for IPv4 connections, | ||
| 126 | * hence this needs to be included regardless of socket family. | ||
| 127 | */ | ||
| 128 | if (ext & (1 << (INET_DIAG_TOS - 1))) | ||
| 129 | RTA_PUT_U8(skb, INET_DIAG_TOS, inet->tos); | ||
| 130 | |||
| 128 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 131 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) |
| 129 | if (r->idiag_family == AF_INET6) { | 132 | if (r->idiag_family == AF_INET6) { |
| 130 | const struct ipv6_pinfo *np = inet6_sk(sk); | 133 | const struct ipv6_pinfo *np = inet6_sk(sk); |
| 131 | 134 | ||
| 135 | if (ext & (1 << (INET_DIAG_TCLASS - 1))) | ||
| 136 | RTA_PUT_U8(skb, INET_DIAG_TCLASS, np->tclass); | ||
| 137 | |||
| 132 | ipv6_addr_copy((struct in6_addr *)r->id.idiag_src, | 138 | ipv6_addr_copy((struct in6_addr *)r->id.idiag_src, |
| 133 | &np->rcv_saddr); | 139 | &np->rcv_saddr); |
| 134 | ipv6_addr_copy((struct in6_addr *)r->id.idiag_dst, | 140 | ipv6_addr_copy((struct in6_addr *)r->id.idiag_dst, |
| 135 | &np->daddr); | 141 | &np->daddr); |
| 136 | if (ext & (1 << (INET_DIAG_TCLASS - 1))) | ||
| 137 | RTA_PUT_U8(skb, INET_DIAG_TCLASS, np->tclass); | ||
| 138 | } | 142 | } |
| 139 | #endif | 143 | #endif |
| 140 | 144 | ||
diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c index 3b34d1c86270..29a07b6c7168 100644 --- a/net/ipv4/ip_forward.c +++ b/net/ipv4/ip_forward.c | |||
| @@ -84,7 +84,7 @@ int ip_forward(struct sk_buff *skb) | |||
| 84 | 84 | ||
| 85 | rt = skb_rtable(skb); | 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 | goto sr_failed; | 88 | goto sr_failed; |
| 89 | 89 | ||
| 90 | if (unlikely(skb->len > dst_mtu(&rt->dst) && !skb_is_gso(skb) && | 90 | if (unlikely(skb->len > dst_mtu(&rt->dst) && !skb_is_gso(skb) && |
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c index 05d20cca9d66..1e60f7679075 100644 --- a/net/ipv4/ip_options.c +++ b/net/ipv4/ip_options.c | |||
| @@ -568,12 +568,13 @@ void ip_forward_options(struct sk_buff *skb) | |||
| 568 | ) { | 568 | ) { |
| 569 | if (srrptr + 3 > srrspace) | 569 | if (srrptr + 3 > srrspace) |
| 570 | break; | 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 | break; | 572 | break; |
| 573 | } | 573 | } |
| 574 | if (srrptr + 3 <= srrspace) { | 574 | if (srrptr + 3 <= srrspace) { |
| 575 | opt->is_changed = 1; | 575 | opt->is_changed = 1; |
| 576 | ip_rt_get_source(&optptr[srrptr-1], skb, rt); | 576 | ip_rt_get_source(&optptr[srrptr-1], skb, rt); |
| 577 | ip_hdr(skb)->daddr = opt->nexthop; | ||
| 577 | optptr[2] = srrptr+4; | 578 | optptr[2] = srrptr+4; |
| 578 | } else if (net_ratelimit()) | 579 | } else if (net_ratelimit()) |
| 579 | printk(KERN_CRIT "ip_forward(): Argh! Destination lost!\n"); | 580 | printk(KERN_CRIT "ip_forward(): Argh! Destination lost!\n"); |
| @@ -640,7 +641,7 @@ int ip_options_rcv_srr(struct sk_buff *skb) | |||
| 640 | } | 641 | } |
| 641 | if (srrptr <= srrspace) { | 642 | if (srrptr <= srrspace) { |
| 642 | opt->srr_is_hit = 1; | 643 | opt->srr_is_hit = 1; |
| 643 | iph->daddr = nexthop; | 644 | opt->nexthop = nexthop; |
| 644 | opt->is_changed = 1; | 645 | opt->is_changed = 1; |
| 645 | } | 646 | } |
| 646 | return 0; | 647 | return 0; |
diff --git a/net/ipv4/netfilter.c b/net/ipv4/netfilter.c index 9899619ab9b8..4f47e064e262 100644 --- a/net/ipv4/netfilter.c +++ b/net/ipv4/netfilter.c | |||
| @@ -64,7 +64,8 @@ int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type) | |||
| 64 | /* Change in oif may mean change in hh_len. */ | 64 | /* Change in oif may mean change in hh_len. */ |
| 65 | hh_len = skb_dst(skb)->dev->hard_header_len; | 65 | hh_len = skb_dst(skb)->dev->hard_header_len; |
| 66 | if (skb_headroom(skb) < hh_len && | 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 | return -1; | 69 | return -1; |
| 69 | 70 | ||
| 70 | return 0; | 71 | return 0; |
diff --git a/net/ipv4/netfilter/Kconfig b/net/ipv4/netfilter/Kconfig index 1dfc18a03fd4..f19f2182894c 100644 --- a/net/ipv4/netfilter/Kconfig +++ b/net/ipv4/netfilter/Kconfig | |||
| @@ -325,7 +325,6 @@ config IP_NF_TARGET_TTL | |||
| 325 | # raw + specific targets | 325 | # raw + specific targets |
| 326 | config IP_NF_RAW | 326 | config IP_NF_RAW |
| 327 | tristate 'raw table support (required for NOTRACK/TRACE)' | 327 | tristate 'raw table support (required for NOTRACK/TRACE)' |
| 328 | depends on NETFILTER_ADVANCED | ||
| 329 | help | 328 | help |
| 330 | This option adds a `raw' table to iptables. This table is the very | 329 | This option adds a `raw' table to iptables. This table is the very |
| 331 | first in the netfilter framework and hooks in at the PREROUTING | 330 | first in the netfilter framework and hooks in at the PREROUTING |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 0c74da8a0473..ca5e237df029 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
| @@ -131,6 +131,7 @@ static int ip_rt_mtu_expires __read_mostly = 10 * 60 * HZ; | |||
| 131 | static int ip_rt_min_pmtu __read_mostly = 512 + 20 + 20; | 131 | static int ip_rt_min_pmtu __read_mostly = 512 + 20 + 20; |
| 132 | static int ip_rt_min_advmss __read_mostly = 256; | 132 | static int ip_rt_min_advmss __read_mostly = 256; |
| 133 | static int rt_chain_length_max __read_mostly = 20; | 133 | static int rt_chain_length_max __read_mostly = 20; |
| 134 | static int redirect_genid; | ||
| 134 | 135 | ||
| 135 | /* | 136 | /* |
| 136 | * Interface to generic destination cache. | 137 | * Interface to generic destination cache. |
| @@ -138,7 +139,7 @@ static int rt_chain_length_max __read_mostly = 20; | |||
| 138 | 139 | ||
| 139 | static struct dst_entry *ipv4_dst_check(struct dst_entry *dst, u32 cookie); | 140 | static struct dst_entry *ipv4_dst_check(struct dst_entry *dst, u32 cookie); |
| 140 | static unsigned int ipv4_default_advmss(const struct dst_entry *dst); | 141 | static unsigned int ipv4_default_advmss(const struct dst_entry *dst); |
| 141 | static unsigned int ipv4_default_mtu(const struct dst_entry *dst); | 142 | static unsigned int ipv4_mtu(const struct dst_entry *dst); |
| 142 | static void ipv4_dst_destroy(struct dst_entry *dst); | 143 | static void ipv4_dst_destroy(struct dst_entry *dst); |
| 143 | static struct dst_entry *ipv4_negative_advice(struct dst_entry *dst); | 144 | static struct dst_entry *ipv4_negative_advice(struct dst_entry *dst); |
| 144 | static void ipv4_link_failure(struct sk_buff *skb); | 145 | static void ipv4_link_failure(struct sk_buff *skb); |
| @@ -193,7 +194,7 @@ static struct dst_ops ipv4_dst_ops = { | |||
| 193 | .gc = rt_garbage_collect, | 194 | .gc = rt_garbage_collect, |
| 194 | .check = ipv4_dst_check, | 195 | .check = ipv4_dst_check, |
| 195 | .default_advmss = ipv4_default_advmss, | 196 | .default_advmss = ipv4_default_advmss, |
| 196 | .default_mtu = ipv4_default_mtu, | 197 | .mtu = ipv4_mtu, |
| 197 | .cow_metrics = ipv4_cow_metrics, | 198 | .cow_metrics = ipv4_cow_metrics, |
| 198 | .destroy = ipv4_dst_destroy, | 199 | .destroy = ipv4_dst_destroy, |
| 199 | .ifdown = ipv4_dst_ifdown, | 200 | .ifdown = ipv4_dst_ifdown, |
| @@ -416,9 +417,13 @@ static int rt_cache_seq_show(struct seq_file *seq, void *v) | |||
| 416 | else { | 417 | else { |
| 417 | struct rtable *r = v; | 418 | struct rtable *r = v; |
| 418 | struct neighbour *n; | 419 | struct neighbour *n; |
| 419 | int len; | 420 | int len, HHUptod; |
| 420 | 421 | ||
| 422 | rcu_read_lock(); | ||
| 421 | n = dst_get_neighbour(&r->dst); | 423 | n = dst_get_neighbour(&r->dst); |
| 424 | HHUptod = (n && (n->nud_state & NUD_CONNECTED)) ? 1 : 0; | ||
| 425 | rcu_read_unlock(); | ||
| 426 | |||
| 422 | seq_printf(seq, "%s\t%08X\t%08X\t%8X\t%d\t%u\t%d\t" | 427 | seq_printf(seq, "%s\t%08X\t%08X\t%8X\t%d\t%u\t%d\t" |
| 423 | "%08X\t%d\t%u\t%u\t%02X\t%d\t%1d\t%08X%n", | 428 | "%08X\t%d\t%u\t%u\t%02X\t%d\t%1d\t%08X%n", |
| 424 | r->dst.dev ? r->dst.dev->name : "*", | 429 | r->dst.dev ? r->dst.dev->name : "*", |
| @@ -432,7 +437,7 @@ static int rt_cache_seq_show(struct seq_file *seq, void *v) | |||
| 432 | dst_metric(&r->dst, RTAX_RTTVAR)), | 437 | dst_metric(&r->dst, RTAX_RTTVAR)), |
| 433 | r->rt_key_tos, | 438 | r->rt_key_tos, |
| 434 | -1, | 439 | -1, |
| 435 | (n && (n->nud_state & NUD_CONNECTED)) ? 1 : 0, | 440 | HHUptod, |
| 436 | r->rt_spec_dst, &len); | 441 | r->rt_spec_dst, &len); |
| 437 | 442 | ||
| 438 | seq_printf(seq, "%*s\n", 127 - len, ""); | 443 | seq_printf(seq, "%*s\n", 127 - len, ""); |
| @@ -837,6 +842,7 @@ static void rt_cache_invalidate(struct net *net) | |||
| 837 | 842 | ||
| 838 | get_random_bytes(&shuffle, sizeof(shuffle)); | 843 | get_random_bytes(&shuffle, sizeof(shuffle)); |
| 839 | atomic_add(shuffle + 1U, &net->ipv4.rt_genid); | 844 | atomic_add(shuffle + 1U, &net->ipv4.rt_genid); |
| 845 | redirect_genid++; | ||
| 840 | } | 846 | } |
| 841 | 847 | ||
| 842 | /* | 848 | /* |
| @@ -1391,8 +1397,10 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw, | |||
| 1391 | 1397 | ||
| 1392 | peer = rt->peer; | 1398 | peer = rt->peer; |
| 1393 | if (peer) { | 1399 | if (peer) { |
| 1394 | if (peer->redirect_learned.a4 != new_gw) { | 1400 | if (peer->redirect_learned.a4 != new_gw || |
| 1401 | peer->redirect_genid != redirect_genid) { | ||
| 1395 | peer->redirect_learned.a4 = new_gw; | 1402 | peer->redirect_learned.a4 = new_gw; |
| 1403 | peer->redirect_genid = redirect_genid; | ||
| 1396 | atomic_inc(&__rt_peer_genid); | 1404 | atomic_inc(&__rt_peer_genid); |
| 1397 | } | 1405 | } |
| 1398 | check_peer_redir(&rt->dst, peer); | 1406 | check_peer_redir(&rt->dst, peer); |
| @@ -1685,12 +1693,8 @@ static void ip_rt_update_pmtu(struct dst_entry *dst, u32 mtu) | |||
| 1685 | } | 1693 | } |
| 1686 | 1694 | ||
| 1687 | 1695 | ||
| 1688 | static struct dst_entry *ipv4_dst_check(struct dst_entry *dst, u32 cookie) | 1696 | static struct rtable *ipv4_validate_peer(struct rtable *rt) |
| 1689 | { | 1697 | { |
| 1690 | struct rtable *rt = (struct rtable *) dst; | ||
| 1691 | |||
| 1692 | if (rt_is_expired(rt)) | ||
| 1693 | return NULL; | ||
| 1694 | if (rt->rt_peer_genid != rt_peer_genid()) { | 1698 | if (rt->rt_peer_genid != rt_peer_genid()) { |
| 1695 | struct inet_peer *peer; | 1699 | struct inet_peer *peer; |
| 1696 | 1700 | ||
| @@ -1699,17 +1703,29 @@ static struct dst_entry *ipv4_dst_check(struct dst_entry *dst, u32 cookie) | |||
| 1699 | 1703 | ||
| 1700 | peer = rt->peer; | 1704 | peer = rt->peer; |
| 1701 | if (peer) { | 1705 | if (peer) { |
| 1702 | check_peer_pmtu(dst, peer); | 1706 | check_peer_pmtu(&rt->dst, peer); |
| 1703 | 1707 | ||
| 1708 | if (peer->redirect_genid != redirect_genid) | ||
| 1709 | peer->redirect_learned.a4 = 0; | ||
| 1704 | if (peer->redirect_learned.a4 && | 1710 | if (peer->redirect_learned.a4 && |
| 1705 | peer->redirect_learned.a4 != rt->rt_gateway) { | 1711 | peer->redirect_learned.a4 != rt->rt_gateway) { |
| 1706 | if (check_peer_redir(dst, peer)) | 1712 | if (check_peer_redir(&rt->dst, peer)) |
| 1707 | return NULL; | 1713 | return NULL; |
| 1708 | } | 1714 | } |
| 1709 | } | 1715 | } |
| 1710 | 1716 | ||
| 1711 | rt->rt_peer_genid = rt_peer_genid(); | 1717 | rt->rt_peer_genid = rt_peer_genid(); |
| 1712 | } | 1718 | } |
| 1719 | return rt; | ||
| 1720 | } | ||
| 1721 | |||
| 1722 | static struct dst_entry *ipv4_dst_check(struct dst_entry *dst, u32 cookie) | ||
| 1723 | { | ||
| 1724 | struct rtable *rt = (struct rtable *) dst; | ||
| 1725 | |||
| 1726 | if (rt_is_expired(rt)) | ||
| 1727 | return NULL; | ||
| 1728 | dst = (struct dst_entry *) ipv4_validate_peer(rt); | ||
| 1713 | return dst; | 1729 | return dst; |
| 1714 | } | 1730 | } |
| 1715 | 1731 | ||
| @@ -1814,12 +1830,17 @@ static unsigned int ipv4_default_advmss(const struct dst_entry *dst) | |||
| 1814 | return advmss; | 1830 | return advmss; |
| 1815 | } | 1831 | } |
| 1816 | 1832 | ||
| 1817 | static unsigned int ipv4_default_mtu(const struct dst_entry *dst) | 1833 | static unsigned int ipv4_mtu(const struct dst_entry *dst) |
| 1818 | { | 1834 | { |
| 1819 | unsigned int mtu = dst->dev->mtu; | 1835 | const struct rtable *rt = (const struct rtable *) dst; |
| 1836 | unsigned int mtu = dst_metric_raw(dst, RTAX_MTU); | ||
| 1837 | |||
| 1838 | if (mtu && rt_is_output_route(rt)) | ||
| 1839 | return mtu; | ||
| 1840 | |||
| 1841 | mtu = dst->dev->mtu; | ||
| 1820 | 1842 | ||
| 1821 | if (unlikely(dst_metric_locked(dst, RTAX_MTU))) { | 1843 | if (unlikely(dst_metric_locked(dst, RTAX_MTU))) { |
| 1822 | const struct rtable *rt = (const struct rtable *) dst; | ||
| 1823 | 1844 | ||
| 1824 | if (rt->rt_gateway != rt->rt_dst && mtu > 576) | 1845 | if (rt->rt_gateway != rt->rt_dst && mtu > 576) |
| 1825 | mtu = 576; | 1846 | mtu = 576; |
| @@ -1852,6 +1873,8 @@ static void rt_init_metrics(struct rtable *rt, const struct flowi4 *fl4, | |||
| 1852 | dst_init_metrics(&rt->dst, peer->metrics, false); | 1873 | dst_init_metrics(&rt->dst, peer->metrics, false); |
| 1853 | 1874 | ||
| 1854 | check_peer_pmtu(&rt->dst, peer); | 1875 | check_peer_pmtu(&rt->dst, peer); |
| 1876 | if (peer->redirect_genid != redirect_genid) | ||
| 1877 | peer->redirect_learned.a4 = 0; | ||
| 1855 | if (peer->redirect_learned.a4 && | 1878 | if (peer->redirect_learned.a4 && |
| 1856 | peer->redirect_learned.a4 != rt->rt_gateway) { | 1879 | peer->redirect_learned.a4 != rt->rt_gateway) { |
| 1857 | rt->rt_gateway = peer->redirect_learned.a4; | 1880 | rt->rt_gateway = peer->redirect_learned.a4; |
| @@ -2357,6 +2380,9 @@ int ip_route_input_common(struct sk_buff *skb, __be32 daddr, __be32 saddr, | |||
| 2357 | rth->rt_mark == skb->mark && | 2380 | rth->rt_mark == skb->mark && |
| 2358 | net_eq(dev_net(rth->dst.dev), net) && | 2381 | net_eq(dev_net(rth->dst.dev), net) && |
| 2359 | !rt_is_expired(rth)) { | 2382 | !rt_is_expired(rth)) { |
| 2383 | rth = ipv4_validate_peer(rth); | ||
| 2384 | if (!rth) | ||
| 2385 | continue; | ||
| 2360 | if (noref) { | 2386 | if (noref) { |
| 2361 | dst_use_noref(&rth->dst, jiffies); | 2387 | dst_use_noref(&rth->dst, jiffies); |
| 2362 | skb_dst_set_noref(skb, &rth->dst); | 2388 | skb_dst_set_noref(skb, &rth->dst); |
| @@ -2732,6 +2758,9 @@ struct rtable *__ip_route_output_key(struct net *net, struct flowi4 *flp4) | |||
| 2732 | (IPTOS_RT_MASK | RTO_ONLINK)) && | 2758 | (IPTOS_RT_MASK | RTO_ONLINK)) && |
| 2733 | net_eq(dev_net(rth->dst.dev), net) && | 2759 | net_eq(dev_net(rth->dst.dev), net) && |
| 2734 | !rt_is_expired(rth)) { | 2760 | !rt_is_expired(rth)) { |
| 2761 | rth = ipv4_validate_peer(rth); | ||
| 2762 | if (!rth) | ||
| 2763 | continue; | ||
| 2735 | dst_use(&rth->dst, jiffies); | 2764 | dst_use(&rth->dst, jiffies); |
| 2736 | RT_CACHE_STAT_INC(out_hit); | 2765 | RT_CACHE_STAT_INC(out_hit); |
| 2737 | rcu_read_unlock_bh(); | 2766 | rcu_read_unlock_bh(); |
| @@ -2755,9 +2784,11 @@ static struct dst_entry *ipv4_blackhole_dst_check(struct dst_entry *dst, u32 coo | |||
| 2755 | return NULL; | 2784 | return NULL; |
| 2756 | } | 2785 | } |
| 2757 | 2786 | ||
| 2758 | static unsigned int ipv4_blackhole_default_mtu(const struct dst_entry *dst) | 2787 | static unsigned int ipv4_blackhole_mtu(const struct dst_entry *dst) |
| 2759 | { | 2788 | { |
| 2760 | return 0; | 2789 | unsigned int mtu = dst_metric_raw(dst, RTAX_MTU); |
| 2790 | |||
| 2791 | return mtu ? : dst->dev->mtu; | ||
| 2761 | } | 2792 | } |
| 2762 | 2793 | ||
| 2763 | static void ipv4_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu) | 2794 | static void ipv4_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu) |
| @@ -2775,7 +2806,7 @@ static struct dst_ops ipv4_dst_blackhole_ops = { | |||
| 2775 | .protocol = cpu_to_be16(ETH_P_IP), | 2806 | .protocol = cpu_to_be16(ETH_P_IP), |
| 2776 | .destroy = ipv4_dst_destroy, | 2807 | .destroy = ipv4_dst_destroy, |
| 2777 | .check = ipv4_blackhole_dst_check, | 2808 | .check = ipv4_blackhole_dst_check, |
| 2778 | .default_mtu = ipv4_blackhole_default_mtu, | 2809 | .mtu = ipv4_blackhole_mtu, |
| 2779 | .default_advmss = ipv4_default_advmss, | 2810 | .default_advmss = ipv4_default_advmss, |
| 2780 | .update_pmtu = ipv4_rt_blackhole_update_pmtu, | 2811 | .update_pmtu = ipv4_rt_blackhole_update_pmtu, |
| 2781 | .cow_metrics = ipv4_rt_blackhole_cow_metrics, | 2812 | .cow_metrics = ipv4_rt_blackhole_cow_metrics, |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index ab0966df1e2a..5a65eeac1d29 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
| @@ -1164,7 +1164,7 @@ int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
| 1164 | struct inet_sock *inet = inet_sk(sk); | 1164 | struct inet_sock *inet = inet_sk(sk); |
| 1165 | struct sockaddr_in *sin = (struct sockaddr_in *)msg->msg_name; | 1165 | struct sockaddr_in *sin = (struct sockaddr_in *)msg->msg_name; |
| 1166 | struct sk_buff *skb; | 1166 | struct sk_buff *skb; |
| 1167 | unsigned int ulen; | 1167 | unsigned int ulen, copied; |
| 1168 | int peeked; | 1168 | int peeked; |
| 1169 | int err; | 1169 | int err; |
| 1170 | int is_udplite = IS_UDPLITE(sk); | 1170 | int is_udplite = IS_UDPLITE(sk); |
| @@ -1186,9 +1186,10 @@ try_again: | |||
| 1186 | goto out; | 1186 | goto out; |
| 1187 | 1187 | ||
| 1188 | ulen = skb->len - sizeof(struct udphdr); | 1188 | ulen = skb->len - sizeof(struct udphdr); |
| 1189 | if (len > ulen) | 1189 | copied = len; |
| 1190 | len = ulen; | 1190 | if (copied > ulen) |
| 1191 | else if (len < ulen) | 1191 | copied = ulen; |
| 1192 | else if (copied < ulen) | ||
| 1192 | msg->msg_flags |= MSG_TRUNC; | 1193 | msg->msg_flags |= MSG_TRUNC; |
| 1193 | 1194 | ||
| 1194 | /* | 1195 | /* |
| @@ -1197,14 +1198,14 @@ try_again: | |||
| 1197 | * coverage checksum (UDP-Lite), do it before the copy. | 1198 | * coverage checksum (UDP-Lite), do it before the copy. |
| 1198 | */ | 1199 | */ |
| 1199 | 1200 | ||
| 1200 | if (len < ulen || UDP_SKB_CB(skb)->partial_cov) { | 1201 | if (copied < ulen || UDP_SKB_CB(skb)->partial_cov) { |
| 1201 | if (udp_lib_checksum_complete(skb)) | 1202 | if (udp_lib_checksum_complete(skb)) |
| 1202 | goto csum_copy_err; | 1203 | goto csum_copy_err; |
| 1203 | } | 1204 | } |
| 1204 | 1205 | ||
| 1205 | if (skb_csum_unnecessary(skb)) | 1206 | if (skb_csum_unnecessary(skb)) |
| 1206 | err = skb_copy_datagram_iovec(skb, sizeof(struct udphdr), | 1207 | err = skb_copy_datagram_iovec(skb, sizeof(struct udphdr), |
| 1207 | msg->msg_iov, len); | 1208 | msg->msg_iov, copied); |
| 1208 | else { | 1209 | else { |
| 1209 | err = skb_copy_and_csum_datagram_iovec(skb, | 1210 | err = skb_copy_and_csum_datagram_iovec(skb, |
| 1210 | sizeof(struct udphdr), | 1211 | sizeof(struct udphdr), |
| @@ -1233,7 +1234,7 @@ try_again: | |||
| 1233 | if (inet->cmsg_flags) | 1234 | if (inet->cmsg_flags) |
| 1234 | ip_cmsg_recv(msg, skb); | 1235 | ip_cmsg_recv(msg, skb); |
| 1235 | 1236 | ||
| 1236 | err = len; | 1237 | err = copied; |
| 1237 | if (flags & MSG_TRUNC) | 1238 | if (flags & MSG_TRUNC) |
| 1238 | err = ulen; | 1239 | err = ulen; |
| 1239 | 1240 | ||
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c index fee46d5a2f12..1567fb120392 100644 --- a/net/ipv6/inet6_connection_sock.c +++ b/net/ipv6/inet6_connection_sock.c | |||
| @@ -85,7 +85,7 @@ struct dst_entry *inet6_csk_route_req(struct sock *sk, | |||
| 85 | * request_sock (formerly open request) hash tables. | 85 | * request_sock (formerly open request) hash tables. |
| 86 | */ | 86 | */ |
| 87 | static u32 inet6_synq_hash(const struct in6_addr *raddr, const __be16 rport, | 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 | u32 c; | 90 | u32 c; |
| 91 | 91 | ||
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index c99e3ee9781f..26cb08c84b74 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c | |||
| @@ -503,7 +503,7 @@ done: | |||
| 503 | goto e_inval; | 503 | goto e_inval; |
| 504 | if (val > 255 || val < -1) | 504 | if (val > 255 || val < -1) |
| 505 | goto e_inval; | 505 | goto e_inval; |
| 506 | np->mcast_hops = val; | 506 | np->mcast_hops = (val == -1 ? IPV6_DEFAULT_MCASTHOPS : val); |
| 507 | retv = 0; | 507 | retv = 0; |
| 508 | break; | 508 | break; |
| 509 | 509 | ||
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 44e5b7f2a6c1..0cb78d7ddaf5 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
| @@ -1571,7 +1571,7 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh, | |||
| 1571 | } | 1571 | } |
| 1572 | if (!rt->rt6i_peer) | 1572 | if (!rt->rt6i_peer) |
| 1573 | rt6_bind_peer(rt, 1); | 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 | goto release; | 1575 | goto release; |
| 1576 | 1576 | ||
| 1577 | if (dev->addr_len) { | 1577 | if (dev->addr_len) { |
diff --git a/net/ipv6/netfilter/Kconfig b/net/ipv6/netfilter/Kconfig index 448464844a25..f792b34cbe9c 100644 --- a/net/ipv6/netfilter/Kconfig +++ b/net/ipv6/netfilter/Kconfig | |||
| @@ -186,7 +186,6 @@ config IP6_NF_MANGLE | |||
| 186 | 186 | ||
| 187 | config IP6_NF_RAW | 187 | config IP6_NF_RAW |
| 188 | tristate 'raw table support (required for TRACE)' | 188 | tristate 'raw table support (required for TRACE)' |
| 189 | depends on NETFILTER_ADVANCED | ||
| 190 | help | 189 | help |
| 191 | This option adds a `raw' table to ip6tables. This table is the very | 190 | This option adds a `raw' table to ip6tables. This table is the very |
| 192 | first in the netfilter framework and hooks in at the PREROUTING | 191 | first in the netfilter framework and hooks in at the PREROUTING |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 8473016bba4a..3399dd326287 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
| @@ -77,7 +77,7 @@ static struct rt6_info *ip6_rt_copy(const struct rt6_info *ort, | |||
| 77 | const struct in6_addr *dest); | 77 | const struct in6_addr *dest); |
| 78 | static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie); | 78 | static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie); |
| 79 | static unsigned int ip6_default_advmss(const struct dst_entry *dst); | 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 | static struct dst_entry *ip6_negative_advice(struct dst_entry *); | 81 | static struct dst_entry *ip6_negative_advice(struct dst_entry *); |
| 82 | static void ip6_dst_destroy(struct dst_entry *); | 82 | static void ip6_dst_destroy(struct dst_entry *); |
| 83 | static void ip6_dst_ifdown(struct dst_entry *, | 83 | static void ip6_dst_ifdown(struct dst_entry *, |
| @@ -144,7 +144,7 @@ static struct dst_ops ip6_dst_ops_template = { | |||
| 144 | .gc_thresh = 1024, | 144 | .gc_thresh = 1024, |
| 145 | .check = ip6_dst_check, | 145 | .check = ip6_dst_check, |
| 146 | .default_advmss = ip6_default_advmss, | 146 | .default_advmss = ip6_default_advmss, |
| 147 | .default_mtu = ip6_default_mtu, | 147 | .mtu = ip6_mtu, |
| 148 | .cow_metrics = ipv6_cow_metrics, | 148 | .cow_metrics = ipv6_cow_metrics, |
| 149 | .destroy = ip6_dst_destroy, | 149 | .destroy = ip6_dst_destroy, |
| 150 | .ifdown = ip6_dst_ifdown, | 150 | .ifdown = ip6_dst_ifdown, |
| @@ -155,9 +155,11 @@ static struct dst_ops ip6_dst_ops_template = { | |||
| 155 | .neigh_lookup = ip6_neigh_lookup, | 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 | static void ip6_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu) | 165 | static void ip6_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu) |
| @@ -175,7 +177,7 @@ static struct dst_ops ip6_dst_blackhole_ops = { | |||
| 175 | .protocol = cpu_to_be16(ETH_P_IPV6), | 177 | .protocol = cpu_to_be16(ETH_P_IPV6), |
| 176 | .destroy = ip6_dst_destroy, | 178 | .destroy = ip6_dst_destroy, |
| 177 | .check = ip6_dst_check, | 179 | .check = ip6_dst_check, |
| 178 | .default_mtu = ip6_blackhole_default_mtu, | 180 | .mtu = ip6_blackhole_mtu, |
| 179 | .default_advmss = ip6_default_advmss, | 181 | .default_advmss = ip6_default_advmss, |
| 180 | .update_pmtu = ip6_rt_blackhole_update_pmtu, | 182 | .update_pmtu = ip6_rt_blackhole_update_pmtu, |
| 181 | .cow_metrics = ip6_rt_blackhole_cow_metrics, | 183 | .cow_metrics = ip6_rt_blackhole_cow_metrics, |
| @@ -1041,10 +1043,15 @@ static unsigned int ip6_default_advmss(const struct dst_entry *dst) | |||
| 1041 | return mtu; | 1043 | return mtu; |
| 1042 | } | 1044 | } |
| 1043 | 1045 | ||
| 1044 | static unsigned int ip6_default_mtu(const struct dst_entry *dst) | 1046 | static unsigned int ip6_mtu(const struct dst_entry *dst) |
| 1045 | { | 1047 | { |
| 1046 | unsigned int mtu = IPV6_MIN_MTU; | ||
| 1047 | struct inet6_dev *idev; | 1048 | struct inet6_dev *idev; |
| 1049 | unsigned int mtu = dst_metric_raw(dst, RTAX_MTU); | ||
| 1050 | |||
| 1051 | if (mtu) | ||
| 1052 | return mtu; | ||
| 1053 | |||
| 1054 | mtu = IPV6_MIN_MTU; | ||
| 1048 | 1055 | ||
| 1049 | rcu_read_lock(); | 1056 | rcu_read_lock(); |
| 1050 | idev = __in6_dev_get(dst->dev); | 1057 | idev = __in6_dev_get(dst->dev); |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 36131d122a6f..2dea4bb7b54a 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
| @@ -1255,6 +1255,13 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) | |||
| 1255 | if (!want_cookie || tmp_opt.tstamp_ok) | 1255 | if (!want_cookie || tmp_opt.tstamp_ok) |
| 1256 | TCP_ECN_create_request(req, tcp_hdr(skb)); | 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 | if (!isn) { | 1265 | if (!isn) { |
| 1259 | struct inet_peer *peer = NULL; | 1266 | struct inet_peer *peer = NULL; |
| 1260 | 1267 | ||
| @@ -1264,12 +1271,6 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) | |||
| 1264 | atomic_inc(&skb->users); | 1271 | atomic_inc(&skb->users); |
| 1265 | treq->pktopts = skb; | 1272 | treq->pktopts = skb; |
| 1266 | } | 1273 | } |
| 1267 | treq->iif = sk->sk_bound_dev_if; | ||
| 1268 | |||
| 1269 | /* So that link locals have meaning */ | ||
| 1270 | if (!sk->sk_bound_dev_if && | ||
| 1271 | ipv6_addr_type(&treq->rmt_addr) & IPV6_ADDR_LINKLOCAL) | ||
| 1272 | treq->iif = inet6_iif(skb); | ||
| 1273 | 1274 | ||
| 1274 | if (want_cookie) { | 1275 | if (want_cookie) { |
| 1275 | isn = cookie_v6_init_sequence(sk, skb, &req->mss); | 1276 | isn = cookie_v6_init_sequence(sk, skb, &req->mss); |
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 846f4757eb8d..8c2541915183 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
| @@ -340,7 +340,7 @@ int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk, | |||
| 340 | struct ipv6_pinfo *np = inet6_sk(sk); | 340 | struct ipv6_pinfo *np = inet6_sk(sk); |
| 341 | struct inet_sock *inet = inet_sk(sk); | 341 | struct inet_sock *inet = inet_sk(sk); |
| 342 | struct sk_buff *skb; | 342 | struct sk_buff *skb; |
| 343 | unsigned int ulen; | 343 | unsigned int ulen, copied; |
| 344 | int peeked; | 344 | int peeked; |
| 345 | int err; | 345 | int err; |
| 346 | int is_udplite = IS_UDPLITE(sk); | 346 | int is_udplite = IS_UDPLITE(sk); |
| @@ -363,9 +363,10 @@ try_again: | |||
| 363 | goto out; | 363 | goto out; |
| 364 | 364 | ||
| 365 | ulen = skb->len - sizeof(struct udphdr); | 365 | ulen = skb->len - sizeof(struct udphdr); |
| 366 | if (len > ulen) | 366 | copied = len; |
| 367 | len = ulen; | 367 | if (copied > ulen) |
| 368 | else if (len < ulen) | 368 | copied = ulen; |
| 369 | else if (copied < ulen) | ||
| 369 | msg->msg_flags |= MSG_TRUNC; | 370 | msg->msg_flags |= MSG_TRUNC; |
| 370 | 371 | ||
| 371 | is_udp4 = (skb->protocol == htons(ETH_P_IP)); | 372 | is_udp4 = (skb->protocol == htons(ETH_P_IP)); |
| @@ -376,14 +377,14 @@ try_again: | |||
| 376 | * coverage checksum (UDP-Lite), do it before the copy. | 377 | * coverage checksum (UDP-Lite), do it before the copy. |
| 377 | */ | 378 | */ |
| 378 | 379 | ||
| 379 | if (len < ulen || UDP_SKB_CB(skb)->partial_cov) { | 380 | if (copied < ulen || UDP_SKB_CB(skb)->partial_cov) { |
| 380 | if (udp_lib_checksum_complete(skb)) | 381 | if (udp_lib_checksum_complete(skb)) |
| 381 | goto csum_copy_err; | 382 | goto csum_copy_err; |
| 382 | } | 383 | } |
| 383 | 384 | ||
| 384 | if (skb_csum_unnecessary(skb)) | 385 | if (skb_csum_unnecessary(skb)) |
| 385 | err = skb_copy_datagram_iovec(skb, sizeof(struct udphdr), | 386 | err = skb_copy_datagram_iovec(skb, sizeof(struct udphdr), |
| 386 | msg->msg_iov,len); | 387 | msg->msg_iov, copied ); |
| 387 | else { | 388 | else { |
| 388 | err = skb_copy_and_csum_datagram_iovec(skb, sizeof(struct udphdr), msg->msg_iov); | 389 | err = skb_copy_and_csum_datagram_iovec(skb, sizeof(struct udphdr), msg->msg_iov); |
| 389 | if (err == -EINVAL) | 390 | if (err == -EINVAL) |
| @@ -432,7 +433,7 @@ try_again: | |||
| 432 | datagram_recv_ctl(sk, msg, skb); | 433 | datagram_recv_ctl(sk, msg, skb); |
| 433 | } | 434 | } |
| 434 | 435 | ||
| 435 | err = len; | 436 | err = copied; |
| 436 | if (flags & MSG_TRUNC) | 437 | if (flags & MSG_TRUNC) |
| 437 | err = ulen; | 438 | err = ulen; |
| 438 | 439 | ||
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c index cf0f308abf5e..89ff8c67943e 100644 --- a/net/l2tp/l2tp_core.c +++ b/net/l2tp/l2tp_core.c | |||
| @@ -1072,7 +1072,7 @@ int l2tp_xmit_skb(struct l2tp_session *session, struct sk_buff *skb, int hdr_len | |||
| 1072 | 1072 | ||
| 1073 | /* Get routing info from the tunnel socket */ | 1073 | /* Get routing info from the tunnel socket */ |
| 1074 | skb_dst_drop(skb); | 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 | inet = inet_sk(sk); | 1077 | inet = inet_sk(sk); |
| 1078 | fl = &inet->cork.fl; | 1078 | fl = &inet->cork.fl; |
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c index b3f65520e7a7..b064e4df12c6 100644 --- a/net/mac80211/agg-tx.c +++ b/net/mac80211/agg-tx.c | |||
| @@ -161,6 +161,12 @@ int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, | |||
| 161 | return -ENOENT; | 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 | if (test_bit(HT_AGG_STATE_WANT_START, &tid_tx->state)) { | 170 | if (test_bit(HT_AGG_STATE_WANT_START, &tid_tx->state)) { |
| 165 | /* not even started yet! */ | 171 | /* not even started yet! */ |
| 166 | ieee80211_assign_tid_tx(sta, tid, NULL); | 172 | ieee80211_assign_tid_tx(sta, tid, NULL); |
| @@ -169,6 +175,8 @@ int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, | |||
| 169 | return 0; | 175 | return 0; |
| 170 | } | 176 | } |
| 171 | 177 | ||
| 178 | set_bit(HT_AGG_STATE_STOPPING, &tid_tx->state); | ||
| 179 | |||
| 172 | spin_unlock_bh(&sta->lock); | 180 | spin_unlock_bh(&sta->lock); |
| 173 | 181 | ||
| 174 | #ifdef CONFIG_MAC80211_HT_DEBUG | 182 | #ifdef CONFIG_MAC80211_HT_DEBUG |
| @@ -176,8 +184,6 @@ int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, | |||
| 176 | sta->sta.addr, tid); | 184 | sta->sta.addr, tid); |
| 177 | #endif /* CONFIG_MAC80211_HT_DEBUG */ | 185 | #endif /* CONFIG_MAC80211_HT_DEBUG */ |
| 178 | 186 | ||
| 179 | set_bit(HT_AGG_STATE_STOPPING, &tid_tx->state); | ||
| 180 | |||
| 181 | del_timer_sync(&tid_tx->addba_resp_timer); | 187 | del_timer_sync(&tid_tx->addba_resp_timer); |
| 182 | 188 | ||
| 183 | /* | 189 | /* |
| @@ -187,6 +193,20 @@ int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, | |||
| 187 | */ | 193 | */ |
| 188 | clear_bit(HT_AGG_STATE_OPERATIONAL, &tid_tx->state); | 194 | clear_bit(HT_AGG_STATE_OPERATIONAL, &tid_tx->state); |
| 189 | 195 | ||
| 196 | /* | ||
| 197 | * There might be a few packets being processed right now (on | ||
| 198 | * another CPU) that have already gotten past the aggregation | ||
| 199 | * check when it was still OPERATIONAL and consequently have | ||
| 200 | * IEEE80211_TX_CTL_AMPDU set. In that case, this code might | ||
| 201 | * call into the driver at the same time or even before the | ||
| 202 | * TX paths calls into it, which could confuse the driver. | ||
| 203 | * | ||
| 204 | * Wait for all currently running TX paths to finish before | ||
| 205 | * telling the driver. New packets will not go through since | ||
| 206 | * the aggregation session is no longer OPERATIONAL. | ||
| 207 | */ | ||
| 208 | synchronize_net(); | ||
| 209 | |||
| 190 | tid_tx->stop_initiator = initiator; | 210 | tid_tx->stop_initiator = initiator; |
| 191 | tid_tx->tx_stop = tx; | 211 | tid_tx->tx_stop = tx; |
| 192 | 212 | ||
| @@ -757,11 +777,27 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local, | |||
| 757 | goto out; | 777 | goto out; |
| 758 | } | 778 | } |
| 759 | 779 | ||
| 760 | del_timer(&tid_tx->addba_resp_timer); | 780 | del_timer_sync(&tid_tx->addba_resp_timer); |
| 761 | 781 | ||
| 762 | #ifdef CONFIG_MAC80211_HT_DEBUG | 782 | #ifdef CONFIG_MAC80211_HT_DEBUG |
| 763 | printk(KERN_DEBUG "switched off addBA timer for tid %d\n", tid); | 783 | printk(KERN_DEBUG "switched off addBA timer for tid %d\n", tid); |
| 764 | #endif | 784 | #endif |
| 785 | |||
| 786 | /* | ||
| 787 | * addba_resp_timer may have fired before we got here, and | ||
| 788 | * caused WANT_STOP to be set. If the stop then was already | ||
| 789 | * processed further, STOPPING might be set. | ||
| 790 | */ | ||
| 791 | if (test_bit(HT_AGG_STATE_WANT_STOP, &tid_tx->state) || | ||
| 792 | test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) { | ||
| 793 | #ifdef CONFIG_MAC80211_HT_DEBUG | ||
| 794 | printk(KERN_DEBUG | ||
| 795 | "got addBA resp for tid %d but we already gave up\n", | ||
| 796 | tid); | ||
| 797 | #endif | ||
| 798 | goto out; | ||
| 799 | } | ||
| 800 | |||
| 765 | /* | 801 | /* |
| 766 | * IEEE 802.11-2007 7.3.1.14: | 802 | * IEEE 802.11-2007 7.3.1.14: |
| 767 | * In an ADDBA Response frame, when the Status Code field | 803 | * In an ADDBA Response frame, when the Status Code field |
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c index c5f341798c16..3110cbdc501b 100644 --- a/net/mac80211/debugfs_sta.c +++ b/net/mac80211/debugfs_sta.c | |||
| @@ -274,9 +274,9 @@ static ssize_t sta_ht_capa_read(struct file *file, char __user *userbuf, | |||
| 274 | 274 | ||
| 275 | PRINT_HT_CAP((htc->cap & BIT(10)), "HT Delayed Block Ack"); | 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 | PRINT_HT_CAP(!(htc->cap & BIT(11)), "Max AMSDU length: " | 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 | "7935 bytes"); | 280 | "7935 bytes"); |
| 281 | 281 | ||
| 282 | /* | 282 | /* |
diff --git a/net/mac80211/status.c b/net/mac80211/status.c index 80de436eae20..16518f386117 100644 --- a/net/mac80211/status.c +++ b/net/mac80211/status.c | |||
| @@ -260,7 +260,7 @@ static void ieee80211_add_tx_radiotap_header(struct ieee80211_supported_band | |||
| 260 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; | 260 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; |
| 261 | struct ieee80211_radiotap_header *rthdr; | 261 | struct ieee80211_radiotap_header *rthdr; |
| 262 | unsigned char *pos; | 262 | unsigned char *pos; |
| 263 | __le16 txflags; | 263 | u16 txflags; |
| 264 | 264 | ||
| 265 | rthdr = (struct ieee80211_radiotap_header *) skb_push(skb, rtap_len); | 265 | rthdr = (struct ieee80211_radiotap_header *) skb_push(skb, rtap_len); |
| 266 | 266 | ||
| @@ -290,13 +290,13 @@ static void ieee80211_add_tx_radiotap_header(struct ieee80211_supported_band | |||
| 290 | txflags = 0; | 290 | txflags = 0; |
| 291 | if (!(info->flags & IEEE80211_TX_STAT_ACK) && | 291 | if (!(info->flags & IEEE80211_TX_STAT_ACK) && |
| 292 | !is_multicast_ether_addr(hdr->addr1)) | 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 | if ((info->status.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS) || | 295 | if ((info->status.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS) || |
| 296 | (info->status.rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT)) | 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 | else if (info->status.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS) | 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 | put_unaligned_le16(txflags, pos); | 301 | put_unaligned_le16(txflags, pos); |
| 302 | pos += 2; | 302 | pos += 2; |
diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig index 8260b13d93c9..d5597b759ba3 100644 --- a/net/netfilter/Kconfig +++ b/net/netfilter/Kconfig | |||
| @@ -201,7 +201,6 @@ config NF_CONNTRACK_BROADCAST | |||
| 201 | 201 | ||
| 202 | config NF_CONNTRACK_NETBIOS_NS | 202 | config NF_CONNTRACK_NETBIOS_NS |
| 203 | tristate "NetBIOS name service protocol support" | 203 | tristate "NetBIOS name service protocol support" |
| 204 | depends on NETFILTER_ADVANCED | ||
| 205 | select NF_CONNTRACK_BROADCAST | 204 | select NF_CONNTRACK_BROADCAST |
| 206 | help | 205 | help |
| 207 | NetBIOS name service requests are sent as broadcast messages from an | 206 | NetBIOS name service requests are sent as broadcast messages from an |
| @@ -542,7 +541,6 @@ config NETFILTER_XT_TARGET_NOTRACK | |||
| 542 | tristate '"NOTRACK" target support' | 541 | tristate '"NOTRACK" target support' |
| 543 | depends on IP_NF_RAW || IP6_NF_RAW | 542 | depends on IP_NF_RAW || IP6_NF_RAW |
| 544 | depends on NF_CONNTRACK | 543 | depends on NF_CONNTRACK |
| 545 | depends on NETFILTER_ADVANCED | ||
| 546 | help | 544 | help |
| 547 | The NOTRACK target allows a select rule to specify | 545 | The NOTRACK target allows a select rule to specify |
| 548 | which packets *not* to enter the conntrack/NAT | 546 | which packets *not* to enter the conntrack/NAT |
diff --git a/net/netfilter/ipset/ip_set_hash_ipport.c b/net/netfilter/ipset/ip_set_hash_ipport.c index 6ee10f5d59bd..37d667e3f6f8 100644 --- a/net/netfilter/ipset/ip_set_hash_ipport.c +++ b/net/netfilter/ipset/ip_set_hash_ipport.c | |||
| @@ -158,7 +158,7 @@ hash_ipport4_uadt(struct ip_set *set, struct nlattr *tb[], | |||
| 158 | const struct ip_set_hash *h = set->data; | 158 | const struct ip_set_hash *h = set->data; |
| 159 | ipset_adtfn adtfn = set->variant->adt[adt]; | 159 | ipset_adtfn adtfn = set->variant->adt[adt]; |
| 160 | struct hash_ipport4_elem data = { }; | 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 | u32 timeout = h->timeout; | 162 | u32 timeout = h->timeout; |
| 163 | bool with_ports = false; | 163 | bool with_ports = false; |
| 164 | int ret; | 164 | int ret; |
diff --git a/net/netfilter/ipset/ip_set_hash_ipportip.c b/net/netfilter/ipset/ip_set_hash_ipportip.c index fb90e344e907..e69e2718fbe1 100644 --- a/net/netfilter/ipset/ip_set_hash_ipportip.c +++ b/net/netfilter/ipset/ip_set_hash_ipportip.c | |||
| @@ -162,7 +162,7 @@ hash_ipportip4_uadt(struct ip_set *set, struct nlattr *tb[], | |||
| 162 | const struct ip_set_hash *h = set->data; | 162 | const struct ip_set_hash *h = set->data; |
| 163 | ipset_adtfn adtfn = set->variant->adt[adt]; | 163 | ipset_adtfn adtfn = set->variant->adt[adt]; |
| 164 | struct hash_ipportip4_elem data = { }; | 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 | u32 timeout = h->timeout; | 166 | u32 timeout = h->timeout; |
| 167 | bool with_ports = false; | 167 | bool with_ports = false; |
| 168 | int ret; | 168 | int ret; |
diff --git a/net/netfilter/ipset/ip_set_hash_ipportnet.c b/net/netfilter/ipset/ip_set_hash_ipportnet.c index deb3e3dfa5fc..64199b4e93c9 100644 --- a/net/netfilter/ipset/ip_set_hash_ipportnet.c +++ b/net/netfilter/ipset/ip_set_hash_ipportnet.c | |||
| @@ -184,7 +184,7 @@ hash_ipportnet4_uadt(struct ip_set *set, struct nlattr *tb[], | |||
| 184 | const struct ip_set_hash *h = set->data; | 184 | const struct ip_set_hash *h = set->data; |
| 185 | ipset_adtfn adtfn = set->variant->adt[adt]; | 185 | ipset_adtfn adtfn = set->variant->adt[adt]; |
| 186 | struct hash_ipportnet4_elem data = { .cidr = HOST_MASK }; | 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 | u32 ip2_from = 0, ip2_to, ip2_last, ip2; | 188 | u32 ip2_from = 0, ip2_to, ip2_last, ip2; |
| 189 | u32 timeout = h->timeout; | 189 | u32 timeout = h->timeout; |
| 190 | bool with_ports = false; | 190 | bool with_ports = false; |
diff --git a/net/netfilter/nf_conntrack_ecache.c b/net/netfilter/nf_conntrack_ecache.c index 6b368be937c6..b62c4148b921 100644 --- a/net/netfilter/nf_conntrack_ecache.c +++ b/net/netfilter/nf_conntrack_ecache.c | |||
| @@ -27,22 +27,17 @@ | |||
| 27 | 27 | ||
| 28 | static DEFINE_MUTEX(nf_ct_ecache_mutex); | 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 | /* deliver cached events and clear cache entry - must be called with locally | 30 | /* deliver cached events and clear cache entry - must be called with locally |
| 37 | * disabled softirqs */ | 31 | * disabled softirqs */ |
| 38 | void nf_ct_deliver_cached_events(struct nf_conn *ct) | 32 | void nf_ct_deliver_cached_events(struct nf_conn *ct) |
| 39 | { | 33 | { |
| 34 | struct net *net = nf_ct_net(ct); | ||
| 40 | unsigned long events; | 35 | unsigned long events; |
| 41 | struct nf_ct_event_notifier *notify; | 36 | struct nf_ct_event_notifier *notify; |
| 42 | struct nf_conntrack_ecache *e; | 37 | struct nf_conntrack_ecache *e; |
| 43 | 38 | ||
| 44 | rcu_read_lock(); | 39 | rcu_read_lock(); |
| 45 | notify = rcu_dereference(nf_conntrack_event_cb); | 40 | notify = rcu_dereference(net->ct.nf_conntrack_event_cb); |
| 46 | if (notify == NULL) | 41 | if (notify == NULL) |
| 47 | goto out_unlock; | 42 | goto out_unlock; |
| 48 | 43 | ||
| @@ -83,19 +78,20 @@ out_unlock: | |||
| 83 | } | 78 | } |
| 84 | EXPORT_SYMBOL_GPL(nf_ct_deliver_cached_events); | 79 | EXPORT_SYMBOL_GPL(nf_ct_deliver_cached_events); |
| 85 | 80 | ||
| 86 | int nf_conntrack_register_notifier(struct nf_ct_event_notifier *new) | 81 | int nf_conntrack_register_notifier(struct net *net, |
| 82 | struct nf_ct_event_notifier *new) | ||
| 87 | { | 83 | { |
| 88 | int ret = 0; | 84 | int ret = 0; |
| 89 | struct nf_ct_event_notifier *notify; | 85 | struct nf_ct_event_notifier *notify; |
| 90 | 86 | ||
| 91 | mutex_lock(&nf_ct_ecache_mutex); | 87 | mutex_lock(&nf_ct_ecache_mutex); |
| 92 | notify = rcu_dereference_protected(nf_conntrack_event_cb, | 88 | notify = rcu_dereference_protected(net->ct.nf_conntrack_event_cb, |
| 93 | lockdep_is_held(&nf_ct_ecache_mutex)); | 89 | lockdep_is_held(&nf_ct_ecache_mutex)); |
| 94 | if (notify != NULL) { | 90 | if (notify != NULL) { |
| 95 | ret = -EBUSY; | 91 | ret = -EBUSY; |
| 96 | goto out_unlock; | 92 | goto out_unlock; |
| 97 | } | 93 | } |
| 98 | RCU_INIT_POINTER(nf_conntrack_event_cb, new); | 94 | RCU_INIT_POINTER(net->ct.nf_conntrack_event_cb, new); |
| 99 | mutex_unlock(&nf_ct_ecache_mutex); | 95 | mutex_unlock(&nf_ct_ecache_mutex); |
| 100 | return ret; | 96 | return ret; |
| 101 | 97 | ||
| @@ -105,32 +101,34 @@ out_unlock: | |||
| 105 | } | 101 | } |
| 106 | EXPORT_SYMBOL_GPL(nf_conntrack_register_notifier); | 102 | EXPORT_SYMBOL_GPL(nf_conntrack_register_notifier); |
| 107 | 103 | ||
| 108 | void nf_conntrack_unregister_notifier(struct nf_ct_event_notifier *new) | 104 | void nf_conntrack_unregister_notifier(struct net *net, |
| 105 | struct nf_ct_event_notifier *new) | ||
| 109 | { | 106 | { |
| 110 | struct nf_ct_event_notifier *notify; | 107 | struct nf_ct_event_notifier *notify; |
| 111 | 108 | ||
| 112 | mutex_lock(&nf_ct_ecache_mutex); | 109 | mutex_lock(&nf_ct_ecache_mutex); |
| 113 | notify = rcu_dereference_protected(nf_conntrack_event_cb, | 110 | notify = rcu_dereference_protected(net->ct.nf_conntrack_event_cb, |
| 114 | lockdep_is_held(&nf_ct_ecache_mutex)); | 111 | lockdep_is_held(&nf_ct_ecache_mutex)); |
| 115 | BUG_ON(notify != new); | 112 | BUG_ON(notify != new); |
| 116 | RCU_INIT_POINTER(nf_conntrack_event_cb, NULL); | 113 | RCU_INIT_POINTER(net->ct.nf_conntrack_event_cb, NULL); |
| 117 | mutex_unlock(&nf_ct_ecache_mutex); | 114 | mutex_unlock(&nf_ct_ecache_mutex); |
| 118 | } | 115 | } |
| 119 | EXPORT_SYMBOL_GPL(nf_conntrack_unregister_notifier); | 116 | EXPORT_SYMBOL_GPL(nf_conntrack_unregister_notifier); |
| 120 | 117 | ||
| 121 | int nf_ct_expect_register_notifier(struct nf_exp_event_notifier *new) | 118 | int nf_ct_expect_register_notifier(struct net *net, |
| 119 | struct nf_exp_event_notifier *new) | ||
| 122 | { | 120 | { |
| 123 | int ret = 0; | 121 | int ret = 0; |
| 124 | struct nf_exp_event_notifier *notify; | 122 | struct nf_exp_event_notifier *notify; |
| 125 | 123 | ||
| 126 | mutex_lock(&nf_ct_ecache_mutex); | 124 | mutex_lock(&nf_ct_ecache_mutex); |
| 127 | notify = rcu_dereference_protected(nf_expect_event_cb, | 125 | notify = rcu_dereference_protected(net->ct.nf_expect_event_cb, |
| 128 | lockdep_is_held(&nf_ct_ecache_mutex)); | 126 | lockdep_is_held(&nf_ct_ecache_mutex)); |
| 129 | if (notify != NULL) { | 127 | if (notify != NULL) { |
| 130 | ret = -EBUSY; | 128 | ret = -EBUSY; |
| 131 | goto out_unlock; | 129 | goto out_unlock; |
| 132 | } | 130 | } |
| 133 | RCU_INIT_POINTER(nf_expect_event_cb, new); | 131 | RCU_INIT_POINTER(net->ct.nf_expect_event_cb, new); |
| 134 | mutex_unlock(&nf_ct_ecache_mutex); | 132 | mutex_unlock(&nf_ct_ecache_mutex); |
| 135 | return ret; | 133 | return ret; |
| 136 | 134 | ||
| @@ -140,15 +138,16 @@ out_unlock: | |||
| 140 | } | 138 | } |
| 141 | EXPORT_SYMBOL_GPL(nf_ct_expect_register_notifier); | 139 | EXPORT_SYMBOL_GPL(nf_ct_expect_register_notifier); |
| 142 | 140 | ||
| 143 | void nf_ct_expect_unregister_notifier(struct nf_exp_event_notifier *new) | 141 | void nf_ct_expect_unregister_notifier(struct net *net, |
| 142 | struct nf_exp_event_notifier *new) | ||
| 144 | { | 143 | { |
| 145 | struct nf_exp_event_notifier *notify; | 144 | struct nf_exp_event_notifier *notify; |
| 146 | 145 | ||
| 147 | mutex_lock(&nf_ct_ecache_mutex); | 146 | mutex_lock(&nf_ct_ecache_mutex); |
| 148 | notify = rcu_dereference_protected(nf_expect_event_cb, | 147 | notify = rcu_dereference_protected(net->ct.nf_expect_event_cb, |
| 149 | lockdep_is_held(&nf_ct_ecache_mutex)); | 148 | lockdep_is_held(&nf_ct_ecache_mutex)); |
| 150 | BUG_ON(notify != new); | 149 | BUG_ON(notify != new); |
| 151 | RCU_INIT_POINTER(nf_expect_event_cb, NULL); | 150 | RCU_INIT_POINTER(net->ct.nf_expect_event_cb, NULL); |
| 152 | mutex_unlock(&nf_ct_ecache_mutex); | 151 | mutex_unlock(&nf_ct_ecache_mutex); |
| 153 | } | 152 | } |
| 154 | EXPORT_SYMBOL_GPL(nf_ct_expect_unregister_notifier); | 153 | EXPORT_SYMBOL_GPL(nf_ct_expect_unregister_notifier); |
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index e58aa9b1fe8a..ef21b221f036 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | * (C) 2001 by Jay Schulist <jschlst@samba.org> | 4 | * (C) 2001 by Jay Schulist <jschlst@samba.org> |
| 5 | * (C) 2002-2006 by Harald Welte <laforge@gnumonks.org> | 5 | * (C) 2002-2006 by Harald Welte <laforge@gnumonks.org> |
| 6 | * (C) 2003 by Patrick Mchardy <kaber@trash.net> | 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 | * Initial connection tracking via netlink development funded and | 9 | * Initial connection tracking via netlink development funded and |
| 10 | * generally made possible by Network Robots, Inc. (www.networkrobots.com) | 10 | * generally made possible by Network Robots, Inc. (www.networkrobots.com) |
| @@ -2163,6 +2163,54 @@ MODULE_ALIAS("ip_conntrack_netlink"); | |||
| 2163 | MODULE_ALIAS_NFNL_SUBSYS(NFNL_SUBSYS_CTNETLINK); | 2163 | MODULE_ALIAS_NFNL_SUBSYS(NFNL_SUBSYS_CTNETLINK); |
| 2164 | MODULE_ALIAS_NFNL_SUBSYS(NFNL_SUBSYS_CTNETLINK_EXP); | 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 | static int __init ctnetlink_init(void) | 2214 | static int __init ctnetlink_init(void) |
| 2167 | { | 2215 | { |
| 2168 | int ret; | 2216 | int ret; |
| @@ -2180,28 +2228,15 @@ static int __init ctnetlink_init(void) | |||
| 2180 | goto err_unreg_subsys; | 2228 | goto err_unreg_subsys; |
| 2181 | } | 2229 | } |
| 2182 | 2230 | ||
| 2183 | #ifdef CONFIG_NF_CONNTRACK_EVENTS | 2231 | if (register_pernet_subsys(&ctnetlink_net_ops)) { |
| 2184 | ret = nf_conntrack_register_notifier(&ctnl_notifier); | 2232 | pr_err("ctnetlink_init: cannot register pernet operations\n"); |
| 2185 | if (ret < 0) { | ||
| 2186 | pr_err("ctnetlink_init: cannot register notifier.\n"); | ||
| 2187 | goto err_unreg_exp_subsys; | 2233 | goto err_unreg_exp_subsys; |
| 2188 | } | 2234 | } |
| 2189 | 2235 | ||
| 2190 | ret = nf_ct_expect_register_notifier(&ctnl_notifier_exp); | ||
| 2191 | if (ret < 0) { | ||
| 2192 | pr_err("ctnetlink_init: cannot expect register notifier.\n"); | ||
| 2193 | goto err_unreg_notifier; | ||
| 2194 | } | ||
| 2195 | #endif | ||
| 2196 | |||
| 2197 | return 0; | 2236 | return 0; |
| 2198 | 2237 | ||
| 2199 | #ifdef CONFIG_NF_CONNTRACK_EVENTS | ||
| 2200 | err_unreg_notifier: | ||
| 2201 | nf_conntrack_unregister_notifier(&ctnl_notifier); | ||
| 2202 | err_unreg_exp_subsys: | 2238 | err_unreg_exp_subsys: |
| 2203 | nfnetlink_subsys_unregister(&ctnl_exp_subsys); | 2239 | nfnetlink_subsys_unregister(&ctnl_exp_subsys); |
| 2204 | #endif | ||
| 2205 | err_unreg_subsys: | 2240 | err_unreg_subsys: |
| 2206 | nfnetlink_subsys_unregister(&ctnl_subsys); | 2241 | nfnetlink_subsys_unregister(&ctnl_subsys); |
| 2207 | err_out: | 2242 | err_out: |
| @@ -2213,11 +2248,7 @@ static void __exit ctnetlink_exit(void) | |||
| 2213 | pr_info("ctnetlink: unregistering from nfnetlink.\n"); | 2248 | pr_info("ctnetlink: unregistering from nfnetlink.\n"); |
| 2214 | 2249 | ||
| 2215 | nf_ct_remove_userspace_expectations(); | 2250 | nf_ct_remove_userspace_expectations(); |
| 2216 | #ifdef CONFIG_NF_CONNTRACK_EVENTS | 2251 | unregister_pernet_subsys(&ctnetlink_net_ops); |
| 2217 | nf_ct_expect_unregister_notifier(&ctnl_notifier_exp); | ||
| 2218 | nf_conntrack_unregister_notifier(&ctnl_notifier); | ||
| 2219 | #endif | ||
| 2220 | |||
| 2221 | nfnetlink_subsys_unregister(&ctnl_exp_subsys); | 2252 | nfnetlink_subsys_unregister(&ctnl_exp_subsys); |
| 2222 | nfnetlink_subsys_unregister(&ctnl_subsys); | 2253 | nfnetlink_subsys_unregister(&ctnl_subsys); |
| 2223 | } | 2254 | } |
diff --git a/net/netlabel/netlabel_kapi.c b/net/netlabel/netlabel_kapi.c index 9c24de10a657..824f184f7a9b 100644 --- a/net/netlabel/netlabel_kapi.c +++ b/net/netlabel/netlabel_kapi.c | |||
| @@ -111,8 +111,6 @@ int netlbl_cfg_unlbl_map_add(const char *domain, | |||
| 111 | struct netlbl_domaddr_map *addrmap = NULL; | 111 | struct netlbl_domaddr_map *addrmap = NULL; |
| 112 | struct netlbl_domaddr4_map *map4 = NULL; | 112 | struct netlbl_domaddr4_map *map4 = NULL; |
| 113 | struct netlbl_domaddr6_map *map6 = NULL; | 113 | struct netlbl_domaddr6_map *map6 = NULL; |
| 114 | const struct in_addr *addr4, *mask4; | ||
| 115 | const struct in6_addr *addr6, *mask6; | ||
| 116 | 114 | ||
| 117 | entry = kzalloc(sizeof(*entry), GFP_ATOMIC); | 115 | entry = kzalloc(sizeof(*entry), GFP_ATOMIC); |
| 118 | if (entry == NULL) | 116 | if (entry == NULL) |
| @@ -133,9 +131,9 @@ int netlbl_cfg_unlbl_map_add(const char *domain, | |||
| 133 | INIT_LIST_HEAD(&addrmap->list6); | 131 | INIT_LIST_HEAD(&addrmap->list6); |
| 134 | 132 | ||
| 135 | switch (family) { | 133 | switch (family) { |
| 136 | case AF_INET: | 134 | case AF_INET: { |
| 137 | addr4 = addr; | 135 | const struct in_addr *addr4 = addr; |
| 138 | mask4 = mask; | 136 | const struct in_addr *mask4 = mask; |
| 139 | map4 = kzalloc(sizeof(*map4), GFP_ATOMIC); | 137 | map4 = kzalloc(sizeof(*map4), GFP_ATOMIC); |
| 140 | if (map4 == NULL) | 138 | if (map4 == NULL) |
| 141 | goto cfg_unlbl_map_add_failure; | 139 | goto cfg_unlbl_map_add_failure; |
| @@ -148,9 +146,11 @@ int netlbl_cfg_unlbl_map_add(const char *domain, | |||
| 148 | if (ret_val != 0) | 146 | if (ret_val != 0) |
| 149 | goto cfg_unlbl_map_add_failure; | 147 | goto cfg_unlbl_map_add_failure; |
| 150 | break; | 148 | break; |
| 151 | case AF_INET6: | 149 | } |
| 152 | addr6 = addr; | 150 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
| 153 | mask6 = mask; | 151 | case AF_INET6: { |
| 152 | const struct in6_addr *addr6 = addr; | ||
| 153 | const struct in6_addr *mask6 = mask; | ||
| 154 | map6 = kzalloc(sizeof(*map6), GFP_ATOMIC); | 154 | map6 = kzalloc(sizeof(*map6), GFP_ATOMIC); |
| 155 | if (map6 == NULL) | 155 | if (map6 == NULL) |
| 156 | goto cfg_unlbl_map_add_failure; | 156 | goto cfg_unlbl_map_add_failure; |
| @@ -162,11 +162,13 @@ int netlbl_cfg_unlbl_map_add(const char *domain, | |||
| 162 | map6->list.addr.s6_addr32[3] &= mask6->s6_addr32[3]; | 162 | map6->list.addr.s6_addr32[3] &= mask6->s6_addr32[3]; |
| 163 | ipv6_addr_copy(&map6->list.mask, mask6); | 163 | ipv6_addr_copy(&map6->list.mask, mask6); |
| 164 | map6->list.valid = 1; | 164 | map6->list.valid = 1; |
| 165 | ret_val = netlbl_af4list_add(&map4->list, | 165 | ret_val = netlbl_af6list_add(&map6->list, |
| 166 | &addrmap->list4); | 166 | &addrmap->list6); |
| 167 | if (ret_val != 0) | 167 | if (ret_val != 0) |
| 168 | goto cfg_unlbl_map_add_failure; | 168 | goto cfg_unlbl_map_add_failure; |
| 169 | break; | 169 | break; |
| 170 | } | ||
| 171 | #endif /* IPv6 */ | ||
| 170 | default: | 172 | default: |
| 171 | goto cfg_unlbl_map_add_failure; | 173 | goto cfg_unlbl_map_add_failure; |
| 172 | break; | 174 | break; |
| @@ -225,9 +227,11 @@ int netlbl_cfg_unlbl_static_add(struct net *net, | |||
| 225 | case AF_INET: | 227 | case AF_INET: |
| 226 | addr_len = sizeof(struct in_addr); | 228 | addr_len = sizeof(struct in_addr); |
| 227 | break; | 229 | break; |
| 230 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
| 228 | case AF_INET6: | 231 | case AF_INET6: |
| 229 | addr_len = sizeof(struct in6_addr); | 232 | addr_len = sizeof(struct in6_addr); |
| 230 | break; | 233 | break; |
| 234 | #endif /* IPv6 */ | ||
| 231 | default: | 235 | default: |
| 232 | return -EPFNOSUPPORT; | 236 | return -EPFNOSUPPORT; |
| 233 | } | 237 | } |
| @@ -266,9 +270,11 @@ int netlbl_cfg_unlbl_static_del(struct net *net, | |||
| 266 | case AF_INET: | 270 | case AF_INET: |
| 267 | addr_len = sizeof(struct in_addr); | 271 | addr_len = sizeof(struct in_addr); |
| 268 | break; | 272 | break; |
| 273 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
| 269 | case AF_INET6: | 274 | case AF_INET6: |
| 270 | addr_len = sizeof(struct in6_addr); | 275 | addr_len = sizeof(struct in6_addr); |
| 271 | break; | 276 | break; |
| 277 | #endif /* IPv6 */ | ||
| 272 | default: | 278 | default: |
| 273 | return -EPFNOSUPPORT; | 279 | return -EPFNOSUPPORT; |
| 274 | } | 280 | } |
diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c index 6649463da1b6..d617161f8dd3 100644 --- a/net/sched/sch_red.c +++ b/net/sched/sch_red.c | |||
| @@ -209,8 +209,8 @@ static int red_change(struct Qdisc *sch, struct nlattr *opt) | |||
| 209 | ctl->Plog, ctl->Scell_log, | 209 | ctl->Plog, ctl->Scell_log, |
| 210 | nla_data(tb[TCA_RED_STAB])); | 210 | nla_data(tb[TCA_RED_STAB])); |
| 211 | 211 | ||
| 212 | if (skb_queue_empty(&sch->q)) | 212 | if (!q->qdisc->q.qlen) |
| 213 | red_end_of_idle_period(&q->parms); | 213 | red_start_of_idle_period(&q->parms); |
| 214 | 214 | ||
| 215 | sch_tree_unlock(sch); | 215 | sch_tree_unlock(sch); |
| 216 | return 0; | 216 | return 0; |
diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c index a3b7120fcc74..4f4c52c0eeb3 100644 --- a/net/sched/sch_teql.c +++ b/net/sched/sch_teql.c | |||
| @@ -225,11 +225,11 @@ static int teql_qdisc_init(struct Qdisc *sch, struct nlattr *opt) | |||
| 225 | 225 | ||
| 226 | 226 | ||
| 227 | static int | 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); | 232 | struct teql_sched_data *q = qdisc_priv(txq->qdisc); |
| 231 | struct teql_sched_data *q = qdisc_priv(dev_queue->qdisc); | ||
| 232 | struct neighbour *mn = dst_get_neighbour(skb_dst(skb)); | ||
| 233 | struct neighbour *n = q->ncache; | 233 | struct neighbour *n = q->ncache; |
| 234 | 234 | ||
| 235 | if (mn->tbl == NULL) | 235 | if (mn->tbl == NULL) |
| @@ -262,17 +262,26 @@ __teql_resolve(struct sk_buff *skb, struct sk_buff *skb_res, struct net_device * | |||
| 262 | } | 262 | } |
| 263 | 263 | ||
| 264 | static inline int teql_resolve(struct sk_buff *skb, | 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 | if (txq->qdisc == &noop_qdisc) | 273 | if (txq->qdisc == &noop_qdisc) |
| 269 | return -ENODEV; | 274 | return -ENODEV; |
| 270 | 275 | ||
| 271 | if (dev->header_ops == NULL || | 276 | if (!dev->header_ops || !dst) |
| 272 | skb_dst(skb) == NULL || | ||
| 273 | dst_get_neighbour(skb_dst(skb)) == NULL) | ||
| 274 | return 0; | 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 | static netdev_tx_t teql_master_xmit(struct sk_buff *skb, struct net_device *dev) | 287 | static netdev_tx_t teql_master_xmit(struct sk_buff *skb, struct net_device *dev) |
| @@ -307,7 +316,7 @@ restart: | |||
| 307 | continue; | 316 | continue; |
| 308 | } | 317 | } |
| 309 | 318 | ||
| 310 | switch (teql_resolve(skb, skb_res, slave)) { | 319 | switch (teql_resolve(skb, skb_res, slave, slave_txq)) { |
| 311 | case 0: | 320 | case 0: |
| 312 | if (__netif_tx_trylock(slave_txq)) { | 321 | if (__netif_tx_trylock(slave_txq)) { |
| 313 | unsigned int length = qdisc_pkt_len(skb); | 322 | unsigned int length = qdisc_pkt_len(skb); |
diff --git a/net/sctp/auth.c b/net/sctp/auth.c index 865e68fef21c..bf812048cf6f 100644 --- a/net/sctp/auth.c +++ b/net/sctp/auth.c | |||
| @@ -82,7 +82,7 @@ static struct sctp_auth_bytes *sctp_auth_create_key(__u32 key_len, gfp_t gfp) | |||
| 82 | struct sctp_auth_bytes *key; | 82 | struct sctp_auth_bytes *key; |
| 83 | 83 | ||
| 84 | /* Verify that we are not going to overflow INT_MAX */ | 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 | return NULL; | 86 | return NULL; |
| 87 | 87 | ||
| 88 | /* Allocate the shared key */ | 88 | /* Allocate the shared key */ |
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 466fbcc5cf77..b595a3d8679f 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
| @@ -1957,6 +1957,7 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
| 1957 | if ((UNIXCB(skb).pid != siocb->scm->pid) || | 1957 | if ((UNIXCB(skb).pid != siocb->scm->pid) || |
| 1958 | (UNIXCB(skb).cred != siocb->scm->cred)) { | 1958 | (UNIXCB(skb).cred != siocb->scm->cred)) { |
| 1959 | skb_queue_head(&sk->sk_receive_queue, skb); | 1959 | skb_queue_head(&sk->sk_receive_queue, skb); |
| 1960 | sk->sk_data_ready(sk, skb->len); | ||
| 1960 | break; | 1961 | break; |
| 1961 | } | 1962 | } |
| 1962 | } else { | 1963 | } else { |
| @@ -1974,6 +1975,7 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
| 1974 | chunk = min_t(unsigned int, skb->len, size); | 1975 | chunk = min_t(unsigned int, skb->len, size); |
| 1975 | if (memcpy_toiovec(msg->msg_iov, skb->data, chunk)) { | 1976 | if (memcpy_toiovec(msg->msg_iov, skb->data, chunk)) { |
| 1976 | skb_queue_head(&sk->sk_receive_queue, skb); | 1977 | skb_queue_head(&sk->sk_receive_queue, skb); |
| 1978 | sk->sk_data_ready(sk, skb->len); | ||
| 1977 | if (copied == 0) | 1979 | if (copied == 0) |
| 1978 | copied = -EFAULT; | 1980 | copied = -EFAULT; |
| 1979 | break; | 1981 | break; |
| @@ -1991,6 +1993,7 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
| 1991 | /* put the skb back if we didn't use it up.. */ | 1993 | /* put the skb back if we didn't use it up.. */ |
| 1992 | if (skb->len) { | 1994 | if (skb->len) { |
| 1993 | skb_queue_head(&sk->sk_receive_queue, skb); | 1995 | skb_queue_head(&sk->sk_receive_queue, skb); |
| 1996 | sk->sk_data_ready(sk, skb->len); | ||
| 1994 | break; | 1997 | break; |
| 1995 | } | 1998 | } |
| 1996 | 1999 | ||
| @@ -2006,6 +2009,7 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
| 2006 | 2009 | ||
| 2007 | /* put message back and return */ | 2010 | /* put message back and return */ |
| 2008 | skb_queue_head(&sk->sk_receive_queue, skb); | 2011 | skb_queue_head(&sk->sk_receive_queue, skb); |
| 2012 | sk->sk_data_ready(sk, skb->len); | ||
| 2009 | break; | 2013 | break; |
| 2010 | } | 2014 | } |
| 2011 | } while (size); | 2015 | } while (size); |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index b3a476fe8272..ffafda5022c2 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
| @@ -89,8 +89,8 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = { | |||
| 89 | [NL80211_ATTR_IFINDEX] = { .type = NLA_U32 }, | 89 | [NL80211_ATTR_IFINDEX] = { .type = NLA_U32 }, |
| 90 | [NL80211_ATTR_IFNAME] = { .type = NLA_NUL_STRING, .len = IFNAMSIZ-1 }, | 90 | [NL80211_ATTR_IFNAME] = { .type = NLA_NUL_STRING, .len = IFNAMSIZ-1 }, |
| 91 | 91 | ||
| 92 | [NL80211_ATTR_MAC] = { .type = NLA_BINARY, .len = ETH_ALEN }, | 92 | [NL80211_ATTR_MAC] = { .len = ETH_ALEN }, |
| 93 | [NL80211_ATTR_PREV_BSSID] = { .type = NLA_BINARY, .len = ETH_ALEN }, | 93 | [NL80211_ATTR_PREV_BSSID] = { .len = ETH_ALEN }, |
| 94 | 94 | ||
| 95 | [NL80211_ATTR_KEY] = { .type = NLA_NESTED, }, | 95 | [NL80211_ATTR_KEY] = { .type = NLA_NESTED, }, |
| 96 | [NL80211_ATTR_KEY_DATA] = { .type = NLA_BINARY, | 96 | [NL80211_ATTR_KEY_DATA] = { .type = NLA_BINARY, |
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index e71f5a66574e..77e926738014 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
| @@ -2037,6 +2037,10 @@ static int __set_regdom(const struct ieee80211_regdomain *rd) | |||
| 2037 | } | 2037 | } |
| 2038 | 2038 | ||
| 2039 | request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx); | 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 | if (!last_request->intersect) { | 2045 | if (!last_request->intersect) { |
| 2042 | int r; | 2046 | int r; |
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 552df27dcf53..2118d6446630 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
| @@ -2382,9 +2382,11 @@ static unsigned int xfrm_default_advmss(const struct dst_entry *dst) | |||
| 2382 | return dst_metric_advmss(dst->path); | 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 | static struct neighbour *xfrm_neigh_lookup(const struct dst_entry *dst, const void *daddr) | 2392 | static struct neighbour *xfrm_neigh_lookup(const struct dst_entry *dst, const void *daddr) |
| @@ -2411,8 +2413,8 @@ int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo) | |||
| 2411 | dst_ops->check = xfrm_dst_check; | 2413 | dst_ops->check = xfrm_dst_check; |
| 2412 | if (likely(dst_ops->default_advmss == NULL)) | 2414 | if (likely(dst_ops->default_advmss == NULL)) |
| 2413 | dst_ops->default_advmss = xfrm_default_advmss; | 2415 | dst_ops->default_advmss = xfrm_default_advmss; |
| 2414 | if (likely(dst_ops->default_mtu == NULL)) | 2416 | if (likely(dst_ops->mtu == NULL)) |
| 2415 | dst_ops->default_mtu = xfrm_default_mtu; | 2417 | dst_ops->mtu = xfrm_mtu; |
| 2416 | if (likely(dst_ops->negative_advice == NULL)) | 2418 | if (likely(dst_ops->negative_advice == NULL)) |
| 2417 | dst_ops->negative_advice = xfrm_negative_advice; | 2419 | dst_ops->negative_advice = xfrm_negative_advice; |
| 2418 | if (likely(dst_ops->link_failure == NULL)) | 2420 | if (likely(dst_ops->link_failure == NULL)) |
