From e24707bb594eece8a3172c6763ac8fc3a1a8681f Mon Sep 17 00:00:00 2001 From: Matt McEuen Date: Mon, 11 Jul 2016 08:37:59 -0500 Subject: [PATCH] lib/neutron-legacy: replace ip when re-stacking Replicated Yi Zhao's fix for re-adding ipv6 addresses to neutron-legacy (review I9ff62023dbc29a88aec3c48af331c0a49a1270bb). Previously, re-stacking failed with "File exists" for ipv6 addresses on br-ex. With this change, the existing address is replaced on br-ex with the appropriate address. Change-Id: I6e6235132a34469f4e68b5bb3cf51ebdf01c83a2 --- lib/neutron-legacy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/neutron-legacy b/lib/neutron-legacy index 3a1bc64ec5..def1674e7c 100644 --- a/lib/neutron-legacy +++ b/lib/neutron-legacy @@ -610,7 +610,7 @@ function _move_neutron_addresses_route { # on configure we will also add $from_intf as a port on $to_intf, # assuming it is an OVS bridge. - local IP_ADD="" + local IP_REPLACE="" local IP_DEL="" local IP_UP="" local DEFAULT_ROUTE_GW @@ -635,7 +635,7 @@ function _move_neutron_addresses_route { if [[ "$IP_BRD" != "" ]]; then IP_DEL="sudo ip addr del $IP_BRD dev $from_intf" - IP_ADD="sudo ip addr add $IP_BRD dev $to_intf" + IP_REPLACE="sudo ip addr replace $IP_BRD dev $to_intf" IP_UP="sudo ip link set $to_intf up" if [[ "$af" == "inet" ]]; then IP=$(echo $IP_BRD | awk '{ print $1; exit }' | grep -o -E '(.*)/' | cut -d "/" -f1) @@ -645,7 +645,7 @@ function _move_neutron_addresses_route { # The add/del OVS port calls have to happen either before or # after the address is moved in order to not leave it orphaned. - $DEL_OVS_PORT; $IP_DEL; $IP_ADD; $IP_UP; $ADD_OVS_PORT; $ADD_DEFAULT_ROUTE; $ARP_CMD + $DEL_OVS_PORT; $IP_DEL; $IP_REPLACE; $IP_UP; $ADD_OVS_PORT; $ADD_DEFAULT_ROUTE; $ARP_CMD fi }