aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv4/tcp_output.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 44df1db726a3..a28ae593b976 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -533,6 +533,7 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss
533 struct tcp_sock *tp = tcp_sk(sk); 533 struct tcp_sock *tp = tcp_sk(sk);
534 struct sk_buff *buff; 534 struct sk_buff *buff;
535 int nsize, old_factor; 535 int nsize, old_factor;
536 int nlen;
536 u16 flags; 537 u16 flags;
537 538
538 BUG_ON(len > skb->len); 539 BUG_ON(len > skb->len);
@@ -552,8 +553,10 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss
552 if (buff == NULL) 553 if (buff == NULL)
553 return -ENOMEM; /* We'll just try again later. */ 554 return -ENOMEM; /* We'll just try again later. */
554 555
555 buff->truesize = skb->len - len; 556 sk_charge_skb(sk, buff);
556 skb->truesize -= buff->truesize; 557 nlen = skb->len - len - nsize;
558 buff->truesize += nlen;
559 skb->truesize -= nlen;
557 560
558 /* Correct the sequence numbers. */ 561 /* Correct the sequence numbers. */
559 TCP_SKB_CB(buff)->seq = TCP_SKB_CB(skb)->seq + len; 562 TCP_SKB_CB(buff)->seq = TCP_SKB_CB(skb)->seq + len;
@@ -1039,7 +1042,8 @@ static int tso_fragment(struct sock *sk, struct sk_buff *skb, unsigned int len,
1039 if (unlikely(buff == NULL)) 1042 if (unlikely(buff == NULL))
1040 return -ENOMEM; 1043 return -ENOMEM;
1041 1044
1042 buff->truesize = nlen; 1045 sk_charge_skb(sk, buff);
1046 buff->truesize += nlen;
1043 skb->truesize -= nlen; 1047 skb->truesize -= nlen;
1044 1048
1045 /* Correct the sequence numbers. */ 1049 /* Correct the sequence numbers. */