This commit is contained in:
Matthias Radestock committed 2014-09-18 12:30:43 +01:00
1 parent b99e49a84f
commit 331c8553db
1 file changed
+6 -6
+6 -6
View File
@@ -124,13 +124,13 @@ configure_container_networking() {
rm -f $IP_TMPFILE rm -f $IP_TMPFILE
if ip link add name $LOCAL_IFNAME mtu $MTU type veth peer name $GUEST_IFNAME mtu $MTU >$IP_TMPFILE 2>&1 ; then if ip link add name $LOCAL_IFNAME mtu $MTU type veth peer name $GUEST_IFNAME mtu $MTU >$IP_TMPFILE 2>&1 ; then
if (ip link set $LOCAL_IFNAME master $BRIDGE && if (ip link set $LOCAL_IFNAME master $BRIDGE &&
ip link set $LOCAL_IFNAME up && ip link set $LOCAL_IFNAME up &&
ip link set $GUEST_IFNAME netns $NSPID) >$IP_TMPFILE 2>&1 ip link set $GUEST_IFNAME netns $NSPID) >$IP_TMPFILE 2>&1
then then
(ip netns exec $NSPID ip link set $GUEST_IFNAME name $CONTAINER_IFNAME && (ip netns exec $NSPID ip link set $GUEST_IFNAME name $CONTAINER_IFNAME &&
ip netns exec $NSPID ip addr add $2 dev $CONTAINER_IFNAME && ip netns exec $NSPID ip addr add $2 dev $CONTAINER_IFNAME &&
ip netns exec $NSPID ip link set $CONTAINER_IFNAME up && ip netns exec $NSPID ip link set $CONTAINER_IFNAME up &&
check_command_and_run ethtool ip netns exec $NSPID ethtool -K $3 tx off >/dev/null) >$IP_TMPFILE 2>&1 && check_command_and_run ethtool ip netns exec $NSPID ethtool -K $3 tx off >/dev/null) >$IP_TMPFILE 2>&1 &&
EXITCODE=0 EXITCODE=0
else else
# failed before we assigned the veth to the container's namespace - delete it # failed before we assigned the veth to the container's namespace - delete it
@@ -142,7 +142,7 @@ configure_container_networking() {
if ! ps -p $DOCKERPID >/dev/null 2>&1 ; then if ! ps -p $DOCKERPID >/dev/null 2>&1 ; then
echo "Container $1 died" >&2 echo "Container $1 died" >&2
else else
echo "Failure during network set-up:" >&2 echo "Failure during network configuration for container $1:" >&2
cat $IP_TMPFILE >&2 cat $IP_TMPFILE >&2
fi fi
fi fi