From owner-freebsd-net@FreeBSD.ORG Mon May 6 08:22:37 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 64A149D3 for ; Mon, 6 May 2013 08:22:37 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id E7467CFD for ; Mon, 6 May 2013 08:22:36 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.6/8.14.6) with ESMTP id r468MZUi071506; Mon, 6 May 2013 12:22:35 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.6/8.14.6/Submit) id r468MZF5071505; Mon, 6 May 2013 12:22:35 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 6 May 2013 12:22:35 +0400 From: Gleb Smirnoff To: Richard Sharpe Subject: Re: TCP_KEEPIDLE vs TCPTV_KEEP_IDLE Message-ID: <20130506082235.GV15182@FreeBSD.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: FreeBSD Net X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 08:22:37 -0000 On Sun, May 05, 2013 at 09:40:42AM -0700, Richard Sharpe wrote: R> Samba currently has a way to set socket parameters from the smb.conf. R> R> This works fine for things like SO_SNDBUF etc, but not so well for the R> TCP KeepAlive parameters. R> R> In this area Samba has a Linux bias. R> R> I am looking at adding support for this under FreeBSD. R> R> The simplest way, it seems to me, is to enhance configure to find the R> appropriate symbols under FreeBSD (and it might be extendable to R> NetBSD etc) and then map them to the Linux symbols: R> R> #ifdef THIS_IS_SOME_SORT_OF_BSD R> #define TCP_KEEPIDLE TCPTV_KEEP_IDLE R> #endif R> R> However, that does mean that *BSD types would have to know that this R> happening because the names you would use in the smb.conf file would R> be Linux-specific, and documentation is often woefully incomplete. R> R> Is there a better method? I don't see the problem you are describing. AFAIK, these socket options have same names in FreeBSD and Linux. For example in Samba 3.6.14 sources it just checks for value defined and if defined compiles support in. See source3/lib/util_sock.c: #ifdef TCP_KEEPCNT {"TCP_KEEPCNT", IPPROTO_TCP, TCP_KEEPCNT, 0, OPT_INT}, #endif #ifdef TCP_KEEPIDLE {"TCP_KEEPIDLE", IPPROTO_TCP, TCP_KEEPIDLE, 0, OPT_INT}, #endif #ifdef TCP_KEEPINTVL {"TCP_KEEPINTVL", IPPROTO_TCP, TCP_KEEPINTVL, 0, OPT_INT}, #endif P.S. Since you mention TCPTV_KEEP_IDLE, I've tried to grep samba sources for this definition getting zero results. -- Totus tuus, Glebius.