From owner-freebsd-current@FreeBSD.ORG Thu Jul 30 13:50:43 2009 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5F82106566B; Thu, 30 Jul 2009 13:50:43 +0000 (UTC) (envelope-from freebsd@levsha.org.ua) Received: from expo.ukrweb.net (mail.univua.net [91.202.128.78]) by mx1.freebsd.org (Postfix) with ESMTP id 9BBE18FC13; Thu, 30 Jul 2009 13:50:43 +0000 (UTC) (envelope-from freebsd@levsha.org.ua) Received: from levsha by expo.ukrweb.net with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1MWW2l-0009zQ-6h; Thu, 30 Jul 2009 16:51:39 +0300 Date: Thu, 30 Jul 2009 16:51:39 +0300 From: Mykola Dzham To: Jamie Gritton Message-ID: <20090730135139.GF20855@expo.ukrweb.net> References: <20090725163207.GP39538@expo.ukrweb.net> <20090727141808.R245@maildrop.int.zabbadoz.net> <20090729113638.GC20855@expo.ukrweb.net> <20090729121834.B245@maildrop.int.zabbadoz.net> <4A708261.7000509@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A708261.7000509@FreeBSD.org> X-Operating-System: FreeBSD/7.0-STABLE (i386) User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-current@FreeBSD.org, "Bjoern A. Zeeb" , freebsd-jail@FreeBSD.org Subject: Re: 8.0 still allow creating ipv6 udp socket in jail without ipv6 ip X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 13:50:44 -0000 Jamie Gritton wrote: > Bjoern A. Zeeb wrote: > > On Wed, 29 Jul 2009, Mykola Dzham wrote: > >> Bjoern A. Zeeb wrote: > >>> On Sat, 25 Jul 2009, Mykola Dzham wrote: > >>>> After r188146 creating tcp ipv6 socket in jail without ipv6 ip is not > >>>> allowed, but udp socket is allowed. > >>> > >>> I cannot really follow what you are trying to say as wrt IPv4 and IPv6 > >>> sockets and what about UDP. > >>> > >>> Your sample further down is trying to use an IPv4 address on an IPv6 > >>> Datagram socket which is an error either way. > >> > >> Some java programms attempt to use ipv6 sockets, then use ipv4 if > >> socket(AF_INET6,...) fail. My sample imitate this > >> > >>> Prior to FreeBSD 7.2 IPv6 hadn't been supported at all for jails. > >>> > >>> With 7.2 it was possible to create IPv6 sockets (but only shortly and > >>> then fail on bind/connect/...). With the commit you reference the > >>> "Protocol not supported" came back in case there was no address of > >>> that address family for a given jail. > >>> > >>> With 8 the primary syntax for jails has changed and the "backward > >>> compat mode" again allows you to create a socket on a jail even if > >>> no address of the same family was configured for the jail. > >>> > >>> This should be addressed by the following patch: > >>> http://people.freebsd.org/~bz/20090727-01-jail8-legacy.diff > >>> > >>> Can you give it a try and report if that fixes your problem? > >> > >> Patch aplied cleanly on r195820 , but jail can not start after patching: > >> > >> # jail -l -U root -i /usr/home/d/guests/tap2 tap2.my.domain.com > >> 10.112.0.151 /bin/sh /etc/rc > >> jail: ip6: unknown boolean value "disable" > > > > r195820 is too old; but Jamie has a better solution; I would suggest > > to backout the jail(8) patch and wait for the next two commits of > > Jamie to HEAD and then update the machine again. > > OK, with r195945 things should be back to disallowing sockets when no > addresses were assigned for that family. You'll need to rebuild the > kernel for the fix, and libjail and possibly jail(8) to get past the > "unknown boolean value" error. On r195949 test program work correctly: it fail on socket(AF_INET6,...) on jail without ipv6 address. Thanks! -- Mykola Dzham, LEFT-(UANIC|RIPE) JID: levsha@jabber.net.ua