From 00a4a5e056a565e81822af201987ff65bae00450 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Fri, 24 Oct 2014 13:15:15 +0100 Subject: [PATCH] refactor: simplify multicast route addition in 'attach' --- weave | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/weave b/weave index 8afcf009..176461c5 100755 --- a/weave +++ b/weave @@ -191,13 +191,10 @@ attach() { return 1 fi - if ip netns exec $NETNS ip route show | grep '^224\.0\.0\.0/4' >/dev/null ; then - # There's a multicast route already present, leave it alone. - return 0 - fi - # Route multicast packets across the weave network. - ip netns exec $NETNS ip route add 224.0.0.0/4 dev $CONTAINER_IFNAME + if ! ip netns exec $NETNS ip route show | grep '^224\.0\.0\.0/4' >/dev/null ; then + ip netns exec $NETNS ip route add 224.0.0.0/4 dev $CONTAINER_IFNAME + fi } detach() {