Commit 31a5b93c authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller

[IPV4/IPV6]: In ip_fragment(), reset ip_summed field on SKB sub-frags.

If we forward a fragmented packet, we can have ip_summed
set to CHECKSUM_HW or similar.  This is fine for local
protocol processing, but once if we are forwarding this
packet we want to reset ip_summed to CHECKSUM_NONE.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 98f9485a
...@@ -504,6 +504,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*)) ...@@ -504,6 +504,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
/* Prepare header of the next frame, /* Prepare header of the next frame,
* before previous one went down. */ * before previous one went down. */
if (frag) { if (frag) {
frag->ip_summed = CHECKSUM_NONE;
frag->h.raw = frag->data; frag->h.raw = frag->data;
frag->nh.raw = __skb_push(frag, hlen); frag->nh.raw = __skb_push(frag, hlen);
memcpy(frag->nh.raw, iph, hlen); memcpy(frag->nh.raw, iph, hlen);
......
...@@ -592,6 +592,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) ...@@ -592,6 +592,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
/* Prepare header of the next frame, /* Prepare header of the next frame,
* before previous one went down. */ * before previous one went down. */
if (frag) { if (frag) {
frag->ip_summed = CHECKSUM_NONE;
frag->h.raw = frag->data; frag->h.raw = frag->data;
fh = (struct frag_hdr*)__skb_push(frag, sizeof(struct frag_hdr)); fh = (struct frag_hdr*)__skb_push(frag, sizeof(struct frag_hdr));
frag->nh.raw = __skb_push(frag, hlen); frag->nh.raw = __skb_push(frag, hlen);
......
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