summaryrefslogtreecommitdiff
path: root/net/ipv6/reassembly.c
diff options
context:
space:
mode:
authorLuka Pivk <luka.pivk@toradex.com>2019-01-08 13:52:27 +0100
committerLuka Pivk <luka.pivk@toradex.com>2019-01-08 13:52:27 +0100
commite9dcc568b2e968af848bbdb4267ba6cde5457b9e (patch)
tree4cc0a7e7220770f30d0c7c6989feaa8e73c9f1c1 /net/ipv6/reassembly.c
parent6a082d8b56f739188cdcbac7cf412775a20447df (diff)
parent457e6884cb33a86aef7e86119955ee3d87da6815 (diff)
Merge remote-tracking branch 'remotes/origin/linux-4.19.y-rt'
Signed-off-by: Luka Pivk <luka.pivk@toradex.com>
Diffstat (limited to 'net/ipv6/reassembly.c')
-rw-r--r--net/ipv6/reassembly.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 5c5b4f79296e..d3fd2d7e5aa4 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -281,7 +281,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev,
{
struct net *net = container_of(fq->q.net, struct net, ipv6.frags);
struct sk_buff *fp, *head = fq->q.fragments;
- int payload_len;
+ int payload_len, delta;
unsigned int nhoff;
int sum_truesize;
u8 ecn;
@@ -322,10 +322,16 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev,
if (payload_len > IPV6_MAXPLEN)
goto out_oversize;
+ delta = - head->truesize;
+
/* Head of list must not be cloned. */
if (skb_unclone(head, GFP_ATOMIC))
goto out_oom;
+ delta += head->truesize;
+ if (delta)
+ add_frag_mem_limit(fq->q.net, delta);
+
/* If the first fragment is fragmented itself, we split
* it to two chunks: the first with data and paged part
* and the second, holding only fragments. */