Fix the lock type variable

Fixed the lock variable to force iptables to acquire the lock
before adding/deleting rules.

Change-Id: If2307681db056302c9a677961194d9dde87de137
This commit is contained in:
Ravi Kumar Boyapati 2017-03-22 23:07:45 -04:00
parent d8368014bc
commit 4f900f1690

View File

@ -97,7 +97,7 @@ function add_rules {
echo 0 > /proc/sys/net/ipv6/conf/${LXC_BRIDGE}/autoconf echo 0 > /proc/sys/net/ipv6/conf/${LXC_BRIDGE}/autoconf
ip -6 addr add dev ${LXC_BRIDGE} ${LXC_IPV6_ADDR}/${LXC_IPV6_MASK} ip -6 addr add dev ${LXC_BRIDGE} ${LXC_IPV6_ADDR}/${LXC_IPV6_MASK}
if [ "$LXC_IPV6_NAT" = "true" ]; then 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
fi fi
@ -154,8 +154,8 @@ function pre_up {
fi fi
# Set the lock type where applicable # Set the lock type where applicable
use_iptables_lock="-w" USE_IPTABLES_LOCK="-w"
iptables -w -L -n > /dev/null 2>&1 || use_iptables_lock="" iptables -w -L -n > /dev/null 2>&1 || USE_IPTABLES_LOCK=""
} }
function start_dnsmasq { function start_dnsmasq {