diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/core/dev.c | 15 | ||||
-rw-r--r-- | net/ipv4/ip_output.c | 4 |
2 files changed, 17 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 307142a702d..a4c4a1bf07d 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2324,6 +2324,13 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, | |||
2324 | skb->vlan_tci = 0; | 2324 | skb->vlan_tci = 0; |
2325 | } | 2325 | } |
2326 | 2326 | ||
2327 | /* If encapsulation offload request, verify we are testing | ||
2328 | * hardware encapsulation features instead of standard | ||
2329 | * features for the netdev | ||
2330 | */ | ||
2331 | if (skb->encapsulation) | ||
2332 | features &= dev->hw_enc_features; | ||
2333 | |||
2327 | if (netif_needs_gso(skb, features)) { | 2334 | if (netif_needs_gso(skb, features)) { |
2328 | if (unlikely(dev_gso_segment(skb, features))) | 2335 | if (unlikely(dev_gso_segment(skb, features))) |
2329 | goto out_kfree_skb; | 2336 | goto out_kfree_skb; |
@@ -2339,8 +2346,12 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, | |||
2339 | * checksumming here. | 2346 | * checksumming here. |
2340 | */ | 2347 | */ |
2341 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 2348 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
2342 | skb_set_transport_header(skb, | 2349 | if (skb->encapsulation) |
2343 | skb_checksum_start_offset(skb)); | 2350 | skb_set_inner_transport_header(skb, |
2351 | skb_checksum_start_offset(skb)); | ||
2352 | else | ||
2353 | skb_set_transport_header(skb, | ||
2354 | skb_checksum_start_offset(skb)); | ||
2344 | if (!(features & NETIF_F_ALL_CSUM) && | 2355 | if (!(features & NETIF_F_ALL_CSUM) && |
2345 | skb_checksum_help(skb)) | 2356 | skb_checksum_help(skb)) |
2346 | goto out_kfree_skb; | 2357 | goto out_kfree_skb; |
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 6537a408a4f..3e98ed2bff5 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -595,6 +595,10 @@ slow_path_clean: | |||
595 | } | 595 | } |
596 | 596 | ||
597 | slow_path: | 597 | slow_path: |
598 | /* for offloaded checksums cleanup checksum before fragmentation */ | ||
599 | if ((skb->ip_summed == CHECKSUM_PARTIAL) && skb_checksum_help(skb)) | ||
600 | goto fail; | ||
601 | |||
598 | left = skb->len - hlen; /* Space per frame */ | 602 | left = skb->len - hlen; /* Space per frame */ |
599 | ptr = hlen; /* Where to start from */ | 603 | ptr = hlen; /* Where to start from */ |
600 | 604 | ||