summaryrefslogtreecommitdiff
path: root/net/netfilter/xt_TCPMSS.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2016-03-10 09:29:25 +0700
committerLinus Walleij <linus.walleij@linaro.org>2016-03-10 09:29:25 +0700
commitcc998d8bc74341f6bbbcd63ab4449a6acfc45ee9 (patch)
tree2f4e23fa1ceb83b3e720afd52d9a5ef2be26c77e /net/netfilter/xt_TCPMSS.c
parentd2d13ed01362ecddc3f76f9cca31b0cd5d663a7e (diff)
parent81f70ba233d5f660e1ea5fe23260ee323af5d53a (diff)
Merge tag 'v4.5-rc5' into devel
Linux 4.5-rc5
Diffstat (limited to 'net/netfilter/xt_TCPMSS.c')
-rw-r--r--net/netfilter/xt_TCPMSS.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/net/netfilter/xt_TCPMSS.c b/net/netfilter/xt_TCPMSS.c
index b7c43def0dc6..e118397254af 100644
--- a/net/netfilter/xt_TCPMSS.c
+++ b/net/netfilter/xt_TCPMSS.c
@@ -228,7 +228,7 @@ tcpmss_tg6(struct sk_buff *skb, const struct xt_action_param *par)
{
struct ipv6hdr *ipv6h = ipv6_hdr(skb);
u8 nexthdr;
- __be16 frag_off;
+ __be16 frag_off, oldlen, newlen;
int tcphoff;
int ret;
@@ -244,7 +244,12 @@ tcpmss_tg6(struct sk_buff *skb, const struct xt_action_param *par)
return NF_DROP;
if (ret > 0) {
ipv6h = ipv6_hdr(skb);
- ipv6h->payload_len = htons(ntohs(ipv6h->payload_len) + ret);
+ oldlen = ipv6h->payload_len;
+ newlen = htons(ntohs(oldlen) + ret);
+ if (skb->ip_summed == CHECKSUM_COMPLETE)
+ skb->csum = csum_add(csum_sub(skb->csum, oldlen),
+ newlen);
+ ipv6h->payload_len = newlen;
}
return XT_CONTINUE;
}