diff options
30 files changed, 235 insertions, 145 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 5783a80d3e05..381190c7949c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -2931,7 +2931,7 @@ P: Dmitry Eremin-Solenikov | |||
2931 | M: dbaryshkov@gmail.com | 2931 | M: dbaryshkov@gmail.com |
2932 | P: Sergey Lapin | 2932 | P: Sergey Lapin |
2933 | M: slapin@ossfans.org | 2933 | M: slapin@ossfans.org |
2934 | L: linux-zigbee-devel@lists.sourceforge.net | 2934 | L: linux-zigbee-devel@lists.sourceforge.net (moderated for non-subscribers) |
2935 | W: http://apps.sourceforge.net/trac/linux-zigbee | 2935 | W: http://apps.sourceforge.net/trac/linux-zigbee |
2936 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/lowpan/lowpan.git | 2936 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/lowpan/lowpan.git |
2937 | S: Maintained | 2937 | S: Maintained |
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index fbf1352e9c1c..951714a7f90a 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c | |||
@@ -8637,6 +8637,14 @@ static int bnx2x_nway_reset(struct net_device *dev) | |||
8637 | return 0; | 8637 | return 0; |
8638 | } | 8638 | } |
8639 | 8639 | ||
8640 | static u32 | ||
8641 | bnx2x_get_link(struct net_device *dev) | ||
8642 | { | ||
8643 | struct bnx2x *bp = netdev_priv(dev); | ||
8644 | |||
8645 | return bp->link_vars.link_up; | ||
8646 | } | ||
8647 | |||
8640 | static int bnx2x_get_eeprom_len(struct net_device *dev) | 8648 | static int bnx2x_get_eeprom_len(struct net_device *dev) |
8641 | { | 8649 | { |
8642 | struct bnx2x *bp = netdev_priv(dev); | 8650 | struct bnx2x *bp = netdev_priv(dev); |
@@ -10034,7 +10042,7 @@ static struct ethtool_ops bnx2x_ethtool_ops = { | |||
10034 | .get_msglevel = bnx2x_get_msglevel, | 10042 | .get_msglevel = bnx2x_get_msglevel, |
10035 | .set_msglevel = bnx2x_set_msglevel, | 10043 | .set_msglevel = bnx2x_set_msglevel, |
10036 | .nway_reset = bnx2x_nway_reset, | 10044 | .nway_reset = bnx2x_nway_reset, |
10037 | .get_link = ethtool_op_get_link, | 10045 | .get_link = bnx2x_get_link, |
10038 | .get_eeprom_len = bnx2x_get_eeprom_len, | 10046 | .get_eeprom_len = bnx2x_get_eeprom_len, |
10039 | .get_eeprom = bnx2x_get_eeprom, | 10047 | .get_eeprom = bnx2x_get_eeprom, |
10040 | .set_eeprom = bnx2x_set_eeprom, | 10048 | .set_eeprom = bnx2x_set_eeprom, |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 5e3356f8eb5a..5b8cbdb4b520 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -2185,12 +2185,16 @@ static void e1000_clean_rx_ring(struct e1000_adapter *adapter, | |||
2185 | /* Free all the Rx ring sk_buffs */ | 2185 | /* Free all the Rx ring sk_buffs */ |
2186 | for (i = 0; i < rx_ring->count; i++) { | 2186 | for (i = 0; i < rx_ring->count; i++) { |
2187 | buffer_info = &rx_ring->buffer_info[i]; | 2187 | buffer_info = &rx_ring->buffer_info[i]; |
2188 | if (buffer_info->skb) { | 2188 | if (buffer_info->dma) { |
2189 | pci_unmap_single(pdev, | 2189 | pci_unmap_single(pdev, |
2190 | buffer_info->dma, | 2190 | buffer_info->dma, |
2191 | buffer_info->length, | 2191 | buffer_info->length, |
2192 | PCI_DMA_FROMDEVICE); | 2192 | PCI_DMA_FROMDEVICE); |
2193 | } | ||
2194 | |||
2195 | buffer_info->dma = 0; | ||
2193 | 2196 | ||
2197 | if (buffer_info->skb) { | ||
2194 | dev_kfree_skb(buffer_info->skb); | 2198 | dev_kfree_skb(buffer_info->skb); |
2195 | buffer_info->skb = NULL; | 2199 | buffer_info->skb = NULL; |
2196 | } | 2200 | } |
@@ -4033,6 +4037,7 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter, | |||
4033 | buffer_info->dma, | 4037 | buffer_info->dma, |
4034 | buffer_info->length, | 4038 | buffer_info->length, |
4035 | PCI_DMA_FROMDEVICE); | 4039 | PCI_DMA_FROMDEVICE); |
4040 | buffer_info->dma = 0; | ||
4036 | 4041 | ||
4037 | length = le16_to_cpu(rx_desc->length); | 4042 | length = le16_to_cpu(rx_desc->length); |
4038 | /* !EOP means multiple descriptors were used to store a single | 4043 | /* !EOP means multiple descriptors were used to store a single |
@@ -4222,6 +4227,7 @@ map_skb: | |||
4222 | pci_unmap_single(pdev, buffer_info->dma, | 4227 | pci_unmap_single(pdev, buffer_info->dma, |
4223 | adapter->rx_buffer_len, | 4228 | adapter->rx_buffer_len, |
4224 | PCI_DMA_FROMDEVICE); | 4229 | PCI_DMA_FROMDEVICE); |
4230 | buffer_info->dma = 0; | ||
4225 | 4231 | ||
4226 | break; /* while !buffer_info->skb */ | 4232 | break; /* while !buffer_info->skb */ |
4227 | } | 4233 | } |
@@ -4817,6 +4823,9 @@ static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev, | |||
4817 | 4823 | ||
4818 | netif_device_detach(netdev); | 4824 | netif_device_detach(netdev); |
4819 | 4825 | ||
4826 | if (state == pci_channel_io_perm_failure) | ||
4827 | return PCI_ERS_RESULT_DISCONNECT; | ||
4828 | |||
4820 | if (netif_running(netdev)) | 4829 | if (netif_running(netdev)) |
4821 | e1000_down(adapter); | 4830 | e1000_down(adapter); |
4822 | pci_disable_device(pdev); | 4831 | pci_disable_device(pdev); |
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 679885a122b4..63415bb6f48f 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -4785,6 +4785,9 @@ static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev, | |||
4785 | 4785 | ||
4786 | netif_device_detach(netdev); | 4786 | netif_device_detach(netdev); |
4787 | 4787 | ||
4788 | if (state == pci_channel_io_perm_failure) | ||
4789 | return PCI_ERS_RESULT_DISCONNECT; | ||
4790 | |||
4788 | if (netif_running(netdev)) | 4791 | if (netif_running(netdev)) |
4789 | e1000e_down(adapter); | 4792 | e1000e_down(adapter); |
4790 | pci_disable_device(pdev); | 4793 | pci_disable_device(pdev); |
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index ea17319624aa..be480292aba1 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -4549,11 +4549,12 @@ static bool igb_clean_rx_irq_adv(struct igb_ring *rx_ring, | |||
4549 | cleaned = true; | 4549 | cleaned = true; |
4550 | cleaned_count++; | 4550 | cleaned_count++; |
4551 | 4551 | ||
4552 | /* this is the fast path for the non-packet split case */ | ||
4552 | if (!adapter->rx_ps_hdr_size) { | 4553 | if (!adapter->rx_ps_hdr_size) { |
4553 | pci_unmap_single(pdev, buffer_info->dma, | 4554 | pci_unmap_single(pdev, buffer_info->dma, |
4554 | adapter->rx_buffer_len + | 4555 | adapter->rx_buffer_len, |
4555 | NET_IP_ALIGN, | ||
4556 | PCI_DMA_FROMDEVICE); | 4556 | PCI_DMA_FROMDEVICE); |
4557 | buffer_info->dma = 0; | ||
4557 | skb_put(skb, length); | 4558 | skb_put(skb, length); |
4558 | goto send_up; | 4559 | goto send_up; |
4559 | } | 4560 | } |
@@ -4570,8 +4571,9 @@ static bool igb_clean_rx_irq_adv(struct igb_ring *rx_ring, | |||
4570 | 4571 | ||
4571 | if (!skb_shinfo(skb)->nr_frags) { | 4572 | if (!skb_shinfo(skb)->nr_frags) { |
4572 | pci_unmap_single(pdev, buffer_info->dma, | 4573 | pci_unmap_single(pdev, buffer_info->dma, |
4573 | adapter->rx_ps_hdr_size + NET_IP_ALIGN, | 4574 | adapter->rx_ps_hdr_size, |
4574 | PCI_DMA_FROMDEVICE); | 4575 | PCI_DMA_FROMDEVICE); |
4576 | buffer_info->dma = 0; | ||
4575 | skb_put(skb, hlen); | 4577 | skb_put(skb, hlen); |
4576 | } | 4578 | } |
4577 | 4579 | ||
@@ -4713,7 +4715,6 @@ static void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring, | |||
4713 | bufsz = adapter->rx_ps_hdr_size; | 4715 | bufsz = adapter->rx_ps_hdr_size; |
4714 | else | 4716 | else |
4715 | bufsz = adapter->rx_buffer_len; | 4717 | bufsz = adapter->rx_buffer_len; |
4716 | bufsz += NET_IP_ALIGN; | ||
4717 | 4718 | ||
4718 | while (cleaned_count--) { | 4719 | while (cleaned_count--) { |
4719 | rx_desc = E1000_RX_DESC_ADV(*rx_ring, i); | 4720 | rx_desc = E1000_RX_DESC_ADV(*rx_ring, i); |
@@ -4737,7 +4738,7 @@ static void igb_alloc_rx_buffers_adv(struct igb_ring *rx_ring, | |||
4737 | } | 4738 | } |
4738 | 4739 | ||
4739 | if (!buffer_info->skb) { | 4740 | if (!buffer_info->skb) { |
4740 | skb = netdev_alloc_skb(netdev, bufsz); | 4741 | skb = netdev_alloc_skb(netdev, bufsz + NET_IP_ALIGN); |
4741 | if (!skb) { | 4742 | if (!skb) { |
4742 | adapter->alloc_rx_buff_failed++; | 4743 | adapter->alloc_rx_buff_failed++; |
4743 | goto no_buffers; | 4744 | goto no_buffers; |
@@ -5338,6 +5339,9 @@ static pci_ers_result_t igb_io_error_detected(struct pci_dev *pdev, | |||
5338 | 5339 | ||
5339 | netif_device_detach(netdev); | 5340 | netif_device_detach(netdev); |
5340 | 5341 | ||
5342 | if (state == pci_channel_io_perm_failure) | ||
5343 | return PCI_ERS_RESULT_DISCONNECT; | ||
5344 | |||
5341 | if (netif_running(netdev)) | 5345 | if (netif_running(netdev)) |
5342 | igb_down(adapter); | 5346 | igb_down(adapter); |
5343 | pci_disable_device(pdev); | 5347 | pci_disable_device(pdev); |
diff --git a/drivers/net/irda/bfin_sir.c b/drivers/net/irda/bfin_sir.c index f3eed6a8fba5..911c082cee5a 100644 --- a/drivers/net/irda/bfin_sir.c +++ b/drivers/net/irda/bfin_sir.c | |||
@@ -677,6 +677,14 @@ static int bfin_sir_init_iobuf(iobuff_t *io, int size) | |||
677 | return 0; | 677 | return 0; |
678 | } | 678 | } |
679 | 679 | ||
680 | static const struct net_device_ops bfin_sir_ndo = { | ||
681 | .ndo_open = bfin_sir_open, | ||
682 | .ndo_stop = bfin_sir_stop, | ||
683 | .ndo_start_xmit = bfin_sir_hard_xmit, | ||
684 | .ndo_do_ioctl = bfin_sir_ioctl, | ||
685 | .ndo_get_stats = bfin_sir_stats, | ||
686 | }; | ||
687 | |||
680 | static int __devinit bfin_sir_probe(struct platform_device *pdev) | 688 | static int __devinit bfin_sir_probe(struct platform_device *pdev) |
681 | { | 689 | { |
682 | struct net_device *dev; | 690 | struct net_device *dev; |
@@ -718,12 +726,8 @@ static int __devinit bfin_sir_probe(struct platform_device *pdev) | |||
718 | if (err) | 726 | if (err) |
719 | goto err_mem_3; | 727 | goto err_mem_3; |
720 | 728 | ||
721 | dev->hard_start_xmit = bfin_sir_hard_xmit; | 729 | dev->netdev_ops = &bfin_sir_ndo; |
722 | dev->open = bfin_sir_open; | 730 | dev->irq = sir_port->irq; |
723 | dev->stop = bfin_sir_stop; | ||
724 | dev->do_ioctl = bfin_sir_ioctl; | ||
725 | dev->get_stats = bfin_sir_stats; | ||
726 | dev->irq = sir_port->irq; | ||
727 | 731 | ||
728 | irda_init_max_qos_capabilies(&self->qos); | 732 | irda_init_max_qos_capabilies(&self->qos); |
729 | 733 | ||
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index 86f4f3e36f27..0f7b6a3a2e68 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -139,7 +139,7 @@ static int ixgbe_get_settings(struct net_device *netdev, | |||
139 | ecmd->autoneg = AUTONEG_ENABLE; | 139 | ecmd->autoneg = AUTONEG_ENABLE; |
140 | ecmd->transceiver = XCVR_EXTERNAL; | 140 | ecmd->transceiver = XCVR_EXTERNAL; |
141 | if ((hw->phy.media_type == ixgbe_media_type_copper) || | 141 | if ((hw->phy.media_type == ixgbe_media_type_copper) || |
142 | (hw->mac.type == ixgbe_mac_82599EB)) { | 142 | (hw->phy.multispeed_fiber)) { |
143 | ecmd->supported |= (SUPPORTED_1000baseT_Full | | 143 | ecmd->supported |= (SUPPORTED_1000baseT_Full | |
144 | SUPPORTED_Autoneg); | 144 | SUPPORTED_Autoneg); |
145 | 145 | ||
@@ -217,7 +217,7 @@ static int ixgbe_set_settings(struct net_device *netdev, | |||
217 | s32 err = 0; | 217 | s32 err = 0; |
218 | 218 | ||
219 | if ((hw->phy.media_type == ixgbe_media_type_copper) || | 219 | if ((hw->phy.media_type == ixgbe_media_type_copper) || |
220 | (hw->mac.type == ixgbe_mac_82599EB)) { | 220 | (hw->phy.multispeed_fiber)) { |
221 | /* 10000/copper and 1000/copper must autoneg | 221 | /* 10000/copper and 1000/copper must autoneg |
222 | * this function does not support any duplex forcing, but can | 222 | * this function does not support any duplex forcing, but can |
223 | * limit the advertising of the adapter to only 10000 or 1000 */ | 223 | * limit the advertising of the adapter to only 10000 or 1000 */ |
@@ -245,6 +245,7 @@ static int ixgbe_set_settings(struct net_device *netdev, | |||
245 | } else { | 245 | } else { |
246 | /* in this case we currently only support 10Gb/FULL */ | 246 | /* in this case we currently only support 10Gb/FULL */ |
247 | if ((ecmd->autoneg == AUTONEG_ENABLE) || | 247 | if ((ecmd->autoneg == AUTONEG_ENABLE) || |
248 | (ecmd->advertising != ADVERTISED_10000baseT_Full) || | ||
248 | (ecmd->speed + ecmd->duplex != SPEED_10000 + DUPLEX_FULL)) | 249 | (ecmd->speed + ecmd->duplex != SPEED_10000 + DUPLEX_FULL)) |
249 | return -EINVAL; | 250 | return -EINVAL; |
250 | } | 251 | } |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index e756e220db32..5588ef493a3d 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -563,7 +563,6 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter, | |||
563 | union ixgbe_adv_rx_desc *rx_desc; | 563 | union ixgbe_adv_rx_desc *rx_desc; |
564 | struct ixgbe_rx_buffer *bi; | 564 | struct ixgbe_rx_buffer *bi; |
565 | unsigned int i; | 565 | unsigned int i; |
566 | unsigned int bufsz = rx_ring->rx_buf_len + NET_IP_ALIGN; | ||
567 | 566 | ||
568 | i = rx_ring->next_to_use; | 567 | i = rx_ring->next_to_use; |
569 | bi = &rx_ring->rx_buffer_info[i]; | 568 | bi = &rx_ring->rx_buffer_info[i]; |
@@ -593,7 +592,9 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter, | |||
593 | 592 | ||
594 | if (!bi->skb) { | 593 | if (!bi->skb) { |
595 | struct sk_buff *skb; | 594 | struct sk_buff *skb; |
596 | skb = netdev_alloc_skb(adapter->netdev, bufsz); | 595 | skb = netdev_alloc_skb(adapter->netdev, |
596 | (rx_ring->rx_buf_len + | ||
597 | NET_IP_ALIGN)); | ||
597 | 598 | ||
598 | if (!skb) { | 599 | if (!skb) { |
599 | adapter->alloc_rx_buff_failed++; | 600 | adapter->alloc_rx_buff_failed++; |
@@ -608,7 +609,8 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter, | |||
608 | skb_reserve(skb, NET_IP_ALIGN); | 609 | skb_reserve(skb, NET_IP_ALIGN); |
609 | 610 | ||
610 | bi->skb = skb; | 611 | bi->skb = skb; |
611 | bi->dma = pci_map_single(pdev, skb->data, bufsz, | 612 | bi->dma = pci_map_single(pdev, skb->data, |
613 | rx_ring->rx_buf_len, | ||
612 | PCI_DMA_FROMDEVICE); | 614 | PCI_DMA_FROMDEVICE); |
613 | } | 615 | } |
614 | /* Refresh the desc even if buffer_addrs didn't change because | 616 | /* Refresh the desc even if buffer_addrs didn't change because |
@@ -732,6 +734,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, | |||
732 | pci_unmap_single(pdev, rx_buffer_info->dma, | 734 | pci_unmap_single(pdev, rx_buffer_info->dma, |
733 | rx_ring->rx_buf_len, | 735 | rx_ring->rx_buf_len, |
734 | PCI_DMA_FROMDEVICE); | 736 | PCI_DMA_FROMDEVICE); |
737 | rx_buffer_info->dma = 0; | ||
735 | skb_put(skb, len); | 738 | skb_put(skb, len); |
736 | } | 739 | } |
737 | 740 | ||
@@ -2701,7 +2704,10 @@ static int ixgbe_up_complete(struct ixgbe_adapter *adapter) | |||
2701 | */ | 2704 | */ |
2702 | err = hw->phy.ops.identify(hw); | 2705 | err = hw->phy.ops.identify(hw); |
2703 | if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { | 2706 | if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { |
2704 | DPRINTK(PROBE, ERR, "PHY not supported on this NIC %d\n", err); | 2707 | dev_err(&adapter->pdev->dev, "failed to initialize because " |
2708 | "an unsupported SFP+ module type was detected.\n" | ||
2709 | "Reload the driver after installing a supported " | ||
2710 | "module.\n"); | ||
2705 | ixgbe_down(adapter); | 2711 | ixgbe_down(adapter); |
2706 | return err; | 2712 | return err; |
2707 | } | 2713 | } |
@@ -2812,9 +2818,11 @@ static void ixgbe_clean_rx_ring(struct ixgbe_adapter *adapter, | |||
2812 | } | 2818 | } |
2813 | if (!rx_buffer_info->page) | 2819 | if (!rx_buffer_info->page) |
2814 | continue; | 2820 | continue; |
2815 | pci_unmap_page(pdev, rx_buffer_info->page_dma, PAGE_SIZE / 2, | 2821 | if (rx_buffer_info->page_dma) { |
2816 | PCI_DMA_FROMDEVICE); | 2822 | pci_unmap_page(pdev, rx_buffer_info->page_dma, |
2817 | rx_buffer_info->page_dma = 0; | 2823 | PAGE_SIZE / 2, PCI_DMA_FROMDEVICE); |
2824 | rx_buffer_info->page_dma = 0; | ||
2825 | } | ||
2818 | put_page(rx_buffer_info->page); | 2826 | put_page(rx_buffer_info->page); |
2819 | rx_buffer_info->page = NULL; | 2827 | rx_buffer_info->page = NULL; |
2820 | rx_buffer_info->page_offset = 0; | 2828 | rx_buffer_info->page_offset = 0; |
@@ -3720,10 +3728,11 @@ static void ixgbe_sfp_task(struct work_struct *work) | |||
3720 | goto reschedule; | 3728 | goto reschedule; |
3721 | ret = hw->phy.ops.reset(hw); | 3729 | ret = hw->phy.ops.reset(hw); |
3722 | if (ret == IXGBE_ERR_SFP_NOT_SUPPORTED) { | 3730 | if (ret == IXGBE_ERR_SFP_NOT_SUPPORTED) { |
3723 | DPRINTK(PROBE, ERR, "failed to initialize because an " | 3731 | dev_err(&adapter->pdev->dev, "failed to initialize " |
3724 | "unsupported SFP+ module type was detected.\n" | 3732 | "because an unsupported SFP+ module type " |
3725 | "Reload the driver after installing a " | 3733 | "was detected.\n" |
3726 | "supported module.\n"); | 3734 | "Reload the driver after installing a " |
3735 | "supported module.\n"); | ||
3727 | unregister_netdev(adapter->netdev); | 3736 | unregister_netdev(adapter->netdev); |
3728 | } else { | 3737 | } else { |
3729 | DPRINTK(PROBE, INFO, "detected SFP+: %d\n", | 3738 | DPRINTK(PROBE, INFO, "detected SFP+: %d\n", |
@@ -4502,7 +4511,8 @@ static void ixgbe_multispeed_fiber_task(struct work_struct *work) | |||
4502 | u32 autoneg; | 4511 | u32 autoneg; |
4503 | 4512 | ||
4504 | adapter->flags |= IXGBE_FLAG_IN_SFP_LINK_TASK; | 4513 | adapter->flags |= IXGBE_FLAG_IN_SFP_LINK_TASK; |
4505 | if (hw->mac.ops.get_link_capabilities) | 4514 | autoneg = hw->phy.autoneg_advertised; |
4515 | if ((!autoneg) && (hw->mac.ops.get_link_capabilities)) | ||
4506 | hw->mac.ops.get_link_capabilities(hw, &autoneg, | 4516 | hw->mac.ops.get_link_capabilities(hw, &autoneg, |
4507 | &hw->mac.autoneg); | 4517 | &hw->mac.autoneg); |
4508 | if (hw->mac.ops.setup_link_speed) | 4518 | if (hw->mac.ops.setup_link_speed) |
@@ -4526,7 +4536,10 @@ static void ixgbe_sfp_config_module_task(struct work_struct *work) | |||
4526 | adapter->flags |= IXGBE_FLAG_IN_SFP_MOD_TASK; | 4536 | adapter->flags |= IXGBE_FLAG_IN_SFP_MOD_TASK; |
4527 | err = hw->phy.ops.identify_sfp(hw); | 4537 | err = hw->phy.ops.identify_sfp(hw); |
4528 | if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { | 4538 | if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { |
4529 | DPRINTK(PROBE, ERR, "PHY not supported on this NIC %d\n", err); | 4539 | dev_err(&adapter->pdev->dev, "failed to initialize because " |
4540 | "an unsupported SFP+ module type was detected.\n" | ||
4541 | "Reload the driver after installing a supported " | ||
4542 | "module.\n"); | ||
4530 | ixgbe_down(adapter); | 4543 | ixgbe_down(adapter); |
4531 | return; | 4544 | return; |
4532 | } | 4545 | } |
@@ -5513,8 +5526,10 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
5513 | round_jiffies(jiffies + (2 * HZ))); | 5526 | round_jiffies(jiffies + (2 * HZ))); |
5514 | err = 0; | 5527 | err = 0; |
5515 | } else if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { | 5528 | } else if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { |
5516 | dev_err(&adapter->pdev->dev, "failed to load because an " | 5529 | dev_err(&adapter->pdev->dev, "failed to initialize because " |
5517 | "unsupported SFP+ module type was detected.\n"); | 5530 | "an unsupported SFP+ module type was detected.\n" |
5531 | "Reload the driver after installing a supported " | ||
5532 | "module.\n"); | ||
5518 | goto err_sw_init; | 5533 | goto err_sw_init; |
5519 | } else if (err) { | 5534 | } else if (err) { |
5520 | dev_err(&adapter->pdev->dev, "HW Init failed: %d\n", err); | 5535 | dev_err(&adapter->pdev->dev, "HW Init failed: %d\n", err); |
diff --git a/drivers/net/usb/cdc_eem.c b/drivers/net/usb/cdc_eem.c index 80e01778dd3b..cd35d50e46d4 100644 --- a/drivers/net/usb/cdc_eem.c +++ b/drivers/net/usb/cdc_eem.c | |||
@@ -319,7 +319,7 @@ static int eem_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
319 | return crc == crc2; | 319 | return crc == crc2; |
320 | 320 | ||
321 | if (unlikely(crc != crc2)) { | 321 | if (unlikely(crc != crc2)) { |
322 | dev->stats.rx_errors++; | 322 | dev->net->stats.rx_errors++; |
323 | dev_kfree_skb_any(skb2); | 323 | dev_kfree_skb_any(skb2); |
324 | } else | 324 | } else |
325 | usbnet_skb_return(dev, skb2); | 325 | usbnet_skb_return(dev, skb2); |
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c index 7ae82446b93a..1d3730d6690f 100644 --- a/drivers/net/usb/dm9601.c +++ b/drivers/net/usb/dm9601.c | |||
@@ -513,11 +513,11 @@ static int dm9601_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
513 | len = (skb->data[1] | (skb->data[2] << 8)) - 4; | 513 | len = (skb->data[1] | (skb->data[2] << 8)) - 4; |
514 | 514 | ||
515 | if (unlikely(status & 0xbf)) { | 515 | if (unlikely(status & 0xbf)) { |
516 | if (status & 0x01) dev->stats.rx_fifo_errors++; | 516 | if (status & 0x01) dev->net->stats.rx_fifo_errors++; |
517 | if (status & 0x02) dev->stats.rx_crc_errors++; | 517 | if (status & 0x02) dev->net->stats.rx_crc_errors++; |
518 | if (status & 0x04) dev->stats.rx_frame_errors++; | 518 | if (status & 0x04) dev->net->stats.rx_frame_errors++; |
519 | if (status & 0x20) dev->stats.rx_missed_errors++; | 519 | if (status & 0x20) dev->net->stats.rx_missed_errors++; |
520 | if (status & 0x90) dev->stats.rx_length_errors++; | 520 | if (status & 0x90) dev->net->stats.rx_length_errors++; |
521 | return 0; | 521 | return 0; |
522 | } | 522 | } |
523 | 523 | ||
diff --git a/drivers/net/usb/net1080.c b/drivers/net/usb/net1080.c index 034e8a73ca6b..aeb1ab03a9ee 100644 --- a/drivers/net/usb/net1080.c +++ b/drivers/net/usb/net1080.c | |||
@@ -433,7 +433,7 @@ static int net1080_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
433 | dbg("rx framesize %d range %d..%d mtu %d", skb->len, | 433 | dbg("rx framesize %d range %d..%d mtu %d", skb->len, |
434 | net->hard_header_len, dev->hard_mtu, net->mtu); | 434 | net->hard_header_len, dev->hard_mtu, net->mtu); |
435 | #endif | 435 | #endif |
436 | dev->stats.rx_frame_errors++; | 436 | dev->net->stats.rx_frame_errors++; |
437 | nc_ensure_sync(dev); | 437 | nc_ensure_sync(dev); |
438 | return 0; | 438 | return 0; |
439 | } | 439 | } |
@@ -442,12 +442,12 @@ static int net1080_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
442 | hdr_len = le16_to_cpup(&header->hdr_len); | 442 | hdr_len = le16_to_cpup(&header->hdr_len); |
443 | packet_len = le16_to_cpup(&header->packet_len); | 443 | packet_len = le16_to_cpup(&header->packet_len); |
444 | if (FRAMED_SIZE(packet_len) > NC_MAX_PACKET) { | 444 | if (FRAMED_SIZE(packet_len) > NC_MAX_PACKET) { |
445 | dev->stats.rx_frame_errors++; | 445 | dev->net->stats.rx_frame_errors++; |
446 | dbg("packet too big, %d", packet_len); | 446 | dbg("packet too big, %d", packet_len); |
447 | nc_ensure_sync(dev); | 447 | nc_ensure_sync(dev); |
448 | return 0; | 448 | return 0; |
449 | } else if (hdr_len < MIN_HEADER) { | 449 | } else if (hdr_len < MIN_HEADER) { |
450 | dev->stats.rx_frame_errors++; | 450 | dev->net->stats.rx_frame_errors++; |
451 | dbg("header too short, %d", hdr_len); | 451 | dbg("header too short, %d", hdr_len); |
452 | nc_ensure_sync(dev); | 452 | nc_ensure_sync(dev); |
453 | return 0; | 453 | return 0; |
@@ -465,21 +465,21 @@ static int net1080_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
465 | 465 | ||
466 | if ((packet_len & 0x01) == 0) { | 466 | if ((packet_len & 0x01) == 0) { |
467 | if (skb->data [packet_len] != PAD_BYTE) { | 467 | if (skb->data [packet_len] != PAD_BYTE) { |
468 | dev->stats.rx_frame_errors++; | 468 | dev->net->stats.rx_frame_errors++; |
469 | dbg("bad pad"); | 469 | dbg("bad pad"); |
470 | return 0; | 470 | return 0; |
471 | } | 471 | } |
472 | skb_trim(skb, skb->len - 1); | 472 | skb_trim(skb, skb->len - 1); |
473 | } | 473 | } |
474 | if (skb->len != packet_len) { | 474 | if (skb->len != packet_len) { |
475 | dev->stats.rx_frame_errors++; | 475 | dev->net->stats.rx_frame_errors++; |
476 | dbg("bad packet len %d (expected %d)", | 476 | dbg("bad packet len %d (expected %d)", |
477 | skb->len, packet_len); | 477 | skb->len, packet_len); |
478 | nc_ensure_sync(dev); | 478 | nc_ensure_sync(dev); |
479 | return 0; | 479 | return 0; |
480 | } | 480 | } |
481 | if (header->packet_id != get_unaligned(&trailer->packet_id)) { | 481 | if (header->packet_id != get_unaligned(&trailer->packet_id)) { |
482 | dev->stats.rx_fifo_errors++; | 482 | dev->net->stats.rx_fifo_errors++; |
483 | dbg("(2+ dropped) rx packet_id mismatch 0x%x 0x%x", | 483 | dbg("(2+ dropped) rx packet_id mismatch 0x%x 0x%x", |
484 | le16_to_cpu(header->packet_id), | 484 | le16_to_cpu(header->packet_id), |
485 | le16_to_cpu(trailer->packet_id)); | 485 | le16_to_cpu(trailer->packet_id)); |
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c index 1bf243ef950e..2232232b7989 100644 --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c | |||
@@ -487,7 +487,7 @@ int rndis_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
487 | if (unlikely(hdr->msg_type != RNDIS_MSG_PACKET | 487 | if (unlikely(hdr->msg_type != RNDIS_MSG_PACKET |
488 | || skb->len < msg_len | 488 | || skb->len < msg_len |
489 | || (data_offset + data_len + 8) > msg_len)) { | 489 | || (data_offset + data_len + 8) > msg_len)) { |
490 | dev->stats.rx_frame_errors++; | 490 | dev->net->stats.rx_frame_errors++; |
491 | devdbg(dev, "bad rndis message %d/%d/%d/%d, len %d", | 491 | devdbg(dev, "bad rndis message %d/%d/%d/%d, len %d", |
492 | le32_to_cpu(hdr->msg_type), | 492 | le32_to_cpu(hdr->msg_type), |
493 | msg_len, data_offset, data_len, skb->len); | 493 | msg_len, data_offset, data_len, skb->len); |
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index 89a91f8c22de..fe045896406b 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c | |||
@@ -1108,18 +1108,18 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
1108 | if (unlikely(header & RX_STS_ES_)) { | 1108 | if (unlikely(header & RX_STS_ES_)) { |
1109 | if (netif_msg_rx_err(dev)) | 1109 | if (netif_msg_rx_err(dev)) |
1110 | devdbg(dev, "Error header=0x%08x", header); | 1110 | devdbg(dev, "Error header=0x%08x", header); |
1111 | dev->stats.rx_errors++; | 1111 | dev->net->stats.rx_errors++; |
1112 | dev->stats.rx_dropped++; | 1112 | dev->net->stats.rx_dropped++; |
1113 | 1113 | ||
1114 | if (header & RX_STS_CRC_) { | 1114 | if (header & RX_STS_CRC_) { |
1115 | dev->stats.rx_crc_errors++; | 1115 | dev->net->stats.rx_crc_errors++; |
1116 | } else { | 1116 | } else { |
1117 | if (header & (RX_STS_TL_ | RX_STS_RF_)) | 1117 | if (header & (RX_STS_TL_ | RX_STS_RF_)) |
1118 | dev->stats.rx_frame_errors++; | 1118 | dev->net->stats.rx_frame_errors++; |
1119 | 1119 | ||
1120 | if ((header & RX_STS_LE_) && | 1120 | if ((header & RX_STS_LE_) && |
1121 | (!(header & RX_STS_FT_))) | 1121 | (!(header & RX_STS_FT_))) |
1122 | dev->stats.rx_length_errors++; | 1122 | dev->net->stats.rx_length_errors++; |
1123 | } | 1123 | } |
1124 | } else { | 1124 | } else { |
1125 | /* ETH_FRAME_LEN + 4(CRC) + 2(COE) + 4(Vlan) */ | 1125 | /* ETH_FRAME_LEN + 4(CRC) + 2(COE) + 4(Vlan) */ |
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 22c0585a0319..edfd9e10ceba 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -234,8 +234,8 @@ void usbnet_skb_return (struct usbnet *dev, struct sk_buff *skb) | |||
234 | int status; | 234 | int status; |
235 | 235 | ||
236 | skb->protocol = eth_type_trans (skb, dev->net); | 236 | skb->protocol = eth_type_trans (skb, dev->net); |
237 | dev->stats.rx_packets++; | 237 | dev->net->stats.rx_packets++; |
238 | dev->stats.rx_bytes += skb->len; | 238 | dev->net->stats.rx_bytes += skb->len; |
239 | 239 | ||
240 | if (netif_msg_rx_status (dev)) | 240 | if (netif_msg_rx_status (dev)) |
241 | devdbg (dev, "< rx, len %zu, type 0x%x", | 241 | devdbg (dev, "< rx, len %zu, type 0x%x", |
@@ -397,7 +397,7 @@ static inline void rx_process (struct usbnet *dev, struct sk_buff *skb) | |||
397 | if (netif_msg_rx_err (dev)) | 397 | if (netif_msg_rx_err (dev)) |
398 | devdbg (dev, "drop"); | 398 | devdbg (dev, "drop"); |
399 | error: | 399 | error: |
400 | dev->stats.rx_errors++; | 400 | dev->net->stats.rx_errors++; |
401 | skb_queue_tail (&dev->done, skb); | 401 | skb_queue_tail (&dev->done, skb); |
402 | } | 402 | } |
403 | } | 403 | } |
@@ -420,8 +420,8 @@ static void rx_complete (struct urb *urb) | |||
420 | case 0: | 420 | case 0: |
421 | if (skb->len < dev->net->hard_header_len) { | 421 | if (skb->len < dev->net->hard_header_len) { |
422 | entry->state = rx_cleanup; | 422 | entry->state = rx_cleanup; |
423 | dev->stats.rx_errors++; | 423 | dev->net->stats.rx_errors++; |
424 | dev->stats.rx_length_errors++; | 424 | dev->net->stats.rx_length_errors++; |
425 | if (netif_msg_rx_err (dev)) | 425 | if (netif_msg_rx_err (dev)) |
426 | devdbg (dev, "rx length %d", skb->len); | 426 | devdbg (dev, "rx length %d", skb->len); |
427 | } | 427 | } |
@@ -433,7 +433,7 @@ static void rx_complete (struct urb *urb) | |||
433 | * storm, recovering as needed. | 433 | * storm, recovering as needed. |
434 | */ | 434 | */ |
435 | case -EPIPE: | 435 | case -EPIPE: |
436 | dev->stats.rx_errors++; | 436 | dev->net->stats.rx_errors++; |
437 | usbnet_defer_kevent (dev, EVENT_RX_HALT); | 437 | usbnet_defer_kevent (dev, EVENT_RX_HALT); |
438 | // FALLTHROUGH | 438 | // FALLTHROUGH |
439 | 439 | ||
@@ -451,7 +451,7 @@ static void rx_complete (struct urb *urb) | |||
451 | case -EPROTO: | 451 | case -EPROTO: |
452 | case -ETIME: | 452 | case -ETIME: |
453 | case -EILSEQ: | 453 | case -EILSEQ: |
454 | dev->stats.rx_errors++; | 454 | dev->net->stats.rx_errors++; |
455 | if (!timer_pending (&dev->delay)) { | 455 | if (!timer_pending (&dev->delay)) { |
456 | mod_timer (&dev->delay, jiffies + THROTTLE_JIFFIES); | 456 | mod_timer (&dev->delay, jiffies + THROTTLE_JIFFIES); |
457 | if (netif_msg_link (dev)) | 457 | if (netif_msg_link (dev)) |
@@ -465,12 +465,12 @@ block: | |||
465 | 465 | ||
466 | /* data overrun ... flush fifo? */ | 466 | /* data overrun ... flush fifo? */ |
467 | case -EOVERFLOW: | 467 | case -EOVERFLOW: |
468 | dev->stats.rx_over_errors++; | 468 | dev->net->stats.rx_over_errors++; |
469 | // FALLTHROUGH | 469 | // FALLTHROUGH |
470 | 470 | ||
471 | default: | 471 | default: |
472 | entry->state = rx_cleanup; | 472 | entry->state = rx_cleanup; |
473 | dev->stats.rx_errors++; | 473 | dev->net->stats.rx_errors++; |
474 | if (netif_msg_rx_err (dev)) | 474 | if (netif_msg_rx_err (dev)) |
475 | devdbg (dev, "rx status %d", urb_status); | 475 | devdbg (dev, "rx status %d", urb_status); |
476 | break; | 476 | break; |
@@ -583,8 +583,8 @@ int usbnet_stop (struct net_device *net) | |||
583 | 583 | ||
584 | if (netif_msg_ifdown (dev)) | 584 | if (netif_msg_ifdown (dev)) |
585 | devinfo (dev, "stop stats: rx/tx %ld/%ld, errs %ld/%ld", | 585 | devinfo (dev, "stop stats: rx/tx %ld/%ld, errs %ld/%ld", |
586 | dev->stats.rx_packets, dev->stats.tx_packets, | 586 | net->stats.rx_packets, net->stats.tx_packets, |
587 | dev->stats.rx_errors, dev->stats.tx_errors | 587 | net->stats.rx_errors, net->stats.tx_errors |
588 | ); | 588 | ); |
589 | 589 | ||
590 | // ensure there are no more active urbs | 590 | // ensure there are no more active urbs |
@@ -891,10 +891,10 @@ static void tx_complete (struct urb *urb) | |||
891 | struct usbnet *dev = entry->dev; | 891 | struct usbnet *dev = entry->dev; |
892 | 892 | ||
893 | if (urb->status == 0) { | 893 | if (urb->status == 0) { |
894 | dev->stats.tx_packets++; | 894 | dev->net->stats.tx_packets++; |
895 | dev->stats.tx_bytes += entry->length; | 895 | dev->net->stats.tx_bytes += entry->length; |
896 | } else { | 896 | } else { |
897 | dev->stats.tx_errors++; | 897 | dev->net->stats.tx_errors++; |
898 | 898 | ||
899 | switch (urb->status) { | 899 | switch (urb->status) { |
900 | case -EPIPE: | 900 | case -EPIPE: |
@@ -1020,7 +1020,7 @@ int usbnet_start_xmit (struct sk_buff *skb, struct net_device *net) | |||
1020 | devdbg (dev, "drop, code %d", retval); | 1020 | devdbg (dev, "drop, code %d", retval); |
1021 | drop: | 1021 | drop: |
1022 | retval = NET_XMIT_SUCCESS; | 1022 | retval = NET_XMIT_SUCCESS; |
1023 | dev->stats.tx_dropped++; | 1023 | dev->net->stats.tx_dropped++; |
1024 | if (skb) | 1024 | if (skb) |
1025 | dev_kfree_skb_any (skb); | 1025 | dev_kfree_skb_any (skb); |
1026 | usb_free_urb (urb); | 1026 | usb_free_urb (urb); |
diff --git a/include/linux/netfilter/xt_conntrack.h b/include/linux/netfilter/xt_conntrack.h index 3430c7751948..7ae05338e94c 100644 --- a/include/linux/netfilter/xt_conntrack.h +++ b/include/linux/netfilter/xt_conntrack.h | |||
@@ -81,4 +81,17 @@ struct xt_conntrack_mtinfo1 { | |||
81 | __u8 state_mask, status_mask; | 81 | __u8 state_mask, status_mask; |
82 | }; | 82 | }; |
83 | 83 | ||
84 | struct xt_conntrack_mtinfo2 { | ||
85 | union nf_inet_addr origsrc_addr, origsrc_mask; | ||
86 | union nf_inet_addr origdst_addr, origdst_mask; | ||
87 | union nf_inet_addr replsrc_addr, replsrc_mask; | ||
88 | union nf_inet_addr repldst_addr, repldst_mask; | ||
89 | __u32 expires_min, expires_max; | ||
90 | __u16 l4proto; | ||
91 | __be16 origsrc_port, origdst_port; | ||
92 | __be16 replsrc_port, repldst_port; | ||
93 | __u16 match_flags, invert_flags; | ||
94 | __u16 state_mask, status_mask; | ||
95 | }; | ||
96 | |||
84 | #endif /*_XT_CONNTRACK_H*/ | 97 | #endif /*_XT_CONNTRACK_H*/ |
diff --git a/include/linux/netfilter/xt_osf.h b/include/linux/netfilter/xt_osf.h index fd2272e0959a..18afa495f973 100644 --- a/include/linux/netfilter/xt_osf.h +++ b/include/linux/netfilter/xt_osf.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #ifndef _XT_OSF_H | 20 | #ifndef _XT_OSF_H |
21 | #define _XT_OSF_H | 21 | #define _XT_OSF_H |
22 | 22 | ||
23 | #include <linux/types.h> | ||
24 | |||
23 | #define MAXGENRELEN 32 | 25 | #define MAXGENRELEN 32 |
24 | 26 | ||
25 | #define XT_OSF_GENRE (1<<0) | 27 | #define XT_OSF_GENRE (1<<0) |
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index 5d44059f6d63..310e18a880ff 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
@@ -42,7 +42,6 @@ struct usbnet { | |||
42 | 42 | ||
43 | /* protocol/interface state */ | 43 | /* protocol/interface state */ |
44 | struct net_device *net; | 44 | struct net_device *net; |
45 | struct net_device_stats stats; | ||
46 | int msg_enable; | 45 | int msg_enable; |
47 | unsigned long data [5]; | 46 | unsigned long data [5]; |
48 | u32 xid; | 47 | u32 xid; |
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index a632689b61b4..cbdd6284996d 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
@@ -258,8 +258,8 @@ static inline bool nf_ct_kill(struct nf_conn *ct) | |||
258 | /* Update TCP window tracking data when NAT mangles the packet */ | 258 | /* Update TCP window tracking data when NAT mangles the packet */ |
259 | extern void nf_conntrack_tcp_update(const struct sk_buff *skb, | 259 | extern void nf_conntrack_tcp_update(const struct sk_buff *skb, |
260 | unsigned int dataoff, | 260 | unsigned int dataoff, |
261 | struct nf_conn *ct, | 261 | struct nf_conn *ct, int dir, |
262 | int dir); | 262 | s16 offset); |
263 | 263 | ||
264 | /* Fake conntrack entry for untracked connections */ | 264 | /* Fake conntrack entry for untracked connections */ |
265 | extern struct nf_conn nf_conntrack_untracked; | 265 | extern struct nf_conn nf_conntrack_untracked; |
diff --git a/net/ieee802154/netlink.c b/net/ieee802154/netlink.c index 105ad10876af..27eda9fdf3c2 100644 --- a/net/ieee802154/netlink.c +++ b/net/ieee802154/netlink.c | |||
@@ -276,6 +276,9 @@ static struct net_device *ieee802154_nl_get_dev(struct genl_info *info) | |||
276 | else | 276 | else |
277 | return NULL; | 277 | return NULL; |
278 | 278 | ||
279 | if (!dev) | ||
280 | return NULL; | ||
281 | |||
279 | if (dev->type != ARPHRD_IEEE802154) { | 282 | if (dev->type != ARPHRD_IEEE802154) { |
280 | dev_put(dev); | 283 | dev_put(dev); |
281 | return NULL; | 284 | return NULL; |
@@ -521,3 +524,6 @@ static void __exit ieee802154_nl_exit(void) | |||
521 | } | 524 | } |
522 | module_exit(ieee802154_nl_exit); | 525 | module_exit(ieee802154_nl_exit); |
523 | 526 | ||
527 | MODULE_LICENSE("GPL v2"); | ||
528 | MODULE_DESCRIPTION("ieee 802.15.4 configuration interface"); | ||
529 | |||
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 8a3881e28aca..c29d75d8f1b1 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c | |||
@@ -801,11 +801,8 @@ static int arp_process(struct sk_buff *skb) | |||
801 | * cache. | 801 | * cache. |
802 | */ | 802 | */ |
803 | 803 | ||
804 | /* | 804 | /* Special case: IPv4 duplicate address detection packet (RFC2131) */ |
805 | * Special case: IPv4 duplicate address detection packet (RFC2131) | 805 | if (sip == 0) { |
806 | * and Gratuitous ARP/ARP Announce. (RFC3927, Section 2.4) | ||
807 | */ | ||
808 | if (sip == 0 || tip == sip) { | ||
809 | if (arp->ar_op == htons(ARPOP_REQUEST) && | 806 | if (arp->ar_op == htons(ARPOP_REQUEST) && |
810 | inet_addr_type(net, tip) == RTN_LOCAL && | 807 | inet_addr_type(net, tip) == RTN_LOCAL && |
811 | !arp_ignore(in_dev, sip, tip)) | 808 | !arp_ignore(in_dev, sip, tip)) |
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 012cf5a68581..00a54b246dfe 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
@@ -1021,6 +1021,9 @@ static void trie_rebalance(struct trie *t, struct tnode *tn) | |||
1021 | (struct node *)tn, wasfull); | 1021 | (struct node *)tn, wasfull); |
1022 | 1022 | ||
1023 | tp = node_parent((struct node *) tn); | 1023 | tp = node_parent((struct node *) tn); |
1024 | if (!tp) | ||
1025 | rcu_assign_pointer(t->trie, (struct node *)tn); | ||
1026 | |||
1024 | tnode_free_flush(); | 1027 | tnode_free_flush(); |
1025 | if (!tp) | 1028 | if (!tp) |
1026 | break; | 1029 | break; |
diff --git a/net/ipv4/netfilter/nf_nat_helper.c b/net/ipv4/netfilter/nf_nat_helper.c index 155c008626c8..09172a65d9b6 100644 --- a/net/ipv4/netfilter/nf_nat_helper.c +++ b/net/ipv4/netfilter/nf_nat_helper.c | |||
@@ -191,7 +191,8 @@ nf_nat_mangle_tcp_packet(struct sk_buff *skb, | |||
191 | ct, ctinfo); | 191 | ct, ctinfo); |
192 | /* Tell TCP window tracking about seq change */ | 192 | /* Tell TCP window tracking about seq change */ |
193 | nf_conntrack_tcp_update(skb, ip_hdrlen(skb), | 193 | nf_conntrack_tcp_update(skb, ip_hdrlen(skb), |
194 | ct, CTINFO2DIR(ctinfo)); | 194 | ct, CTINFO2DIR(ctinfo), |
195 | (int)rep_len - (int)match_len); | ||
195 | 196 | ||
196 | nf_conntrack_event_cache(IPCT_NATSEQADJ, ct); | 197 | nf_conntrack_event_cache(IPCT_NATSEQADJ, ct); |
197 | } | 198 | } |
@@ -377,6 +378,7 @@ nf_nat_seq_adjust(struct sk_buff *skb, | |||
377 | struct tcphdr *tcph; | 378 | struct tcphdr *tcph; |
378 | int dir; | 379 | int dir; |
379 | __be32 newseq, newack; | 380 | __be32 newseq, newack; |
381 | s16 seqoff, ackoff; | ||
380 | struct nf_conn_nat *nat = nfct_nat(ct); | 382 | struct nf_conn_nat *nat = nfct_nat(ct); |
381 | struct nf_nat_seq *this_way, *other_way; | 383 | struct nf_nat_seq *this_way, *other_way; |
382 | 384 | ||
@@ -390,15 +392,18 @@ nf_nat_seq_adjust(struct sk_buff *skb, | |||
390 | 392 | ||
391 | tcph = (void *)skb->data + ip_hdrlen(skb); | 393 | tcph = (void *)skb->data + ip_hdrlen(skb); |
392 | if (after(ntohl(tcph->seq), this_way->correction_pos)) | 394 | if (after(ntohl(tcph->seq), this_way->correction_pos)) |
393 | newseq = htonl(ntohl(tcph->seq) + this_way->offset_after); | 395 | seqoff = this_way->offset_after; |
394 | else | 396 | else |
395 | newseq = htonl(ntohl(tcph->seq) + this_way->offset_before); | 397 | seqoff = this_way->offset_before; |
396 | 398 | ||
397 | if (after(ntohl(tcph->ack_seq) - other_way->offset_before, | 399 | if (after(ntohl(tcph->ack_seq) - other_way->offset_before, |
398 | other_way->correction_pos)) | 400 | other_way->correction_pos)) |
399 | newack = htonl(ntohl(tcph->ack_seq) - other_way->offset_after); | 401 | ackoff = other_way->offset_after; |
400 | else | 402 | else |
401 | newack = htonl(ntohl(tcph->ack_seq) - other_way->offset_before); | 403 | ackoff = other_way->offset_before; |
404 | |||
405 | newseq = htonl(ntohl(tcph->seq) + seqoff); | ||
406 | newack = htonl(ntohl(tcph->ack_seq) - ackoff); | ||
402 | 407 | ||
403 | inet_proto_csum_replace4(&tcph->check, skb, tcph->seq, newseq, 0); | 408 | inet_proto_csum_replace4(&tcph->check, skb, tcph->seq, newseq, 0); |
404 | inet_proto_csum_replace4(&tcph->check, skb, tcph->ack_seq, newack, 0); | 409 | inet_proto_csum_replace4(&tcph->check, skb, tcph->ack_seq, newack, 0); |
@@ -413,7 +418,7 @@ nf_nat_seq_adjust(struct sk_buff *skb, | |||
413 | if (!nf_nat_sack_adjust(skb, tcph, ct, ctinfo)) | 418 | if (!nf_nat_sack_adjust(skb, tcph, ct, ctinfo)) |
414 | return 0; | 419 | return 0; |
415 | 420 | ||
416 | nf_conntrack_tcp_update(skb, ip_hdrlen(skb), ct, dir); | 421 | nf_conntrack_tcp_update(skb, ip_hdrlen(skb), ct, dir, seqoff); |
417 | 422 | ||
418 | return 1; | 423 | return 1; |
419 | } | 424 | } |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 17b89c523f9d..7870a535dac6 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -903,13 +903,17 @@ int tcp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, | |||
903 | iov++; | 903 | iov++; |
904 | 904 | ||
905 | while (seglen > 0) { | 905 | while (seglen > 0) { |
906 | int copy; | 906 | int copy = 0; |
907 | int max = size_goal; | ||
907 | 908 | ||
908 | skb = tcp_write_queue_tail(sk); | 909 | skb = tcp_write_queue_tail(sk); |
910 | if (tcp_send_head(sk)) { | ||
911 | if (skb->ip_summed == CHECKSUM_NONE) | ||
912 | max = mss_now; | ||
913 | copy = max - skb->len; | ||
914 | } | ||
909 | 915 | ||
910 | if (!tcp_send_head(sk) || | 916 | if (copy <= 0) { |
911 | (copy = size_goal - skb->len) <= 0) { | ||
912 | |||
913 | new_segment: | 917 | new_segment: |
914 | /* Allocate new segment. If the interface is SG, | 918 | /* Allocate new segment. If the interface is SG, |
915 | * allocate skb fitting to single page. | 919 | * allocate skb fitting to single page. |
@@ -930,6 +934,7 @@ new_segment: | |||
930 | 934 | ||
931 | skb_entail(sk, skb); | 935 | skb_entail(sk, skb); |
932 | copy = size_goal; | 936 | copy = size_goal; |
937 | max = size_goal; | ||
933 | } | 938 | } |
934 | 939 | ||
935 | /* Try to append data to the end of skb. */ | 940 | /* Try to append data to the end of skb. */ |
@@ -1028,7 +1033,7 @@ new_segment: | |||
1028 | if ((seglen -= copy) == 0 && iovlen == 0) | 1033 | if ((seglen -= copy) == 0 && iovlen == 0) |
1029 | goto out; | 1034 | goto out; |
1030 | 1035 | ||
1031 | if (skb->len < size_goal || (flags & MSG_OOB)) | 1036 | if (skb->len < max || (flags & MSG_OOB)) |
1032 | continue; | 1037 | continue; |
1033 | 1038 | ||
1034 | if (forced_push(tp)) { | 1039 | if (forced_push(tp)) { |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 416fc4c2e7eb..5bdf08d312d9 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -725,7 +725,8 @@ static void tcp_queue_skb(struct sock *sk, struct sk_buff *skb) | |||
725 | static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb, | 725 | static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb, |
726 | unsigned int mss_now) | 726 | unsigned int mss_now) |
727 | { | 727 | { |
728 | if (skb->len <= mss_now || !sk_can_gso(sk)) { | 728 | if (skb->len <= mss_now || !sk_can_gso(sk) || |
729 | skb->ip_summed == CHECKSUM_NONE) { | ||
729 | /* Avoid the costly divide in the normal | 730 | /* Avoid the costly divide in the normal |
730 | * non-TSO case. | 731 | * non-TSO case. |
731 | */ | 732 | */ |
diff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c index afde8f991646..2032dfe25ca8 100644 --- a/net/netfilter/nf_conntrack_expect.c +++ b/net/netfilter/nf_conntrack_expect.c | |||
@@ -617,8 +617,10 @@ err1: | |||
617 | void nf_conntrack_expect_fini(struct net *net) | 617 | void nf_conntrack_expect_fini(struct net *net) |
618 | { | 618 | { |
619 | exp_proc_remove(net); | 619 | exp_proc_remove(net); |
620 | if (net_eq(net, &init_net)) | 620 | if (net_eq(net, &init_net)) { |
621 | rcu_barrier(); /* Wait for call_rcu() before destroy */ | ||
621 | kmem_cache_destroy(nf_ct_expect_cachep); | 622 | kmem_cache_destroy(nf_ct_expect_cachep); |
623 | } | ||
622 | nf_ct_free_hashtable(net->ct.expect_hash, net->ct.expect_vmalloc, | 624 | nf_ct_free_hashtable(net->ct.expect_hash, net->ct.expect_vmalloc, |
623 | nf_ct_expect_hsize); | 625 | nf_ct_expect_hsize); |
624 | } | 626 | } |
diff --git a/net/netfilter/nf_conntrack_extend.c b/net/netfilter/nf_conntrack_extend.c index 4b2c769d555f..fef95be334bd 100644 --- a/net/netfilter/nf_conntrack_extend.c +++ b/net/netfilter/nf_conntrack_extend.c | |||
@@ -186,6 +186,6 @@ void nf_ct_extend_unregister(struct nf_ct_ext_type *type) | |||
186 | rcu_assign_pointer(nf_ct_ext_types[type->id], NULL); | 186 | rcu_assign_pointer(nf_ct_ext_types[type->id], NULL); |
187 | update_alloc_size(type); | 187 | update_alloc_size(type); |
188 | mutex_unlock(&nf_ct_ext_type_mutex); | 188 | mutex_unlock(&nf_ct_ext_type_mutex); |
189 | synchronize_rcu(); | 189 | rcu_barrier(); /* Wait for completion of call_rcu()'s */ |
190 | } | 190 | } |
191 | EXPORT_SYMBOL_GPL(nf_ct_extend_unregister); | 191 | EXPORT_SYMBOL_GPL(nf_ct_extend_unregister); |
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c index 33fc0a443f3d..97a82ba75376 100644 --- a/net/netfilter/nf_conntrack_proto_tcp.c +++ b/net/netfilter/nf_conntrack_proto_tcp.c | |||
@@ -720,8 +720,8 @@ static bool tcp_in_window(const struct nf_conn *ct, | |||
720 | /* Caller must linearize skb at tcp header. */ | 720 | /* Caller must linearize skb at tcp header. */ |
721 | void nf_conntrack_tcp_update(const struct sk_buff *skb, | 721 | void nf_conntrack_tcp_update(const struct sk_buff *skb, |
722 | unsigned int dataoff, | 722 | unsigned int dataoff, |
723 | struct nf_conn *ct, | 723 | struct nf_conn *ct, int dir, |
724 | int dir) | 724 | s16 offset) |
725 | { | 725 | { |
726 | const struct tcphdr *tcph = (const void *)skb->data + dataoff; | 726 | const struct tcphdr *tcph = (const void *)skb->data + dataoff; |
727 | const struct ip_ct_tcp_state *sender = &ct->proto.tcp.seen[dir]; | 727 | const struct ip_ct_tcp_state *sender = &ct->proto.tcp.seen[dir]; |
@@ -734,7 +734,7 @@ void nf_conntrack_tcp_update(const struct sk_buff *skb, | |||
734 | /* | 734 | /* |
735 | * We have to worry for the ack in the reply packet only... | 735 | * We have to worry for the ack in the reply packet only... |
736 | */ | 736 | */ |
737 | if (after(end, ct->proto.tcp.seen[dir].td_end)) | 737 | if (ct->proto.tcp.seen[dir].td_end + offset == end) |
738 | ct->proto.tcp.seen[dir].td_end = end; | 738 | ct->proto.tcp.seen[dir].td_end = end; |
739 | ct->proto.tcp.last_end = end; | 739 | ct->proto.tcp.last_end = end; |
740 | spin_unlock_bh(&ct->lock); | 740 | spin_unlock_bh(&ct->lock); |
diff --git a/net/netfilter/xt_conntrack.c b/net/netfilter/xt_conntrack.c index 0b7139f3dd78..fc581800698e 100644 --- a/net/netfilter/xt_conntrack.c +++ b/net/netfilter/xt_conntrack.c | |||
@@ -129,7 +129,7 @@ conntrack_addrcmp(const union nf_inet_addr *kaddr, | |||
129 | 129 | ||
130 | static inline bool | 130 | static inline bool |
131 | conntrack_mt_origsrc(const struct nf_conn *ct, | 131 | conntrack_mt_origsrc(const struct nf_conn *ct, |
132 | const struct xt_conntrack_mtinfo1 *info, | 132 | const struct xt_conntrack_mtinfo2 *info, |
133 | u_int8_t family) | 133 | u_int8_t family) |
134 | { | 134 | { |
135 | return conntrack_addrcmp(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3, | 135 | return conntrack_addrcmp(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3, |
@@ -138,7 +138,7 @@ conntrack_mt_origsrc(const struct nf_conn *ct, | |||
138 | 138 | ||
139 | static inline bool | 139 | static inline bool |
140 | conntrack_mt_origdst(const struct nf_conn *ct, | 140 | conntrack_mt_origdst(const struct nf_conn *ct, |
141 | const struct xt_conntrack_mtinfo1 *info, | 141 | const struct xt_conntrack_mtinfo2 *info, |
142 | u_int8_t family) | 142 | u_int8_t family) |
143 | { | 143 | { |
144 | return conntrack_addrcmp(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.u3, | 144 | return conntrack_addrcmp(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.u3, |
@@ -147,7 +147,7 @@ conntrack_mt_origdst(const struct nf_conn *ct, | |||
147 | 147 | ||
148 | static inline bool | 148 | static inline bool |
149 | conntrack_mt_replsrc(const struct nf_conn *ct, | 149 | conntrack_mt_replsrc(const struct nf_conn *ct, |
150 | const struct xt_conntrack_mtinfo1 *info, | 150 | const struct xt_conntrack_mtinfo2 *info, |
151 | u_int8_t family) | 151 | u_int8_t family) |
152 | { | 152 | { |
153 | return conntrack_addrcmp(&ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.u3, | 153 | return conntrack_addrcmp(&ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.u3, |
@@ -156,7 +156,7 @@ conntrack_mt_replsrc(const struct nf_conn *ct, | |||
156 | 156 | ||
157 | static inline bool | 157 | static inline bool |
158 | conntrack_mt_repldst(const struct nf_conn *ct, | 158 | conntrack_mt_repldst(const struct nf_conn *ct, |
159 | const struct xt_conntrack_mtinfo1 *info, | 159 | const struct xt_conntrack_mtinfo2 *info, |
160 | u_int8_t family) | 160 | u_int8_t family) |
161 | { | 161 | { |
162 | return conntrack_addrcmp(&ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3, | 162 | return conntrack_addrcmp(&ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3, |
@@ -164,7 +164,7 @@ conntrack_mt_repldst(const struct nf_conn *ct, | |||
164 | } | 164 | } |
165 | 165 | ||
166 | static inline bool | 166 | static inline bool |
167 | ct_proto_port_check(const struct xt_conntrack_mtinfo1 *info, | 167 | ct_proto_port_check(const struct xt_conntrack_mtinfo2 *info, |
168 | const struct nf_conn *ct) | 168 | const struct nf_conn *ct) |
169 | { | 169 | { |
170 | const struct nf_conntrack_tuple *tuple; | 170 | const struct nf_conntrack_tuple *tuple; |
@@ -204,7 +204,7 @@ ct_proto_port_check(const struct xt_conntrack_mtinfo1 *info, | |||
204 | static bool | 204 | static bool |
205 | conntrack_mt(const struct sk_buff *skb, const struct xt_match_param *par) | 205 | conntrack_mt(const struct sk_buff *skb, const struct xt_match_param *par) |
206 | { | 206 | { |
207 | const struct xt_conntrack_mtinfo1 *info = par->matchinfo; | 207 | const struct xt_conntrack_mtinfo2 *info = par->matchinfo; |
208 | enum ip_conntrack_info ctinfo; | 208 | enum ip_conntrack_info ctinfo; |
209 | const struct nf_conn *ct; | 209 | const struct nf_conn *ct; |
210 | unsigned int statebit; | 210 | unsigned int statebit; |
@@ -278,6 +278,16 @@ conntrack_mt(const struct sk_buff *skb, const struct xt_match_param *par) | |||
278 | return true; | 278 | return true; |
279 | } | 279 | } |
280 | 280 | ||
281 | static bool | ||
282 | conntrack_mt_v1(const struct sk_buff *skb, const struct xt_match_param *par) | ||
283 | { | ||
284 | const struct xt_conntrack_mtinfo2 *const *info = par->matchinfo; | ||
285 | struct xt_match_param newpar = *par; | ||
286 | |||
287 | newpar.matchinfo = *info; | ||
288 | return conntrack_mt(skb, &newpar); | ||
289 | } | ||
290 | |||
281 | static bool conntrack_mt_check(const struct xt_mtchk_param *par) | 291 | static bool conntrack_mt_check(const struct xt_mtchk_param *par) |
282 | { | 292 | { |
283 | if (nf_ct_l3proto_try_module_get(par->family) < 0) { | 293 | if (nf_ct_l3proto_try_module_get(par->family) < 0) { |
@@ -288,11 +298,45 @@ static bool conntrack_mt_check(const struct xt_mtchk_param *par) | |||
288 | return true; | 298 | return true; |
289 | } | 299 | } |
290 | 300 | ||
301 | static bool conntrack_mt_check_v1(const struct xt_mtchk_param *par) | ||
302 | { | ||
303 | struct xt_conntrack_mtinfo1 *info = par->matchinfo; | ||
304 | struct xt_conntrack_mtinfo2 *up; | ||
305 | int ret = conntrack_mt_check(par); | ||
306 | |||
307 | if (ret < 0) | ||
308 | return ret; | ||
309 | |||
310 | up = kmalloc(sizeof(*up), GFP_KERNEL); | ||
311 | if (up == NULL) { | ||
312 | nf_ct_l3proto_module_put(par->family); | ||
313 | return -ENOMEM; | ||
314 | } | ||
315 | |||
316 | /* | ||
317 | * The strategy here is to minimize the overhead of v1 matching, | ||
318 | * by prebuilding a v2 struct and putting the pointer into the | ||
319 | * v1 dataspace. | ||
320 | */ | ||
321 | memcpy(up, info, offsetof(typeof(*info), state_mask)); | ||
322 | up->state_mask = info->state_mask; | ||
323 | up->status_mask = info->status_mask; | ||
324 | *(void **)info = up; | ||
325 | return true; | ||
326 | } | ||
327 | |||
291 | static void conntrack_mt_destroy(const struct xt_mtdtor_param *par) | 328 | static void conntrack_mt_destroy(const struct xt_mtdtor_param *par) |
292 | { | 329 | { |
293 | nf_ct_l3proto_module_put(par->family); | 330 | nf_ct_l3proto_module_put(par->family); |
294 | } | 331 | } |
295 | 332 | ||
333 | static void conntrack_mt_destroy_v1(const struct xt_mtdtor_param *par) | ||
334 | { | ||
335 | struct xt_conntrack_mtinfo2 **info = par->matchinfo; | ||
336 | kfree(*info); | ||
337 | conntrack_mt_destroy(par); | ||
338 | } | ||
339 | |||
296 | #ifdef CONFIG_COMPAT | 340 | #ifdef CONFIG_COMPAT |
297 | struct compat_xt_conntrack_info | 341 | struct compat_xt_conntrack_info |
298 | { | 342 | { |
@@ -363,6 +407,16 @@ static struct xt_match conntrack_mt_reg[] __read_mostly = { | |||
363 | .revision = 1, | 407 | .revision = 1, |
364 | .family = NFPROTO_UNSPEC, | 408 | .family = NFPROTO_UNSPEC, |
365 | .matchsize = sizeof(struct xt_conntrack_mtinfo1), | 409 | .matchsize = sizeof(struct xt_conntrack_mtinfo1), |
410 | .match = conntrack_mt_v1, | ||
411 | .checkentry = conntrack_mt_check_v1, | ||
412 | .destroy = conntrack_mt_destroy_v1, | ||
413 | .me = THIS_MODULE, | ||
414 | }, | ||
415 | { | ||
416 | .name = "conntrack", | ||
417 | .revision = 2, | ||
418 | .family = NFPROTO_UNSPEC, | ||
419 | .matchsize = sizeof(struct xt_conntrack_mtinfo2), | ||
366 | .match = conntrack_mt, | 420 | .match = conntrack_mt, |
367 | .checkentry = conntrack_mt_check, | 421 | .checkentry = conntrack_mt_check, |
368 | .destroy = conntrack_mt_destroy, | 422 | .destroy = conntrack_mt_destroy, |
diff --git a/net/sctp/output.c b/net/sctp/output.c index b76411444515..b94c21190566 100644 --- a/net/sctp/output.c +++ b/net/sctp/output.c | |||
@@ -407,7 +407,7 @@ int sctp_packet_transmit(struct sctp_packet *packet) | |||
407 | } | 407 | } |
408 | dst = dst_clone(tp->dst); | 408 | dst = dst_clone(tp->dst); |
409 | skb_dst_set(nskb, dst); | 409 | skb_dst_set(nskb, dst); |
410 | if (dst) | 410 | if (!dst) |
411 | goto no_route; | 411 | goto no_route; |
412 | 412 | ||
413 | /* Build the SCTP header. */ | 413 | /* Build the SCTP header. */ |
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 5f1f86565f16..f2f7c638083e 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
@@ -668,22 +668,10 @@ static struct xfrm_state *__xfrm_state_lookup(struct net *net, xfrm_address_t *d | |||
668 | hlist_for_each_entry(x, entry, net->xfrm.state_byspi+h, byspi) { | 668 | hlist_for_each_entry(x, entry, net->xfrm.state_byspi+h, byspi) { |
669 | if (x->props.family != family || | 669 | if (x->props.family != family || |
670 | x->id.spi != spi || | 670 | x->id.spi != spi || |
671 | x->id.proto != proto) | 671 | x->id.proto != proto || |
672 | xfrm_addr_cmp(&x->id.daddr, daddr, family)) | ||
672 | continue; | 673 | continue; |
673 | 674 | ||
674 | switch (family) { | ||
675 | case AF_INET: | ||
676 | if (x->id.daddr.a4 != daddr->a4) | ||
677 | continue; | ||
678 | break; | ||
679 | case AF_INET6: | ||
680 | if (!ipv6_addr_equal((struct in6_addr *)daddr, | ||
681 | (struct in6_addr *) | ||
682 | x->id.daddr.a6)) | ||
683 | continue; | ||
684 | break; | ||
685 | } | ||
686 | |||
687 | xfrm_state_hold(x); | 675 | xfrm_state_hold(x); |
688 | return x; | 676 | return x; |
689 | } | 677 | } |
@@ -699,26 +687,11 @@ static struct xfrm_state *__xfrm_state_lookup_byaddr(struct net *net, xfrm_addre | |||
699 | 687 | ||
700 | hlist_for_each_entry(x, entry, net->xfrm.state_bysrc+h, bysrc) { | 688 | hlist_for_each_entry(x, entry, net->xfrm.state_bysrc+h, bysrc) { |
701 | if (x->props.family != family || | 689 | if (x->props.family != family || |
702 | x->id.proto != proto) | 690 | x->id.proto != proto || |
691 | xfrm_addr_cmp(&x->id.daddr, daddr, family) || | ||
692 | xfrm_addr_cmp(&x->props.saddr, saddr, family)) | ||
703 | continue; | 693 | continue; |
704 | 694 | ||
705 | switch (family) { | ||
706 | case AF_INET: | ||
707 | if (x->id.daddr.a4 != daddr->a4 || | ||
708 | x->props.saddr.a4 != saddr->a4) | ||
709 | continue; | ||
710 | break; | ||
711 | case AF_INET6: | ||
712 | if (!ipv6_addr_equal((struct in6_addr *)daddr, | ||
713 | (struct in6_addr *) | ||
714 | x->id.daddr.a6) || | ||
715 | !ipv6_addr_equal((struct in6_addr *)saddr, | ||
716 | (struct in6_addr *) | ||
717 | x->props.saddr.a6)) | ||
718 | continue; | ||
719 | break; | ||
720 | } | ||
721 | |||
722 | xfrm_state_hold(x); | 695 | xfrm_state_hold(x); |
723 | return x; | 696 | return x; |
724 | } | 697 | } |
@@ -1001,25 +974,11 @@ static struct xfrm_state *__find_acq_core(struct net *net, unsigned short family | |||
1001 | x->props.family != family || | 974 | x->props.family != family || |
1002 | x->km.state != XFRM_STATE_ACQ || | 975 | x->km.state != XFRM_STATE_ACQ || |
1003 | x->id.spi != 0 || | 976 | x->id.spi != 0 || |
1004 | x->id.proto != proto) | 977 | x->id.proto != proto || |
978 | xfrm_addr_cmp(&x->id.daddr, daddr, family) || | ||
979 | xfrm_addr_cmp(&x->props.saddr, saddr, family)) | ||
1005 | continue; | 980 | continue; |
1006 | 981 | ||
1007 | switch (family) { | ||
1008 | case AF_INET: | ||
1009 | if (x->id.daddr.a4 != daddr->a4 || | ||
1010 | x->props.saddr.a4 != saddr->a4) | ||
1011 | continue; | ||
1012 | break; | ||
1013 | case AF_INET6: | ||
1014 | if (!ipv6_addr_equal((struct in6_addr *)x->id.daddr.a6, | ||
1015 | (struct in6_addr *)daddr) || | ||
1016 | !ipv6_addr_equal((struct in6_addr *) | ||
1017 | x->props.saddr.a6, | ||
1018 | (struct in6_addr *)saddr)) | ||
1019 | continue; | ||
1020 | break; | ||
1021 | } | ||
1022 | |||
1023 | xfrm_state_hold(x); | 982 | xfrm_state_hold(x); |
1024 | return x; | 983 | return x; |
1025 | } | 984 | } |