Skip to content

Commit

Permalink
[TCP] Allow len == skb->len in tcp_fragment
Browse files Browse the repository at this point in the history
It is legitimate to call tcp_fragment with len == skb->len since
that is done for FIN packets and the FIN flag counts as one byte.
So we should only check for the len > skb->len case.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
  • Loading branch information
Herbert Xu authored and Arnaldo Carvalho de Melo committed Oct 20, 2005
1 parent 49c5bfa commit b2cc99f
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions net/ipv4/tcp_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,17 +435,7 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss
int nsize, old_factor;
u16 flags;

if (unlikely(len >= skb->len)) {
if (net_ratelimit()) {
printk(KERN_DEBUG "TCP: seg_size=%u, mss=%u, seq=%u, "
"end_seq=%u, skb->len=%u.\n", len, mss_now,
TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq,
skb->len);
WARN_ON(1);
}
return 0;
}

BUG_ON(len > skb->len);
nsize = skb_headlen(skb) - len;
if (nsize < 0)
nsize = 0;
Expand Down

0 comments on commit b2cc99f

Please sign in to comment.