aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/ip_output.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 18070ca65771..6e4d5f493bf9 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -476,6 +476,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
476 if (skb_shinfo(skb)->frag_list) { 476 if (skb_shinfo(skb)->frag_list) {
477 struct sk_buff *frag; 477 struct sk_buff *frag;
478 int first_len = skb_pagelen(skb); 478 int first_len = skb_pagelen(skb);
479 int truesizes = 0;
479 480
480 if (first_len - hlen > mtu || 481 if (first_len - hlen > mtu ||
481 ((first_len - hlen) & 7) || 482 ((first_len - hlen) & 7) ||
@@ -499,7 +500,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
499 sock_hold(skb->sk); 500 sock_hold(skb->sk);
500 frag->sk = skb->sk; 501 frag->sk = skb->sk;
501 frag->destructor = sock_wfree; 502 frag->destructor = sock_wfree;
502 skb->truesize -= frag->truesize; 503 truesizes += frag->truesize;
503 } 504 }
504 } 505 }
505 506
@@ -510,6 +511,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
510 frag = skb_shinfo(skb)->frag_list; 511 frag = skb_shinfo(skb)->frag_list;
511 skb_shinfo(skb)->frag_list = NULL; 512 skb_shinfo(skb)->frag_list = NULL;
512 skb->data_len = first_len - skb_headlen(skb); 513 skb->data_len = first_len - skb_headlen(skb);
514 skb->truesize -= truesizes;
513 skb->len = first_len; 515 skb->len = first_len;
514 iph->tot_len = htons(first_len); 516 iph->tot_len = htons(first_len);
515 iph->frag_off = htons(IP_MF); 517 iph->frag_off = htons(IP_MF);