From 4f900f1690e469db4d3ab48dfb2a0a046c0a8c30 Mon Sep 17 00:00:00 2001 From: Ravi Kumar Boyapati Date: Wed, 22 Mar 2017 23:07:45 -0400 Subject: [PATCH] Fix the lock type variable Fixed the lock variable to force iptables to acquire the lock before adding/deleting rules. Change-Id: If2307681db056302c9a677961194d9dde87de137 --- templates/lxc-system-manage.j2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/lxc-system-manage.j2 b/templates/lxc-system-manage.j2 index 7cac4c17..10c122f9 100644 --- a/templates/lxc-system-manage.j2 +++ b/templates/lxc-system-manage.j2 @@ -97,7 +97,7 @@ function add_rules { echo 0 > /proc/sys/net/ipv6/conf/${LXC_BRIDGE}/autoconf ip -6 addr add dev ${LXC_BRIDGE} ${LXC_IPV6_ADDR}/${LXC_IPV6_MASK} if [ "$LXC_IPV6_NAT" = "true" ]; then - ip6tables $use_iptables_lock -t nat -A POSTROUTING -s ${LXC_IPV6_NETWORK} ! -d ${LXC_IPV6_NETWORK} -j MASQUERADE + ip6tables $USE_IPTABLES_LOCK -t nat -A POSTROUTING -s ${LXC_IPV6_NETWORK} ! -d ${LXC_IPV6_NETWORK} -j MASQUERADE fi fi @@ -154,8 +154,8 @@ function pre_up { fi # Set the lock type where applicable - use_iptables_lock="-w" - iptables -w -L -n > /dev/null 2>&1 || use_iptables_lock="" + USE_IPTABLES_LOCK="-w" + iptables -w -L -n > /dev/null 2>&1 || USE_IPTABLES_LOCK="" } function start_dnsmasq {