From owner-freebsd-net@FreeBSD.ORG Mon May 6 13:26:16 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7D37A9CB; Mon, 6 May 2013 13:26:16 +0000 (UTC) (envelope-from realrichardsharpe@gmail.com) Received: from mail-we0-x231.google.com (mail-we0-x231.google.com [IPv6:2a00:1450:400c:c03::231]) by mx1.freebsd.org (Postfix) with ESMTP id E51293D5; Mon, 6 May 2013 13:26:15 +0000 (UTC) Received: by mail-we0-f177.google.com with SMTP id u3so2956360wey.22 for ; Mon, 06 May 2013 06:26:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; bh=1XHQZLKHrT8H4ALN62/3MVya3FN9Sasb/w1dOAIa8MA=; b=Yoig39ZjscGb/DjSk1+EsOl9gNwseA1pxHbwujd2fRCK3auTqfMtlAu6w5T009L0Tc A6YIoeOf0VypetFWzavCvSPjbH0k9BZshRtgf8I5N2gh8OXUAUsrypmZBuHqLPCdO3si /18LP1AeBfz3TNZEN6W+BPlQs7PPMcbOaFhM3Suq7Bvjl+yvZJ/OMBHimqXw7a/Z1xLI LNRHWBZo7tDfUx2kKvUwXIIYuOrt+hGSw8O9q4e0++epZIfgRXx5uSCFTLqAYM//S1js dQRue3774l+eW0gbnQ6cwPwi6efuvf9aW7aR9GKq4hS5jhnWyfVX9tVChdlnS1VjjDuf ALjg== MIME-Version: 1.0 X-Received: by 10.194.11.70 with SMTP id o6mr25342808wjb.29.1367846774455; Mon, 06 May 2013 06:26:14 -0700 (PDT) Received: by 10.194.179.194 with HTTP; Mon, 6 May 2013 06:26:14 -0700 (PDT) In-Reply-To: <20130506132332.GZ15182@glebius.int.ru> References: <20130506082235.GV15182@FreeBSD.org> <20130506132332.GZ15182@glebius.int.ru> Date: Mon, 6 May 2013 06:26:14 -0700 Message-ID: Subject: Re: TCP_KEEPIDLE vs TCPTV_KEEP_IDLE From: Richard Sharpe To: Gleb Smirnoff Content-Type: text/plain; charset=Big5 Content-Transfer-Encoding: quoted-printable 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 13:26:16 -0000 On Mon, May 6, 2013 at 6:23 AM, Gleb Smirnoff wrote: > 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 wr= ote: > 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.c= onf. > R> > R> > R> > R> This works fine for things like SO_SNDBUF etc, but not so well fo= r 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 t= his > R> > R> happening because the names you would use in the smb.conf file wo= uld > 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 opti= ons > 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 amoun= t of time, > R> * is established, if the connection is idle for TCPTV_KEEP_IDLE time > R> #define TCPTV_KEEP_INIT ( 75*hz) /* initial connec= t keepalive */ > R> #define TCPTV_KEEP_IDLE (120*60*hz) /* dflt time befo= re probing */ > R> #define TCPTV_KEEPINTVL ( 75*hz) /* default probe = interval */ > R> #define TCPTV_KEEPCNT 8 /* max probes bef= ore drop */ > > These defines are not socket options, although they are relevant to discu= ssed > socket options. Thank you for that answer. I don't have the option to install FreeBSD 9.1. Maybe we will move to 9.1 in the future. However, I now understand the issues better. Of course that does complicate my proposal on Samba technical, just a little. --=20 Regards, Richard Sharpe (=A6=F3=A5H=B8=D1=BC~=A1H=B0=DF=A6=B3=A7=F9=B1d=A1C--=B1=E4=BE=DE)