From: Ian McDonald Date: Fri, 10 Nov 2006 15:09:10 +0000 (-0200) Subject: [DCCP]: Fix logfile overflow X-Git-Tag: v2.6.20-rc1~34^2~40^2~406 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f45b3ec481581f24719d8ab0bc812c02fcedc2bc;p=linux-2.6 [DCCP]: Fix logfile overflow This patch fixes data being spewed into the logs continually. As the code stood if there was a large queue and long delays timeo would go down to zero and never get reset. This fixes it by resetting timeo. Put constant into header as well. Signed-off-by: Ian McDonald Signed-off-by: Gerrit Renker Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h index 3d4b4a908d..7b859a7238 100644 --- a/net/dccp/dccp.h +++ b/net/dccp/dccp.h @@ -62,6 +62,8 @@ extern void dccp_time_wait(struct sock *sk, int state, int timeo); #define DCCP_RTO_MAX ((unsigned)(120 * HZ)) /* FIXME: using TCP value */ +#define DCCP_XMIT_TIMEO 30000 /* Time/msecs for blocking transmit per packet */ + /* is seq1 < seq2 ? */ static inline int before48(const u64 seq1, const u64 seq2) { diff --git a/net/dccp/output.c b/net/dccp/output.c index 1ae2248557..51654975e8 100644 --- a/net/dccp/output.c +++ b/net/dccp/output.c @@ -249,8 +249,8 @@ void dccp_write_xmit(struct sock *sk, int block) { struct dccp_sock *dp = dccp_sk(sk); struct sk_buff *skb; - long timeo = 30000; /* If a packet is taking longer than 2 secs - we have other issues */ + long timeo = DCCP_XMIT_TIMEO; /* If a packet is taking longer than + this we have other issues */ while ((skb = skb_peek(&sk->sk_write_queue))) { int err = ccid_hc_tx_send_packet(dp->dccps_hc_tx_ccid, sk, skb, @@ -261,8 +261,10 @@ void dccp_write_xmit(struct sock *sk, int block) sk_reset_timer(sk, &dp->dccps_xmit_timer, msecs_to_jiffies(err)+jiffies); break; - } else + } else { err = dccp_wait_for_ccid(sk, skb, &timeo); + timeo = DCCP_XMIT_TIMEO; + } if (err) { printk(KERN_CRIT "%s:err at dccp_wait_for_ccid" " %d\n", __FUNCTION__, err);