Commit 6f85a124 authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller

net: Preserve netfilter attributes in skb_gso_segment using __copy_skb_header

skb_gso_segment didn't preserve some attributes in the original skb
such as the netfilter fields.  This was harmless until they were used
which is the case for packets going through lo.

This patch makes it call __copy_skb_header which also picks up some
other missing attributes.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7447ef63
...@@ -2256,14 +2256,7 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features) ...@@ -2256,14 +2256,7 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features)
segs = nskb; segs = nskb;
tail = nskb; tail = nskb;
nskb->dev = skb->dev; __copy_skb_header(nskb, skb);
skb_copy_queue_mapping(nskb, skb);
nskb->priority = skb->priority;
nskb->protocol = skb->protocol;
nskb->vlan_tci = skb->vlan_tci;
nskb->dst = dst_clone(skb->dst);
memcpy(nskb->cb, skb->cb, sizeof(skb->cb));
nskb->pkt_type = skb->pkt_type;
nskb->mac_len = skb->mac_len; nskb->mac_len = skb->mac_len;
skb_reserve(nskb, headroom); skb_reserve(nskb, headroom);
...@@ -2274,6 +2267,7 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features) ...@@ -2274,6 +2267,7 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features)
skb_copy_from_linear_data(skb, skb_put(nskb, doffset), skb_copy_from_linear_data(skb, skb_put(nskb, doffset),
doffset); doffset);
if (!sg) { if (!sg) {
nskb->ip_summed = CHECKSUM_NONE;
nskb->csum = skb_copy_and_csum_bits(skb, offset, nskb->csum = skb_copy_and_csum_bits(skb, offset,
skb_put(nskb, len), skb_put(nskb, len),
len, 0); len, 0);
...@@ -2283,8 +2277,6 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features) ...@@ -2283,8 +2277,6 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features)
frag = skb_shinfo(nskb)->frags; frag = skb_shinfo(nskb)->frags;
k = 0; k = 0;
nskb->ip_summed = CHECKSUM_PARTIAL;
nskb->csum = skb->csum;
skb_copy_from_linear_data_offset(skb, offset, skb_copy_from_linear_data_offset(skb, offset,
skb_put(nskb, hsize), hsize); skb_put(nskb, hsize), hsize);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment