aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 778b2036a9e7..cf92139b229c 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2281,7 +2281,7 @@ out:
2281} 2281}
2282EXPORT_SYMBOL(skb_checksum_help); 2282EXPORT_SYMBOL(skb_checksum_help);
2283 2283
2284__be16 skb_network_protocol(struct sk_buff *skb) 2284__be16 skb_network_protocol(struct sk_buff *skb, int *depth)
2285{ 2285{
2286 __be16 type = skb->protocol; 2286 __be16 type = skb->protocol;
2287 int vlan_depth = ETH_HLEN; 2287 int vlan_depth = ETH_HLEN;
@@ -2308,6 +2308,8 @@ __be16 skb_network_protocol(struct sk_buff *skb)
2308 vlan_depth += VLAN_HLEN; 2308 vlan_depth += VLAN_HLEN;
2309 } 2309 }
2310 2310
2311 *depth = vlan_depth;
2312
2311 return type; 2313 return type;
2312} 2314}
2313 2315
@@ -2321,12 +2323,13 @@ struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb,
2321{ 2323{
2322 struct sk_buff *segs = ERR_PTR(-EPROTONOSUPPORT); 2324 struct sk_buff *segs = ERR_PTR(-EPROTONOSUPPORT);
2323 struct packet_offload *ptype; 2325 struct packet_offload *ptype;
2324 __be16 type = skb_network_protocol(skb); 2326 int vlan_depth = skb->mac_len;
2327 __be16 type = skb_network_protocol(skb, &vlan_depth);
2325 2328
2326 if (unlikely(!type)) 2329 if (unlikely(!type))
2327 return ERR_PTR(-EINVAL); 2330 return ERR_PTR(-EINVAL);
2328 2331
2329 __skb_pull(skb, skb->mac_len); 2332 __skb_pull(skb, vlan_depth);
2330 2333
2331 rcu_read_lock(); 2334 rcu_read_lock();
2332 list_for_each_entry_rcu(ptype, &offload_base, list) { 2335 list_for_each_entry_rcu(ptype, &offload_base, list) {
@@ -2493,8 +2496,10 @@ static netdev_features_t harmonize_features(struct sk_buff *skb,
2493 const struct net_device *dev, 2496 const struct net_device *dev,
2494 netdev_features_t features) 2497 netdev_features_t features)
2495{ 2498{
2499 int tmp;
2500
2496 if (skb->ip_summed != CHECKSUM_NONE && 2501 if (skb->ip_summed != CHECKSUM_NONE &&
2497 !can_checksum_protocol(features, skb_network_protocol(skb))) { 2502 !can_checksum_protocol(features, skb_network_protocol(skb, &tmp))) {
2498 features &= ~NETIF_F_ALL_CSUM; 2503 features &= ~NETIF_F_ALL_CSUM;
2499 } else if (illegal_highdma(dev, skb)) { 2504 } else if (illegal_highdma(dev, skb)) {
2500 features &= ~NETIF_F_SG; 2505 features &= ~NETIF_F_SG;