Deleted Added
full compact
tcp_timer.c (302408) tcp_timer.c (330303)
1/*-
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 16 unchanged lines hidden (view full) ---

25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)tcp_timer.c 8.2 (Berkeley) 5/24/95
30 */
31
32#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 16 unchanged lines hidden (view full) ---

25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)tcp_timer.c 8.2 (Berkeley) 5/24/95
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: stable/11/sys/netinet/tcp_timer.c 300042 2016-05-17 09:53:22Z rrs $");
33__FBSDID("$FreeBSD: stable/11/sys/netinet/tcp_timer.c 330303 2018-03-03 00:54:12Z jhb $");
34
35#include "opt_inet.h"
36#include "opt_inet6.h"
37#include "opt_tcpdebug.h"
38#include "opt_rss.h"
39
40#include <sys/param.h>
41#include <sys/kernel.h>

--- 69 unchanged lines hidden (view full) ---

111 &tcp_rexmit_min, 0, sysctl_msec_to_ticks, "I",
112 "Minimum Retransmission Timeout");
113
114int tcp_rexmit_slop;
115SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_slop, CTLTYPE_INT|CTLFLAG_RW,
116 &tcp_rexmit_slop, 0, sysctl_msec_to_ticks, "I",
117 "Retransmission Timer Slop");
118
34
35#include "opt_inet.h"
36#include "opt_inet6.h"
37#include "opt_tcpdebug.h"
38#include "opt_rss.h"
39
40#include <sys/param.h>
41#include <sys/kernel.h>

--- 69 unchanged lines hidden (view full) ---

111 &tcp_rexmit_min, 0, sysctl_msec_to_ticks, "I",
112 "Minimum Retransmission Timeout");
113
114int tcp_rexmit_slop;
115SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_slop, CTLTYPE_INT|CTLFLAG_RW,
116 &tcp_rexmit_slop, 0, sysctl_msec_to_ticks, "I",
117 "Retransmission Timer Slop");
118
119static int always_keepalive = 1;
119int tcp_always_keepalive = 1;
120SYSCTL_INT(_net_inet_tcp, OID_AUTO, always_keepalive, CTLFLAG_RW,
120SYSCTL_INT(_net_inet_tcp, OID_AUTO, always_keepalive, CTLFLAG_RW,
121 &always_keepalive , 0, "Assume SO_KEEPALIVE on all TCP connections");
121 &tcp_always_keepalive , 0, "Assume SO_KEEPALIVE on all TCP connections");
122__strong_reference(tcp_always_keepalive, always_keepalive);
122
123int tcp_fast_finwait2_recycle = 0;
124SYSCTL_INT(_net_inet_tcp, OID_AUTO, fast_finwait2_recycle, CTLFLAG_RW,
125 &tcp_fast_finwait2_recycle, 0,
126 "Recycle closed FIN_WAIT_2 connections faster");
127
128int tcp_finwait2_timeout;
129SYSCTL_PROC(_net_inet_tcp, OID_AUTO, finwait2_timeout, CTLTYPE_INT|CTLFLAG_RW,

--- 293 unchanged lines hidden (view full) ---

423 ("%s: tp %p keep callout should be running", __func__, tp));
424 /*
425 * Keep-alive timer went off; send something
426 * or drop connection if idle for too long.
427 */
428 TCPSTAT_INC(tcps_keeptimeo);
429 if (tp->t_state < TCPS_ESTABLISHED)
430 goto dropit;
123
124int tcp_fast_finwait2_recycle = 0;
125SYSCTL_INT(_net_inet_tcp, OID_AUTO, fast_finwait2_recycle, CTLFLAG_RW,
126 &tcp_fast_finwait2_recycle, 0,
127 "Recycle closed FIN_WAIT_2 connections faster");
128
129int tcp_finwait2_timeout;
130SYSCTL_PROC(_net_inet_tcp, OID_AUTO, finwait2_timeout, CTLTYPE_INT|CTLFLAG_RW,

--- 293 unchanged lines hidden (view full) ---

424 ("%s: tp %p keep callout should be running", __func__, tp));
425 /*
426 * Keep-alive timer went off; send something
427 * or drop connection if idle for too long.
428 */
429 TCPSTAT_INC(tcps_keeptimeo);
430 if (tp->t_state < TCPS_ESTABLISHED)
431 goto dropit;
431 if ((always_keepalive || inp->inp_socket->so_options & SO_KEEPALIVE) &&
432 if ((tcp_always_keepalive ||
433 inp->inp_socket->so_options & SO_KEEPALIVE) &&
432 tp->t_state <= TCPS_CLOSING) {
433 if (ticks - tp->t_rcvtime >= TP_KEEPIDLE(tp) + TP_MAXIDLE(tp))
434 goto dropit;
435 /*
436 * Send a packet designed to force a response
437 * if the peer is up and reachable:
438 * either an ACK if the connection is still alive,
439 * or an RST if the peer has closed the connection

--- 567 unchanged lines hidden ---
434 tp->t_state <= TCPS_CLOSING) {
435 if (ticks - tp->t_rcvtime >= TP_KEEPIDLE(tp) + TP_MAXIDLE(tp))
436 goto dropit;
437 /*
438 * Send a packet designed to force a response
439 * if the peer is up and reachable:
440 * either an ACK if the connection is still alive,
441 * or an RST if the peer has closed the connection

--- 567 unchanged lines hidden ---