From nobody@FreeBSD.org  Wed Jun 13 10:23:30 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 4E608106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 13 Jun 2012 10:23:30 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [69.147.83.34])
	by mx1.freebsd.org (Postfix) with ESMTP id 3992C8FC14
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 13 Jun 2012 10:23:30 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q5DANTEb013443
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 13 Jun 2012 10:23:29 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q5DANTgq013442;
	Wed, 13 Jun 2012 10:23:29 GMT
	(envelope-from nobody)
Message-Id: <201206131023.q5DANTgq013442@red.freebsd.org>
Date: Wed, 13 Jun 2012 10:23:29 GMT
From: Alfred Bartsch <bartsch@dssgmbh.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: /usr/sbin/jail fails with "jail: unknown parameter: ip6"
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         169028
>Category:       bin
>Synopsis:       /usr/sbin/jail fails with "jail: unknown parameter: ip6"
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    eadler
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 13 10:30:06 UTC 2012
>Closed-Date:    Sun Dec 02 14:30:49 UTC 2012
>Last-Modified:  Sun Dec 02 14:30:49 UTC 2012
>Originator:     Alfred Bartsch
>Release:        FreeBSD 8.3-stable
>Organization:
Data-Service GmbH
>Environment:
FreeBSD dsssrvt4.incore 8.3-STABLE FreeBSD 8.3-STABLE #1: Thu May 10 17:14:35 CEST 2012     root@dsssrvt4.incore:/usr/obj/usr/src/sys/SERVER64  amd64

>Description:
In our environment (KERNCONF without INET6) /usr/sbin/jail fails, if one of the ip6 parameters is used. The error message is "jail: unknown parameter: ip6".

IMHO it would be the right way to simply ignore these parameters in a IPV4-only environment.
>How-To-Repeat:
create kernel without INET6
start jail after reboot with ip6=disable
>Fix:


>Release-Note:
>Audit-Trail:

From: "Dewayne" <dewayne.geraghty@heuristicsystems.com.au>
To: <bug-followup@freebsd.org>, <bartsch@dssgmbh.de>
Cc: <obrien@freebsd.org>
Subject: Re: bin/169028: /usr/sbin/jail fails with &quot;jail: unknown parameter: ip6&quot;
Date: Fri, 23 Nov 2012 13:26:01 +1100

 This problem only affects people using jails built without IPV6.  The patch
 below fixes the problem, and anticipates builds without IPv4 :)
 
 My apologies, in advance for the line breaks that my mailer will insert.
 
 The following patch is applied against 9-Stable built on 17th Nov 2012.
 For $FreeBSD: src/etc/rc.d/jail,v 1.47.2.6 2012/10/26 18:06:49 obrien Exp $
 
 
 --- jail.orig   2012-11-06 13:37:55.000000000 +1100
 +++ jail        2012-11-23 12:32:42.000000000 +1100
 @@ -655,8 +655,20 @@
                         i=$((i + 1))
                 done
 
 +               if [ ! -z ${_addrl} ]; then
 +                       eval IPV4="ip4.addr=\"${_addrl}\""
 +                else
 +                        IPV4=""
 +                fi
 +
 +               if [ ! -z ${_addr6l} ]; then
 +                       eval IPV6="ip6.addr=\"${_addr6l}\""
 +               else
 +                       IPV6=""
 +                fi
 +
                 eval ${_setfib} jail -n ${_jail} ${_flags} -i -c
 path=${_rootdir} host.hostname=${_hostname} \
 -                       ip4.addr=\"${_addrl}\" ip6.addr=\"${_addr6l}\"
 ${_parameters} command=${_exec_start} > ${_tmp_jail} 2>&1 \
 +                       "$IPV4" "$IPV6" ${_parameters}
 command=${_exec_start} > ${_tmp_jail} 2>&1 \
                         </dev/null
 
                 if [ "$?" -eq 0 ] ; then
 
 
 Regards, Dewayne.
 
Responsible-Changed-From-To: freebsd-bugs->eadler 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Sun Dec 2 14:30:30 UTC 2012 
Responsible-Changed-Why:  
I committed this 

http://www.freebsd.org/cgi/query-pr.cgi?pr=169028 
State-Changed-From-To: open->closed 
State-Changed-By: eadler 
State-Changed-When: Sun Dec 2 14:30:47 UTC 2012 
State-Changed-Why:  
committed in r243080 

http://www.freebsd.org/cgi/query-pr.cgi?pr=169028 
>Unformatted:
