Skip to content

Commit

Permalink
Fix iocage with non-vnet PPP network interfaces (#362)
Browse files Browse the repository at this point in the history
PPP-like interfaces, such as tun(4), have an additional dest parameter
in their config strings, separated from the first by a string.  ip4_addr
and ip6_addr must be quoted in several places to make such interfaces
work.
  • Loading branch information
asomers authored and Brandon Schneider committed Jun 9, 2016
1 parent 5f827ff commit a2d9c47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/ioc-network
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ __stop_legacy_networking () {
ip4_addr=$(echo $ip4_addr | sed "s/DEFAULT|/$default_iface|/g")
ip6_addr=$(echo $ip6_addr | sed "s/DEFAULT|/$default_iface|/g")

if [ $ip4_addr != "none" ] ; then
if [ "$ip4_addr" != "none" ] ; then
local IFS=','
for ip in $ip4_addr ; do
local iface="$(echo $ip | \
Expand All @@ -234,7 +234,7 @@ __stop_legacy_networking () {
done
fi

if [ $ip6_addr != "none" ] ; then
if [ "$ip6_addr" != "none" ] ; then
local IFS=','
for ip6 in $ip6_addr ; do
local iface="$(echo $ip6 | \
Expand Down
8 changes: 4 additions & 4 deletions lib/ioc-rc
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,11 @@ __legacy_start () {
tmpfs=""
fi

if [ $ip4_addr == "none" ] ; then
if [ "$ip4_addr" == "none" ] ; then
ip4_addr=""
fi

if [ $ip6_addr == "none" ] ; then
if [ "$ip6_addr" == "none" ] ; then
ip6_addr=""
fi

Expand Down Expand Up @@ -265,7 +265,7 @@ __legacy_start () {

if [ $ipv6 == "on" ] ; then
jail -c \
${ip4_addr_propline} \
"${ip4_addr_propline}" \
ip4.saddrsel="$(__get_jail_prop ip4_saddrsel $name)" \
ip4="${ip4}" \
${ip6_addr_propline} \
Expand Down Expand Up @@ -306,7 +306,7 @@ __legacy_start () {
persist
else
jail -c \
${ip4_addr_propline} \
"${ip4_addr_propline}" \
ip4.saddrsel="$(__get_jail_prop ip4_saddrsel $name)" \
ip4="${ip4}" \
name="ioc-$(__get_jail_prop host_hostuuid $name)" \
Expand Down

3 comments on commit a2d9c47

@benschumacher
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change causes iocage to break if the jail is being configured with ip4=inherit and ip4_addr=none. When the jail command-line is executed, you ${ip4_addr_propline} is empty which effectively looks like a null-string argument to Jail.

I've got a local change that fixes it, will create a PR when I have a chance.

@benschumacher
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I would have opened an issue w/this, but it seems issues are disabled on the repo...?)

@skarekrow
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah mostly as I was tired of fielding bug reports. I tried increasing the font on the landing page (you may have seen it's unfortunately intimidatingly large) but i kept getting bugs. I'm not interested in going backwards to fix bugs as I have rewritten this entire program. PR's are fine, or comments on commits like yours who have a fix.

Once the new version is ready for usage, I'll be removing the giant scary intro text and linking the new repo. Which will certainly have issues open. The current master and even develop work quite well, so I figured it wouldn't be a big deal. Thanks for the heads up and upcoming fix @benschumacher 👍

Please sign in to comment.