From aabb601b0f08b909b650f1a7bfa1e8d9b5a8d999 Mon Sep 17 00:00:00 2001 From: Gerrit Renker Date: Fri, 9 Mar 2007 13:47:58 -0800 Subject: [DCCP]: Initialise write_xmit_timer also on passive sockets The TX CCID needs the write_xmit_timer for delaying packet sends. Previously this timer was only activated on active (connecting) sockets. This patch initialises the write_xmit_timer in sync with the other timers, i.e. the timer will be ready on any socket. This is used by applications with a listening socket which start to stream after receiving an initiation by the client. The write_xmit_timer is stopped when the application closes, as before. Was tested to work and to remove the timer bug reported on dccp@vger. Also moved timer initialisation into timer.c (static). Signed-off-by: Gerrit Renker Acked-by: Ian McDonald Signed-off-by: David S. Miller --- net/dccp/output.c | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'net/dccp/output.c') diff --git a/net/dccp/output.c b/net/dccp/output.c index 3282f2f2291..aa21cc4de37 100644 --- a/net/dccp/output.c +++ b/net/dccp/output.c @@ -213,19 +213,6 @@ do_interrupted: goto out; } -static void dccp_write_xmit_timer(unsigned long data) { - struct sock *sk = (struct sock *)data; - struct dccp_sock *dp = dccp_sk(sk); - - bh_lock_sock(sk); - if (sock_owned_by_user(sk)) - sk_reset_timer(sk, &dp->dccps_xmit_timer, jiffies+1); - else - dccp_write_xmit(sk, 0); - bh_unlock_sock(sk); - sock_put(sk); -} - void dccp_write_xmit(struct sock *sk, int block) { struct dccp_sock *dp = dccp_sk(sk); @@ -434,9 +421,6 @@ static inline void dccp_connect_init(struct sock *sk) dp->dccps_gar = dp->dccps_iss; icsk->icsk_retransmits = 0; - init_timer(&dp->dccps_xmit_timer); - dp->dccps_xmit_timer.data = (unsigned long)sk; - dp->dccps_xmit_timer.function = dccp_write_xmit_timer; } int dccp_connect(struct sock *sk) -- cgit v1.2.3