Date: Fri, 8 Nov 2013 11:42:02 +0400 From: Gleb Smirnoff <glebius@FreeBSD.org> To: Maxim Sobolev <sobomax@FreeBSD.org> Cc: lstewart@FreeBSD.org, stable@freebsd.org, bz@FreeBSD.org, andre@FreeBSD.org, pgsql@FreeBSD.org 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> In-Reply-To: <CAH7qZfuy8GpRMxz84FArGreqE0YdYUAt1-CRwh%2BsJi8f%2B1Y3ag@mail.gmail.com> References: <CAH7qZfuy8GpRMxz84FArGreqE0YdYUAt1-CRwh%2BsJi8f%2B1Y3ag@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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+--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131108074202.GO7577>