diff options
| author | Gleb Smirnoff <glebius@FreeBSD.org> | 2022-12-07 17:00:48 +0000 |
|---|---|---|
| committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2022-12-07 17:00:48 +0000 |
| commit | 918fa4227d5bb74e882649785284c76e24e8f259 (patch) | |
| tree | f739914bd9b94a36ffd1072585ab7478dd05f425 /sys/netinet/tcp_timer.c | |
| parent | e68b3792440cac248347afe08ba5881a00ba6523 (diff) | |
Diffstat (limited to 'sys/netinet/tcp_timer.c')
| -rw-r--r-- | sys/netinet/tcp_timer.c | 108 |
1 files changed, 0 insertions, 108 deletions
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index a0eb4b0aad2d..d67a062eab5b 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -976,114 +976,6 @@ tcp_timer_active(struct tcpcb *tp, uint32_t timer_type) return callout_active(t_callout); } -/* - * Stop the timer from running, and apply a flag - * against the timer_flags that will force the - * timer never to run. The flag is needed to assure - * a race does not leave it running and cause - * the timer to possibly restart itself (keep and persist - * especially do this). - */ -int -tcp_timer_suspend(struct tcpcb *tp, uint32_t timer_type) -{ - struct callout *t_callout; - uint32_t t_flags; - - switch (timer_type) { - case TT_DELACK: - t_flags = TT_DELACK_SUS; - t_callout = &tp->tt_delack; - break; - case TT_REXMT: - t_flags = TT_REXMT_SUS; - t_callout = &tp->tt_rexmt; - break; - case TT_PERSIST: - t_flags = TT_PERSIST_SUS; - t_callout = &tp->tt_persist; - break; - case TT_KEEP: - t_flags = TT_KEEP_SUS; - t_callout = &tp->tt_keep; - break; - case TT_2MSL: - t_flags = TT_2MSL_SUS; - t_callout = &tp->tt_2msl; - break; - default: - panic("tp:%p bad timer_type 0x%x", tp, timer_type); - } - tp->tt_flags |= t_flags; - return (callout_stop(t_callout)); -} - -void -tcp_timers_unsuspend(struct tcpcb *tp, uint32_t timer_type) -{ - - switch (timer_type) { - case TT_DELACK: - if (tp->tt_flags & TT_DELACK_SUS) { - tp->tt_flags &= ~TT_DELACK_SUS; - if (tp->t_flags & TF_DELACK) { - /* Delayed ack timer should be up activate a timer */ - tp->t_flags &= ~TF_DELACK; - tcp_timer_activate(tp, TT_DELACK, - tcp_delacktime); - } - } - break; - case TT_REXMT: - if (tp->tt_flags & TT_REXMT_SUS) { - tp->tt_flags &= ~TT_REXMT_SUS; - if (SEQ_GT(tp->snd_max, tp->snd_una) && - (tcp_timer_active((tp), TT_PERSIST) == 0) && - tp->snd_wnd) { - /* We have outstanding data activate a timer */ - tcp_timer_activate(tp, TT_REXMT, - tp->t_rxtcur); - } - } - break; - case TT_PERSIST: - if (tp->tt_flags & TT_PERSIST_SUS) { - tp->tt_flags &= ~TT_PERSIST_SUS; - if (tp->snd_wnd == 0) { - /* Activate the persists timer */ - tp->t_rxtshift = 0; - tcp_setpersist(tp); - } - } - break; - case TT_KEEP: - if (tp->tt_flags & TT_KEEP_SUS) { - tp->tt_flags &= ~TT_KEEP_SUS; - tcp_timer_activate(tp, TT_KEEP, - TCPS_HAVEESTABLISHED(tp->t_state) ? - TP_KEEPIDLE(tp) : TP_KEEPINIT(tp)); - } - break; - case TT_2MSL: - if (tp->tt_flags &= TT_2MSL_SUS) { - struct socket *so = tptosocket(tp); - - tp->tt_flags &= ~TT_2MSL_SUS; - if ((tp->t_state == TCPS_FIN_WAIT_2) && - (so == NULL || /* XXXGL: needed? */ - (so->so_rcv.sb_state & SBS_CANTRCVMORE))) { - /* Star the 2MSL timer */ - tcp_timer_activate(tp, TT_2MSL, - (tcp_fast_finwait2_recycle) ? - tcp_finwait2_timeout : TP_MAXIDLE(tp)); - } - } - break; - default: - panic("tp:%p bad timer_type 0x%x", tp, timer_type); - } -} - static void tcp_timer_discard(void *ptp) { |
