From 70eea06de0ca519eb3f9f2ea9acb133e2983b0eb Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Mon, 29 Dec 2014 14:14:53 +0000 Subject: [PATCH] more precise detection of weave-attached-ness Rather than looking for the host end of the veth pair, we look for the expected interface inside the container. This has the advantage of detecting weave-attached-ness even when the container is sharing a network namespace with others. Closes #303, #302. --- weave | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weave b/weave index a76b51c3..40dca54e 100755 --- a/weave +++ b/weave @@ -227,8 +227,8 @@ launch() { } attach() { - if ip link show $LOCAL_IFNAME >/dev/null 2>&1 ; then - # veth name already exists, so assume we set it up already; + if ip netns exec $NETNS ip link show $CONTAINER_IFNAME >/dev/null 2>&1 ; then + # container already has the expected network interface, so assume we set it up already; # just add the IP address. if ip netns exec $NETNS ip addr show dev $CONTAINER_IFNAME | grep -F $1 >/dev/null ; then # address was there already