From owner-svn-src-all@FreeBSD.ORG Mon May 30 07:52:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 704C6106564A; Mon, 30 May 2011 07:52:29 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 1F0A58FC0A; Mon, 30 May 2011 07:52:29 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 0A26725D385D; Mon, 30 May 2011 07:52:27 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 3793315A097A; Mon, 30 May 2011 07:52:27 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id uc4MUdHnCBfR; Mon, 30 May 2011 07:52:26 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id DEC9715A095A; Mon, 30 May 2011 07:52:25 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <20110530072056.GK2114@garage.freebsd.pl> Date: Mon, 30 May 2011 07:52:24 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <1E64D441-B1DD-4535-BA36-BE89DBEF06F2@FreeBSD.org> References: <201105292103.p4TL3egv046536@svn.freebsd.org> <20110530072056.GK2114@garage.freebsd.pl> To: Pawel Jakub Dawidek X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r222465 - in head/usr.sbin: jail jls X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 May 2011 07:52:29 -0000 On May 30, 2011, at 7:20 AM, Pawel Jakub Dawidek wrote: > On Sun, May 29, 2011 at 09:03:40PM +0000, Bjoern A. Zeeb wrote: >> Author: bz >> Date: Sun May 29 21:03:40 2011 >> New Revision: 222465 >> URL: http://svn.freebsd.org/changeset/base/222465 >>=20 >> Log: >> Check for IPv4 or IPv6 to be available by the kernel to not >> provoke errors trying to query options not available. >> Make it possible to compile out INET or INET6 only parts. >=20 > That's interesting. When adding IPv6 support to HAST I was thinking > about making IPv4/IPv6 support compile options. But after discussing > this with various folks I decided to always compile IPv4 and IPv6 > support in for userland tools and detect what is supported by the = kernel > at runtime. This way it is easy to just recompile the kernel to > add/remove IPv4/IPv6 support and userland tools may stay unmodified. >=20 > Do we have some general recommendation within FreeBSD how to handle = this > in userland? (ie. at compile-time or at run-time) The code by default still compiles for dual-stack usage and dynamically detects available address families now avoiding errors. The problem before was that on an IPv6-only kernel you get an error, = which prevents the classic jls command from working: # jls=20 jls: unknown parameter: ip4.addr Now that works, skipping the unavailable option without erroring. The = problem here is historical as jails in the early days had the single one = mandatory IPv4 address, which now no longer is mandatory or might not even be possible = to use.=20 In addition to dynamic detection it allows people to reduce the size of = the binary using src.conf like we have supported for compiling out INET6 for = ages for various user space binaries, just that we can compile out one or the = other now. While possibly less interesting for jail/jls there are still = people building images for very tiny RAM and disk - say very cheap IPv6 only sensor = networks with tens of thousands of nodes and for them every byte might still = matter, Compiling out will also force an address family even on a dual stack = kernel. So having a mix of src.conf options and feature_present(3) gives the = full flexibility for everyone. Bjoern --=20 Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family.