summaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_usrreq.c
diff options
context:
space:
mode:
authorStuart Henderson <sthen@cvs.openbsd.org>2011-07-06 23:44:21 +0000
committerStuart Henderson <sthen@cvs.openbsd.org>2011-07-06 23:44:21 +0000
commit68494a1c586f98ca697a91771fddff329f1dcf14 (patch)
treeadd29116d30508f173c5db57724b3e51943d22f7 /sys/netinet/tcp_usrreq.c
parenteec1e28e98046e35507e4a84c524322c3bce684c (diff)
Add sysctl net.inet.tcp.always_keepalive, when this is set the system
behaves as if SO_KEEPALIVE was set on all TCP sockets, forcing keepalives to be sent every net.inet.tcp.keepidle half-seconds. In conjunction with a keepidle value greatly reduced from the default, this can be useful for keeping sessions open if you are stuck on a network with short NAT or firewall timeouts. Feedback from various people, ok henning@ claudio@
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r--sys/netinet/tcp_usrreq.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 2e14907f448..6f70aaf3184 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_usrreq.c,v 1.107 2011/04/28 09:56:27 claudio Exp $ */
+/* $OpenBSD: tcp_usrreq.c,v 1.108 2011/07/06 23:44:20 sthen Exp $ */
/* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */
/*
@@ -909,6 +909,10 @@ tcp_sysctl(name, namelen, oldp, oldlenp, newp, newlen)
case TCPCTL_DROP:
return (tcp_ident(oldp, oldlenp, newp, newlen, 1));
+ case TCPCTL_ALWAYS_KEEPALIVE:
+ return (sysctl_int(oldp, oldlenp, newp, newlen,
+ &tcp_always_keepalive));
+
#ifdef TCP_ECN
case TCPCTL_ECN:
return (sysctl_int(oldp, oldlenp, newp, newlen,