path: root/net/core
diff options
authorAlexander Duyck <>2016-02-05 15:27:55 -0800
committerDavid S. Miller <>2016-02-11 08:55:34 -0500
commitddff00d420432d54eb420bb33034bb8e22dd2543 (patch)
treefa2c13ae3708f32259da676c3b2c750e7ead8572 /net/core
parent08b64fcca942733413bc5ac2321d57021d3e8578 (diff)
net: Move skb_has_shared_frag check out of GRE code and into segmentation
The call skb_has_shared_frag is used in the GRE path and skb_checksum_help to verify that no frags can be modified by an external entity. This check really doesn't belong in the GRE path but in the skb_segment function itself. This way any protocol that might be segmented will be performing this check before attempting to offload a checksum to software. Signed-off-by: Alexander Duyck <> Acked-by: Tom Herbert <> Signed-off-by: David S. Miller <>
Diffstat (limited to 'net/core')
1 files changed, 5 insertions, 0 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 9c065ac72e87..88262c82b96a 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3173,6 +3173,11 @@ skip_fraglist:
if (!csum) {
+ if (skb_has_shared_frag(nskb)) {
+ err = __skb_linearize(nskb);
+ if (err)
+ goto err;
+ }
if (!nskb->remcsum_offload)
nskb->ip_summed = CHECKSUM_NONE;
SKB_GSO_CB(nskb)->csum =