aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2018-01-30 23:01:37 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2018-01-30 23:01:37 +0000
commitf17985319dd2e9e651c638ab44eaaffbef8f70af (patch)
tree0a8ad9b764d369c21936599174240a305d07f66b /sys/netinet
parentaf63bbd0f0b0c7d47ddd043e54c95a9a056ba8a0 (diff)
downloadsrc-f17985319dd2e9e651c638ab44eaaffbef8f70af.tar.gz
src-f17985319dd2e9e651c638ab44eaaffbef8f70af.zip
Export tcp_always_keepalive for use by the Chelsio TOM module.
This used to work by accident with ld.bfd even though always_keepalive was marked as static. LLD honors static more correctly, so export this variable properly (including moving it into the tcp_* namespace). Reviewed by: bz, emaste MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D14129
Notes
Notes: svn path=/head/; revision=328608
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/tcp_timer.c7
-rw-r--r--sys/netinet/tcp_timer.h1
2 files changed, 5 insertions, 3 deletions
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c
index b50a580dd7bc..cea7e5a5e5a1 100644
--- a/sys/netinet/tcp_timer.c
+++ b/sys/netinet/tcp_timer.c
@@ -118,9 +118,9 @@ SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_slop, CTLTYPE_INT|CTLFLAG_RW,
&tcp_rexmit_slop, 0, sysctl_msec_to_ticks, "I",
"Retransmission Timer Slop");
-static int always_keepalive = 1;
+int tcp_always_keepalive = 1;
SYSCTL_INT(_net_inet_tcp, OID_AUTO, always_keepalive, CTLFLAG_RW,
- &always_keepalive , 0, "Assume SO_KEEPALIVE on all TCP connections");
+ &tcp_always_keepalive , 0, "Assume SO_KEEPALIVE on all TCP connections");
int tcp_fast_finwait2_recycle = 0;
SYSCTL_INT(_net_inet_tcp, OID_AUTO, fast_finwait2_recycle, CTLFLAG_RW,
@@ -471,7 +471,8 @@ tcp_timer_keep(void *xtp)
TCPSTAT_INC(tcps_keeptimeo);
if (tp->t_state < TCPS_ESTABLISHED)
goto dropit;
- if ((always_keepalive || inp->inp_socket->so_options & SO_KEEPALIVE) &&
+ if ((tcp_always_keepalive ||
+ inp->inp_socket->so_options & SO_KEEPALIVE) &&
tp->t_state <= TCPS_CLOSING) {
if (ticks - tp->t_rcvtime >= TP_KEEPIDLE(tp) + TP_MAXIDLE(tp))
goto dropit;
diff --git a/sys/netinet/tcp_timer.h b/sys/netinet/tcp_timer.h
index 9a26c95d225c..b0ff38091a0b 100644
--- a/sys/netinet/tcp_timer.h
+++ b/sys/netinet/tcp_timer.h
@@ -197,6 +197,7 @@ extern int tcp_ttl; /* time to live for TCP segs */
extern int tcp_backoff[];
extern int tcp_syn_backoff[];
+extern int tcp_always_keepalive;
extern int tcp_finwait2_timeout;
extern int tcp_fast_finwait2_recycle;