From owner-freebsd-stable@FreeBSD.ORG Fri Nov 8 07:42:24 2013 Return-Path: Delivered-To: stable@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 ESMTP id D3A84C76; Fri, 8 Nov 2013 07:42:24 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (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 3755C25F2; Fri, 8 Nov 2013 07:42:23 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id rA87g2kX027945 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 8 Nov 2013 11:42:02 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id rA87g2o6027944; Fri, 8 Nov 2013 11:42:02 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 8 Nov 2013 11:42:02 +0400 From: Gleb Smirnoff To: Maxim Sobolev Subject: Re: svn commit: r232945 - in stable/9: share/man/man4 sys/i386/conf sys/netinet sys/sys Message-ID: <20131108074202.GO7577@glebius.int.ru> References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="vEao7xgI/oilGqZ+" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) Cc: lstewart@FreeBSD.org, stable@freebsd.org, bz@FreeBSD.org, andre@FreeBSD.org, pgsql@FreeBSD.org X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2013 07:42:24 -0000 --vEao7xgI/oilGqZ+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Nov 07, 2013 at 03:10:27PM -0800, Maxim Sobolev wrote: M> Hey guys, any particular reasons why those options are write-only? Is it M> just laziness of the developer or is there any particular fundamental M> reason for it being like this. This might be some regression, since at M> least some 3rd party software that does getsockopt(), checks its status and M> only does setsockopt() if the former completed successfully. Which kinda M> makes sense IMHO. The software in question is PostgreSQL here. As a result, M> the software may be misbehaving since it detects those options as being M> present on the configure stage, but cannot really make any use of them M> later on during runtime. Had it not detect those options at the build M> stage, it might have used some kind of software protocol workaround (i.e. M> sending ping/nop packets) so it in fact might trigger some bugs and whatnot. M> M> We believe it might be the reason for some of our problems here with PG 91 M> and FreeBSD 92. Can you please try attached patch and report? -- Totus tuus, Glebius. --vEao7xgI/oilGqZ+ Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="tcp_usrreq.c.diff" Index: sys/netinet/tcp_usrreq.c =================================================================== --- sys/netinet/tcp_usrreq.c (revision 257840) +++ sys/netinet/tcp_usrreq.c (working copy) @@ -1585,6 +1585,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; --vEao7xgI/oilGqZ+--