@@ -184,17 +184,24 @@ static inline void ccid3_hc_tx_update_win_count(struct ccid3_hc_tx_sock *hc,
184184
185185static void ccid3_hc_tx_no_feedback_timer (struct timer_list * t )
186186{
187- struct ccid3_hc_tx_sock * hc = from_timer (hc , t , tx_no_feedback_timer );
188- struct sock * sk = hc -> sk ;
187+ struct dccp_sock * dp = from_timer (dp , t , dccps_ccid_timer );
188+ struct ccid3_hc_tx_sock * hc ;
189+ struct sock * sk = (struct sock * )dp ;
189190 unsigned long t_nfb = USEC_PER_SEC / 5 ;
190191
191192 bh_lock_sock (sk );
193+
194+ if (inet_sk_state_load (sk ) == DCCP_CLOSED )
195+ goto out ;
196+
192197 if (sock_owned_by_user (sk )) {
193198 /* Try again later. */
194199 /* XXX: set some sensible MIB */
195200 goto restart_timer ;
196201 }
197202
203+ hc = ccid_priv (dp -> dccps_hc_tx_ccid );
204+
198205 ccid3_pr_debug ("%s(%p, state=%s) - entry\n" , dccp_role (sk ), sk ,
199206 ccid3_tx_state_name (hc -> tx_state ));
200207
@@ -250,8 +257,8 @@ static void ccid3_hc_tx_no_feedback_timer(struct timer_list *t)
250257 t_nfb = max (hc -> tx_t_rto , 2 * hc -> tx_t_ipi );
251258
252259restart_timer :
253- sk_reset_timer (sk , & hc -> tx_no_feedback_timer ,
254- jiffies + usecs_to_jiffies (t_nfb ));
260+ sk_reset_timer (sk , & dp -> dccps_ccid_timer ,
261+ jiffies + usecs_to_jiffies (t_nfb ));
255262out :
256263 bh_unlock_sock (sk );
257264 sock_put (sk );
@@ -280,7 +287,7 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, struct sk_buff *skb)
280287 return - EBADMSG ;
281288
282289 if (hc -> tx_state == TFRC_SSTATE_NO_SENT ) {
283- sk_reset_timer (sk , & hc -> tx_no_feedback_timer , (jiffies +
290+ sk_reset_timer (sk , & dp -> dccps_ccid_timer , (jiffies +
284291 usecs_to_jiffies (TFRC_INITIAL_TIMEOUT )));
285292 hc -> tx_last_win_count = 0 ;
286293 hc -> tx_t_last_win_count = now ;
@@ -354,6 +361,7 @@ static void ccid3_hc_tx_packet_sent(struct sock *sk, unsigned int len)
354361static void ccid3_hc_tx_packet_recv (struct sock * sk , struct sk_buff * skb )
355362{
356363 struct ccid3_hc_tx_sock * hc = ccid3_hc_tx_sk (sk );
364+ struct dccp_sock * dp = dccp_sk (sk );
357365 struct tfrc_tx_hist_entry * acked ;
358366 ktime_t now ;
359367 unsigned long t_nfb ;
@@ -420,7 +428,7 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
420428 (unsigned int )(hc -> tx_x >> 6 ));
421429
422430 /* unschedule no feedback timer */
423- sk_stop_timer (sk , & hc -> tx_no_feedback_timer );
431+ sk_stop_timer (sk , & dp -> dccps_ccid_timer );
424432
425433 /*
426434 * As we have calculated new ipi, delta, t_nom it is possible
@@ -445,8 +453,8 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
445453 "expire in %lu jiffies (%luus)\n" ,
446454 dccp_role (sk ), sk , usecs_to_jiffies (t_nfb ), t_nfb );
447455
448- sk_reset_timer (sk , & hc -> tx_no_feedback_timer ,
449- jiffies + usecs_to_jiffies (t_nfb ));
456+ sk_reset_timer (sk , & dp -> dccps_ccid_timer ,
457+ jiffies + usecs_to_jiffies (t_nfb ));
450458}
451459
452460static int ccid3_hc_tx_parse_options (struct sock * sk , u8 packet_type ,
@@ -488,21 +496,23 @@ static int ccid3_hc_tx_parse_options(struct sock *sk, u8 packet_type,
488496
489497static int ccid3_hc_tx_init (struct ccid * ccid , struct sock * sk )
490498{
499+ struct dccp_sock * dp = dccp_sk (sk );
491500 struct ccid3_hc_tx_sock * hc = ccid_priv (ccid );
492501
493502 hc -> tx_state = TFRC_SSTATE_NO_SENT ;
494503 hc -> tx_hist = NULL ;
495504 hc -> sk = sk ;
496- timer_setup (& hc -> tx_no_feedback_timer ,
505+ timer_setup (& dp -> dccps_ccid_timer ,
497506 ccid3_hc_tx_no_feedback_timer , 0 );
498507 return 0 ;
499508}
500509
501510static void ccid3_hc_tx_exit (struct sock * sk )
502511{
512+ struct dccp_sock * dp = dccp_sk (sk );
503513 struct ccid3_hc_tx_sock * hc = ccid3_hc_tx_sk (sk );
504514
505- sk_stop_timer (sk , & hc -> tx_no_feedback_timer );
515+ sk_stop_timer (sk , & dp -> dccps_ccid_timer );
506516 tfrc_tx_hist_purge (& hc -> tx_hist );
507517}
508518
0 commit comments