diff options
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index b1b0c8d4d7df..45fa2f11f84d 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2286,7 +2286,7 @@ out: | |||
2286 | } | 2286 | } |
2287 | EXPORT_SYMBOL(skb_checksum_help); | 2287 | EXPORT_SYMBOL(skb_checksum_help); |
2288 | 2288 | ||
2289 | __be16 skb_network_protocol(struct sk_buff *skb) | 2289 | __be16 skb_network_protocol(struct sk_buff *skb, int *depth) |
2290 | { | 2290 | { |
2291 | __be16 type = skb->protocol; | 2291 | __be16 type = skb->protocol; |
2292 | int vlan_depth = ETH_HLEN; | 2292 | int vlan_depth = ETH_HLEN; |
@@ -2313,6 +2313,8 @@ __be16 skb_network_protocol(struct sk_buff *skb) | |||
2313 | vlan_depth += VLAN_HLEN; | 2313 | vlan_depth += VLAN_HLEN; |
2314 | } | 2314 | } |
2315 | 2315 | ||
2316 | *depth = vlan_depth; | ||
2317 | |||
2316 | return type; | 2318 | return type; |
2317 | } | 2319 | } |
2318 | 2320 | ||
@@ -2326,12 +2328,13 @@ struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb, | |||
2326 | { | 2328 | { |
2327 | struct sk_buff *segs = ERR_PTR(-EPROTONOSUPPORT); | 2329 | struct sk_buff *segs = ERR_PTR(-EPROTONOSUPPORT); |
2328 | struct packet_offload *ptype; | 2330 | struct packet_offload *ptype; |
2329 | __be16 type = skb_network_protocol(skb); | 2331 | int vlan_depth = skb->mac_len; |
2332 | __be16 type = skb_network_protocol(skb, &vlan_depth); | ||
2330 | 2333 | ||
2331 | if (unlikely(!type)) | 2334 | if (unlikely(!type)) |
2332 | return ERR_PTR(-EINVAL); | 2335 | return ERR_PTR(-EINVAL); |
2333 | 2336 | ||
2334 | __skb_pull(skb, skb->mac_len); | 2337 | __skb_pull(skb, vlan_depth); |
2335 | 2338 | ||
2336 | rcu_read_lock(); | 2339 | rcu_read_lock(); |
2337 | list_for_each_entry_rcu(ptype, &offload_base, list) { | 2340 | list_for_each_entry_rcu(ptype, &offload_base, list) { |
@@ -2498,8 +2501,10 @@ static netdev_features_t harmonize_features(struct sk_buff *skb, | |||
2498 | const struct net_device *dev, | 2501 | const struct net_device *dev, |
2499 | netdev_features_t features) | 2502 | netdev_features_t features) |
2500 | { | 2503 | { |
2504 | int tmp; | ||
2505 | |||
2501 | if (skb->ip_summed != CHECKSUM_NONE && | 2506 | if (skb->ip_summed != CHECKSUM_NONE && |
2502 | !can_checksum_protocol(features, skb_network_protocol(skb))) { | 2507 | !can_checksum_protocol(features, skb_network_protocol(skb, &tmp))) { |
2503 | features &= ~NETIF_F_ALL_CSUM; | 2508 | features &= ~NETIF_F_ALL_CSUM; |
2504 | } else if (illegal_highdma(dev, skb)) { | 2509 | } else if (illegal_highdma(dev, skb)) { |
2505 | features &= ~NETIF_F_SG; | 2510 | features &= ~NETIF_F_SG; |