From owner-svn-src-all@FreeBSD.ORG Wed Jan 22 10:08:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 54CEB366; Wed, 22 Jan 2014 10:08:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 26DF81627; Wed, 22 Jan 2014 10:08:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0MA8Ykj075482; Wed, 22 Jan 2014 10:08:34 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0MA8XJ6075479; Wed, 22 Jan 2014 10:08:33 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201401221008.s0MA8XJ6075479@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 22 Jan 2014 10:08:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r261017 - in stable/10: share/man/man4 sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jan 2014 10:08:34 -0000 Author: glebius Date: Wed Jan 22 10:08:33 2014 New Revision: 261017 URL: http://svnweb.freebsd.org/changeset/base/261017 Log: Merge r257846: Make TCP_KEEP* socket options readable. At least PostgreSQL wants to read the values. Modified: stable/10/share/man/man4/tcp.4 stable/10/sys/netinet/tcp_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/tcp.4 ============================================================================== --- stable/10/share/man/man4/tcp.4 Wed Jan 22 10:01:13 2014 (r261016) +++ stable/10/share/man/man4/tcp.4 Wed Jan 22 10:08:33 2014 (r261017) @@ -38,7 +38,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd March 7, 2012 +.Dd November 8, 2013 .Dt TCP 4 .Os .Sh NAME @@ -48,6 +48,7 @@ .In sys/types.h .In sys/socket.h .In netinet/in.h +.In netinet/tcp.h .Ft int .Fn socket AF_INET SOCK_STREAM 0 .Sh DESCRIPTION @@ -147,7 +148,7 @@ See .Xr mod_cc 4 for details. .It Dv TCP_KEEPINIT -This write-only +This .Xr setsockopt 2 option accepts a per-socket timeout argument of .Vt "u_int" @@ -160,7 +161,7 @@ in the .Sx MIB Variables section further down. .It Dv TCP_KEEPIDLE -This write-only +This .Xr setsockopt 2 option accepts an argument of .Vt "u_int" @@ -176,7 +177,7 @@ in the .Sx MIB Variables section further down. .It Dv TCP_KEEPINTVL -This write-only +This .Xr setsockopt 2 option accepts an argument of .Vt "u_int" @@ -191,7 +192,7 @@ in the .Sx MIB Variables section further down. .It Dv TCP_KEEPCNT -This write-only +This .Xr setsockopt 2 option accepts an argument of .Vt "u_int" Modified: stable/10/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/10/sys/netinet/tcp_usrreq.c Wed Jan 22 10:01:13 2014 (r261016) +++ stable/10/sys/netinet/tcp_usrreq.c Wed Jan 22 10:08:33 2014 (r261017) @@ -1584,6 +1584,27 @@ unlock_and_done: INP_WUNLOCK(inp); error = sooptcopyout(sopt, buf, TCP_CA_NAME_MAX); break; + case TCP_KEEPIDLE: + case TCP_KEEPINTVL: + case TCP_KEEPINIT: + case TCP_KEEPCNT: + switch (sopt->sopt_name) { + case TCP_KEEPIDLE: + ui = tp->t_keepidle / hz; + break; + case TCP_KEEPINTVL: + ui = tp->t_keepintvl / hz; + break; + case TCP_KEEPINIT: + ui = tp->t_keepinit / hz; + break; + case TCP_KEEPCNT: + ui = tp->t_keepcnt; + break; + } + INP_WUNLOCK(inp); + error = sooptcopyout(sopt, &ui, sizeof(ui)); + break; default: INP_WUNLOCK(inp); error = ENOPROTOOPT;