MCPcopy Create free account
hub / github.com/F-Stack/f-stack / tcp_timers_unsuspend

Function tcp_timers_unsuspend

freebsd/netinet/tcp_timer.c:1015–1076  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1013}
1014
1015void
1016tcp_timers_unsuspend(struct tcpcb *tp, uint32_t timer_type)
1017{
1018 switch (timer_type) {
1019 case TT_DELACK:
1020 if (tp->t_timers->tt_flags & TT_DELACK_SUS) {
1021 tp->t_timers->tt_flags &= ~TT_DELACK_SUS;
1022 if (tp->t_flags & TF_DELACK) {
1023 /* Delayed ack timer should be up activate a timer */
1024 tp->t_flags &= ~TF_DELACK;
1025 tcp_timer_activate(tp, TT_DELACK,
1026 tcp_delacktime);
1027 }
1028 }
1029 break;
1030 case TT_REXMT:
1031 if (tp->t_timers->tt_flags & TT_REXMT_SUS) {
1032 tp->t_timers->tt_flags &= ~TT_REXMT_SUS;
1033 if (SEQ_GT(tp->snd_max, tp->snd_una) &&
1034 (tcp_timer_active((tp), TT_PERSIST) == 0) &&
1035 tp->snd_wnd) {
1036 /* We have outstanding data activate a timer */
1037 tcp_timer_activate(tp, TT_REXMT,
1038 tp->t_rxtcur);
1039 }
1040 }
1041 break;
1042 case TT_PERSIST:
1043 if (tp->t_timers->tt_flags & TT_PERSIST_SUS) {
1044 tp->t_timers->tt_flags &= ~TT_PERSIST_SUS;
1045 if (tp->snd_wnd == 0) {
1046 /* Activate the persists timer */
1047 tp->t_rxtshift = 0;
1048 tcp_setpersist(tp);
1049 }
1050 }
1051 break;
1052 case TT_KEEP:
1053 if (tp->t_timers->tt_flags & TT_KEEP_SUS) {
1054 tp->t_timers->tt_flags &= ~TT_KEEP_SUS;
1055 tcp_timer_activate(tp, TT_KEEP,
1056 TCPS_HAVEESTABLISHED(tp->t_state) ?
1057 TP_KEEPIDLE(tp) : TP_KEEPINIT(tp));
1058 }
1059 break;
1060 case TT_2MSL:
1061 if (tp->t_timers->tt_flags &= TT_2MSL_SUS) {
1062 tp->t_timers->tt_flags &= ~TT_2MSL_SUS;
1063 if ((tp->t_state == TCPS_FIN_WAIT_2) &&
1064 ((tp->t_inpcb->inp_socket == NULL) ||
1065 (tp->t_inpcb->inp_socket->so_rcv.sb_state & SBS_CANTRCVMORE))) {
1066 /* Star the 2MSL timer */
1067 tcp_timer_activate(tp, TT_2MSL,
1068 (tcp_fast_finwait2_recycle) ?
1069 tcp_finwait2_timeout : TP_MAXIDLE(tp));
1070 }
1071 }
1072 break;

Callers

nothing calls this directly

Calls 4

tcp_timer_activateFunction · 0.85
tcp_timer_activeFunction · 0.85
tcp_setpersistFunction · 0.85
panicFunction · 0.50

Tested by

no test coverage detected