diff --git a/weave b/weave index af0763c9..1e90266e 100755 --- a/weave +++ b/weave @@ -225,17 +225,22 @@ connect_container_to_bridge() { return 1 fi - if run_tool host ethtool -K $GUEST_IFNAME tx off >/dev/null && - ip link set $LOCAL_IFNAME master $BRIDGE && - ip link set $LOCAL_IFNAME up && - ip link set $GUEST_IFNAME netns $NETNS ; then - ip netns exec $NETNS ip link set $GUEST_IFNAME name $CONTAINER_IFNAME - else + if ! run_tool host ethtool -K $GUEST_IFNAME tx off >/dev/null || + ! ip link set $LOCAL_IFNAME master $BRIDGE || + ! ip link set $LOCAL_IFNAME up || + ! ip link set $GUEST_IFNAME netns $NETNS ; then # failed before we assigned the veth to the container's - # namespace - delete it + # namespace ip link del $LOCAL_IFNAME type veth || true return 1 fi + + if ! ip netns exec $NETNS ip link set $GUEST_IFNAME name $CONTAINER_IFNAME ; then + # failed after we assigned the veth to the container's + # namespace + ip netns exec $NETNS ip link del $GUEST_IFNAME type veth || true + return 1 + fi } launch() {