Don't clean up the container interface after moving it into the netns

The most likely cause of failure is the container going away, in which.
case we don't need to clean up.  And there are other points of possible
failure in the same category in attach(), so making sure we clean up the
container interface under all conditions is a  broader issue.
This commit is contained in:
David Wragg committed 2015-03-16 15:12:44 +00:00
1 parent e844753a21
commit 39011a5218
1 file changed
-4
-4
View File
@@ -241,10 +241,6 @@ connect_container_to_bridge() {
if ! ip netns exec $NETNS ip link set $GUEST_IFNAME name $CONTAINER_IFNAME ||
! configure_arp_cache $CONTAINER_IFNAME "ip netns exec $NETNS" ; then
# failed after we assigned the veth to the container's
# namespace, and we don't know if it was renamed or not.
ip netns exec $NETNS ip link del $GUEST_IFNAME type veth 2>/dev/null || true
ip netns exec $NETNS ip link del $CONTAINER_IFNAME type veth 2>/dev/null || true
return 1
fi
}