Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 May 2013 17:23:32 +0400
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        Richard Sharpe <realrichardsharpe@gmail.com>
Cc:        FreeBSD Net <freebsd-net@freebsd.org>
Subject:   Re: TCP_KEEPIDLE vs TCPTV_KEEP_IDLE
Message-ID:  <20130506132332.GZ15182@glebius.int.ru>
In-Reply-To: <CACyXjPzG7dQ4_6J9sziNYY3OFGNwvncobjktV6=c9%2BkfBctAsA@mail.gmail.com>
References:  <CACyXjPzfw3SAGXa0u6xBQgn79VyGEq7wj9V4GgkRnCazD6-PmA@mail.gmail.com> <20130506082235.GV15182@FreeBSD.org> <CACyXjPzG7dQ4_6J9sziNYY3OFGNwvncobjktV6=c9%2BkfBctAsA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, May 06, 2013 at 06:15:11AM -0700, Richard Sharpe wrote:
R> On Mon, May 6, 2013 at 1:22 AM, Gleb Smirnoff <glebius@freebsd.org> wrote:
R> > On Sun, May 05, 2013 at 09:40:42AM -0700, Richard Sharpe wrote:
R> > R> Samba currently has a way to set socket parameters from the smb.conf.
R> > R>
R> > R> This works fine for things like SO_SNDBUF etc, but not so well for the
R> > R> TCP KeepAlive parameters.
R> > R>
R> > R> In this area Samba has a Linux bias.
R> > R>
R> > R> I am looking at adding support for this under FreeBSD.
R> > R>
R> > R> The simplest way, it seems to me, is to enhance configure to find the
R> > R> appropriate symbols under FreeBSD (and it might be extendable to
R> > R> NetBSD etc) and then map them to the Linux symbols:
R> > R>
R> > R> #ifdef THIS_IS_SOME_SORT_OF_BSD
R> > R> #define TCP_KEEPIDLE TCPTV_KEEP_IDLE
R> > R> #endif
R> > R>
R> > R> However, that does mean that *BSD types would have to know that this
R> > R> happening because the names you would use in the smb.conf file would
R> > R> be Linux-specific, and documentation is often woefully incomplete.
R> > R>
R> > R> Is there a better method?
R> >
R> > I don't see the problem you are describing. AFAIK, these socket options
R> > have same names in FreeBSD and Linux.
R> >
R> > For example in Samba 3.6.14 sources it just checks for value defined
R> > and if defined compiles support in. See source3/lib/util_sock.c:
R> 
R> Yes, I know that. However, when I do a find and grep over /usr/include
R> looking for files where TCP_KEEPIDLE is defined, I find nothing. When
R> I do the same for TCPTV_KEEP_IDLE I find
R> /usr/include/netinet/tcp_timer.h.
R> 
R> This seems to mean that the symbols Samba is using are not defined on FreeBSD.
R> 
R> These appear to be the symbols defined in FreeBSD 8,0:

The discussed socket options aren't supported in 8.0.

Please install FreeBSD 9.1 and recompile Samba port. It will pick up
all supported options.

R>  * connection is idle (no segments received) for TCPTV_KEEP_INIT amount of time,
R>  * is established, if the connection is idle for TCPTV_KEEP_IDLE time
R> #define	TCPTV_KEEP_INIT	( 75*hz)		/* initial connect keepalive */
R> #define	TCPTV_KEEP_IDLE	(120*60*hz)		/* dflt time before probing */
R> #define	TCPTV_KEEPINTVL	( 75*hz)		/* default probe interval */
R> #define	TCPTV_KEEPCNT	8			/* max probes before drop */

These defines are not socket options, although they are relevant to discussed
socket options.

-- 
Totus tuus, Glebius.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130506132332.GZ15182>