diff options
author | jch <jch@FreeBSD.org> | 2016-07-27 13:53:15 +0000 |
---|---|---|
committer | jch <jch@FreeBSD.org> | 2016-07-27 13:53:15 +0000 |
commit | e9a919096127b6d85ed4c0867390fffb1e31891d (patch) | |
tree | 0af6f7c6d958b7a8dec08b408eb3cda3174d1463 /sys/netinet/tcp_timer.c | |
parent | e8dcfa692693d22783c703b1c294749139f9bf89 (diff) | |
download | FreeBSD-src-e9a919096127b6d85ed4c0867390fffb1e31891d.zip FreeBSD-src-e9a919096127b6d85ed4c0867390fffb1e31891d.tar.gz |
MFC r286873:
Make clear that TIME_WAIT timeout expiration is managed solely by
tcp_tw_2msl_scan().
Sponsored by: Verisign, Inc.
Diffstat (limited to 'sys/netinet/tcp_timer.c')
-rw-r--r-- | sys/netinet/tcp_timer.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index d721039..776ff4e 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -292,21 +292,29 @@ tcp_timer_2msl(void *xtp) /* * 2 MSL timeout in shutdown went off. If we're closed but * still waiting for peer to close and connection has been idle - * too long, or if 2MSL time is up from TIME_WAIT, delete connection - * control block. Otherwise, check again in a bit. + * too long delete connection control block. Otherwise, check + * again in a bit. + * + * If in TIME_WAIT state just ignore as this timeout is handled in + * tcp_tw_2msl_scan(). * * If fastrecycle of FIN_WAIT_2, in FIN_WAIT_2 and receiver has closed, * there's no point in hanging onto FIN_WAIT_2 socket. Just close it. * Ignore fact that there were recent incoming segments. */ + if ((inp->inp_flags & INP_TIMEWAIT) != 0) { + INP_WUNLOCK(inp); + INP_INFO_WUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); + return; + } if (tcp_fast_finwait2_recycle && tp->t_state == TCPS_FIN_WAIT_2 && tp->t_inpcb && tp->t_inpcb->inp_socket && (tp->t_inpcb->inp_socket->so_rcv.sb_state & SBS_CANTRCVMORE)) { TCPSTAT_INC(tcps_finwait2_drops); tp = tcp_close(tp); } else { - if (tp->t_state != TCPS_TIME_WAIT && - ticks - tp->t_rcvtime <= TP_MAXIDLE(tp)) { + if (ticks - tp->t_rcvtime <= TP_MAXIDLE(tp)) { if (!callout_reset(&tp->t_timers->tt_2msl, TP_KEEPINTVL(tp), tcp_timer_2msl, tp)) { tp->t_timers->tt_flags &= ~TT_2MSL_RST; |