diff options
author | Garrett D'Amore <garrett@nexenta.com> | 2011-08-17 16:31:10 -0700 |
---|---|---|
committer | Garrett D'Amore <garrett@nexenta.com> | 2011-08-17 16:31:10 -0700 |
commit | 3d0a255c417cf2e7b69e770de43f195b0eeffacb (patch) | |
tree | 9fbbacfdcae24cab7914edc9825da1708191153b /usr/src/uts/common/inet/tcp/tcp_timers.c | |
parent | 49ba5bc4e7d0a3e56108ec7cbf1d8cf2483ccca9 (diff) | |
download | illumos-gate-3d0a255c417cf2e7b69e770de43f195b0eeffacb.tar.gz |
1361 Add support for socket options TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Reviewed by: Pavan <pavan.tc@gmail.com>
Reviewed by: Dan McDonald <danmcd at nexenta.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Approved by: Garrett D'Amore <garrett@damore.org>
Diffstat (limited to 'usr/src/uts/common/inet/tcp/tcp_timers.c')
-rw-r--r-- | usr/src/uts/common/inet/tcp/tcp_timers.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/usr/src/uts/common/inet/tcp/tcp_timers.c b/usr/src/uts/common/inet/tcp/tcp_timers.c index c883be8cfd..90e1c9178c 100644 --- a/usr/src/uts/common/inet/tcp/tcp_timers.c +++ b/usr/src/uts/common/inet/tcp/tcp_timers.c @@ -21,6 +21,7 @@ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved. */ #include <sys/types.h> @@ -390,6 +391,11 @@ tcp_timers_stop(tcp_t *tcp) * (tcp_ka_interval + tcp_ka_abort_thres) we have not heard anything, * kill the connection unless the keepalive abort threshold is 0. In * that case, we will probe "forever." + * If tcp_ka_cnt and tcp_ka_rinterval are non-zero, then we do not follow + * the exponential backoff, but send probes tcp_ka_cnt times in regular + * intervals of tcp_ka_rinterval milliseconds until we hear back from peer. + * Kill the connection if we don't hear back from peer after tcp_ka_cnt + * probes are sent. */ void tcp_keepalive_timer(void *arg) @@ -455,7 +461,9 @@ tcp_keepalive_timer(void *arg) if (mp != NULL) { tcp_send_data(tcp, mp); TCPS_BUMP_MIB(tcps, tcpTimKeepaliveProbe); - if (tcp->tcp_ka_last_intrvl != 0) { + if (tcp->tcp_ka_rinterval) { + firetime = tcp->tcp_ka_rinterval; + } else if (tcp->tcp_ka_last_intrvl != 0) { int max; /* * We should probe again at least |