summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2005-10-20 17:13:13 -0200
committerArnaldo Carvalho de Melo <acme@mandriva.com>2005-10-20 17:13:13 -0200
commitb2cc99f04c5a732c793519aca61a20f719b50db4 (patch)
tree0614c2c1d40926cec4bfe91524bf50c6aff0063f /net
parent49c5bfaffe8ae6e6440dc4bf78b03800960d93f5 (diff)
[TCP] Allow len == skb->len in tcp_fragment
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>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/tcp_output.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 7114031fdc70..b907456a79f4 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -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;