Skip to content

Commit

Permalink
[DCCP]: Fix logfile overflow
Browse files Browse the repository at this point in the history
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 <ian.mcdonald@jandi.co.nz>
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
  • Loading branch information
Ian McDonald authored and David S. Miller committed Dec 3, 2006
1 parent fec5b80 commit f45b3ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions net/dccp/dccp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
8 changes: 5 additions & 3 deletions net/dccp/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
Expand Down

0 comments on commit f45b3ec

Please sign in to comment.