Bug 169028

Summary: /usr/sbin/jail fails with "jail: unknown parameter: ip6"
Product: Base System Reporter: bartsch
Component: binAssignee: Eitan Adler <eadler>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description bartsch 2012-06-13 11:30:06 UTC
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
Comment 1 Dewayne 2012-11-23 02:26:01 UTC
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.
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2012-12-02 14:30:30 UTC
Responsible Changed
From-To: freebsd-bugs->eadler

I committed this
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2012-12-02 14:30:47 UTC
State Changed
From-To: open->closed

committed in r243080