[TCP]: Ratelimit debugging warning.
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 13 Oct 2005 21:42:24 +0000 (14:42 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 13 Oct 2005 21:42:24 +0000 (14:42 -0700)
Better safe than sorry.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_output.c

index f37a50e55b6846eca00732da90c53aa7eeff2401..7114031fdc70e3ce8c6adcdd7beda2f6d2b5d049 100644 (file)
@@ -436,11 +436,13 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss
        u16 flags;
 
        if (unlikely(len >= skb->len)) {
-               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);
+               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;
        }