diff options
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev.c | 9 | ||||
-rw-r--r-- | net/core/ethtool.c | 2 | ||||
-rw-r--r-- | net/core/rtnetlink.c | 2 | ||||
-rw-r--r-- | net/core/skbuff.c | 8 |
4 files changed, 13 insertions, 8 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 54277df0f73..24ea2d71e7e 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -749,7 +749,8 @@ EXPORT_SYMBOL(dev_get_by_index); | |||
749 | * @ha: hardware address | 749 | * @ha: hardware address |
750 | * | 750 | * |
751 | * Search for an interface by MAC address. Returns NULL if the device | 751 | * Search for an interface by MAC address. Returns NULL if the device |
752 | * is not found or a pointer to the device. The caller must hold RCU | 752 | * is not found or a pointer to the device. |
753 | * The caller must hold RCU or RTNL. | ||
753 | * The returned device has not had its ref count increased | 754 | * The returned device has not had its ref count increased |
754 | * and the caller must therefore be careful about locking | 755 | * and the caller must therefore be careful about locking |
755 | * | 756 | * |
@@ -2001,7 +2002,7 @@ static bool can_checksum_protocol(unsigned long features, __be16 protocol) | |||
2001 | 2002 | ||
2002 | static int harmonize_features(struct sk_buff *skb, __be16 protocol, int features) | 2003 | static int harmonize_features(struct sk_buff *skb, __be16 protocol, int features) |
2003 | { | 2004 | { |
2004 | if (!can_checksum_protocol(protocol, features)) { | 2005 | if (!can_checksum_protocol(features, protocol)) { |
2005 | features &= ~NETIF_F_ALL_CSUM; | 2006 | features &= ~NETIF_F_ALL_CSUM; |
2006 | features &= ~NETIF_F_SG; | 2007 | features &= ~NETIF_F_SG; |
2007 | } else if (illegal_highdma(skb->dev, skb)) { | 2008 | } else if (illegal_highdma(skb->dev, skb)) { |
@@ -2023,13 +2024,13 @@ int netif_skb_features(struct sk_buff *skb) | |||
2023 | return harmonize_features(skb, protocol, features); | 2024 | return harmonize_features(skb, protocol, features); |
2024 | } | 2025 | } |
2025 | 2026 | ||
2026 | features &= skb->dev->vlan_features; | 2027 | features &= (skb->dev->vlan_features | NETIF_F_HW_VLAN_TX); |
2027 | 2028 | ||
2028 | if (protocol != htons(ETH_P_8021Q)) { | 2029 | if (protocol != htons(ETH_P_8021Q)) { |
2029 | return harmonize_features(skb, protocol, features); | 2030 | return harmonize_features(skb, protocol, features); |
2030 | } else { | 2031 | } else { |
2031 | features &= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | | 2032 | features &= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | |
2032 | NETIF_F_GEN_CSUM; | 2033 | NETIF_F_GEN_CSUM | NETIF_F_HW_VLAN_TX; |
2033 | return harmonize_features(skb, protocol, features); | 2034 | return harmonize_features(skb, protocol, features); |
2034 | } | 2035 | } |
2035 | } | 2036 | } |
diff --git a/net/core/ethtool.c b/net/core/ethtool.c index 17741782a34..ff2302910b5 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c | |||
@@ -817,7 +817,7 @@ static int ethtool_get_regs(struct net_device *dev, char __user *useraddr) | |||
817 | if (regs.len > reglen) | 817 | if (regs.len > reglen) |
818 | regs.len = reglen; | 818 | regs.len = reglen; |
819 | 819 | ||
820 | regbuf = vmalloc(reglen); | 820 | regbuf = vzalloc(reglen); |
821 | if (!regbuf) | 821 | if (!regbuf) |
822 | return -ENOMEM; | 822 | return -ENOMEM; |
823 | 823 | ||
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index a5f7535aab5..750db57f3bb 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -1820,7 +1820,7 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
1820 | if (kind != 2 && security_netlink_recv(skb, CAP_NET_ADMIN)) | 1820 | if (kind != 2 && security_netlink_recv(skb, CAP_NET_ADMIN)) |
1821 | return -EPERM; | 1821 | return -EPERM; |
1822 | 1822 | ||
1823 | if (kind == 2 && (nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) { | 1823 | if (kind == 2 && nlh->nlmsg_flags&NLM_F_DUMP) { |
1824 | struct sock *rtnl; | 1824 | struct sock *rtnl; |
1825 | rtnl_dumpit_func dumpit; | 1825 | rtnl_dumpit_func dumpit; |
1826 | 1826 | ||
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index d31bb36ae0d..7cd1bc86d59 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -2744,8 +2744,12 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb) | |||
2744 | 2744 | ||
2745 | merge: | 2745 | merge: |
2746 | if (offset > headlen) { | 2746 | if (offset > headlen) { |
2747 | skbinfo->frags[0].page_offset += offset - headlen; | 2747 | unsigned int eat = offset - headlen; |
2748 | skbinfo->frags[0].size -= offset - headlen; | 2748 | |
2749 | skbinfo->frags[0].page_offset += eat; | ||
2750 | skbinfo->frags[0].size -= eat; | ||
2751 | skb->data_len -= eat; | ||
2752 | skb->len -= eat; | ||
2749 | offset = headlen; | 2753 | offset = headlen; |
2750 | } | 2754 | } |
2751 | 2755 | ||