From 6189eacb69628a4aea8e69ee24f69814da815fe1 Mon Sep 17 00:00:00 2001 From: Matteo Panella Date: Wed, 27 Jul 2016 01:48:23 +0200 Subject: [PATCH] Preserve IFS in __stop_legacy_networking (#366) __stop_legacy_networking sets IFS to ',' without restoring it. This confuses subsequent variable expansions in the function and does not release IPv6 resources for jails with multiple IPv6 aliases. (cherry picked from commit 9cf580d587d4c35053c0c7c3cb0639014dccc741) --- lib/ioc-network | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ioc-network b/lib/ioc-network index 4ab875b8..3fa6869f 100644 --- a/lib/ioc-network +++ b/lib/ioc-network @@ -222,6 +222,7 @@ __stop_legacy_networking () { ip6_addr=$(echo $ip6_addr | sed "s/DEFAULT|/$default_iface|/g") if [ "$ip4_addr" != "none" ] ; then + local oIFS=$IFS local IFS=',' for ip in $ip4_addr ; do local iface="$(echo $ip | \ @@ -232,9 +233,11 @@ __stop_legacy_networking () { ifconfig $iface $ip4 -alias done + local IFS=$oIFS fi if [ "$ip6_addr" != "none" ] ; then + local oIFS=$IFS local IFS=',' for ip6 in $ip6_addr ; do local iface="$(echo $ip6 | \ @@ -244,5 +247,6 @@ __stop_legacy_networking () { awk 'BEGIN { FS = "/" } ; { print $1 }')" ifconfig $iface inet6 $ip6 -alias done + local IFS=$oIFS fi }