Browse code

Delete $IPV6_PUBLIC_NETWORK_GATEWAY IP during cleanup

So that it does not end up being the IP address that is picked to move
back to $PUBLIC_INTERFACE when we call _move_neutron_address_route

Change-Id: I3d29d4f11feff308f6ad5d950ef004b48ec11b67
Closes-Bug: 1514984

Sean M. Collins authored on 2015/11/12 03:36:35
Showing 1 changed files
... ...
@@ -835,6 +835,10 @@ function cleanup_neutron {
835 835
         _move_neutron_addresses_route "$OVS_PHYSICAL_BRIDGE" "$PUBLIC_INTERFACE" False "inet"
836 836
 
837 837
         if [[ $(ip -f inet6 a s dev "$OVS_PHYSICAL_BRIDGE" | grep -c 'global') != 0 ]]; then
838
+            # ip(8) wants the prefix length when deleting
839
+            local v6_gateway
840
+            v6_gateway=$(ip -6 a s dev $OVS_PHYSICAL_BRIDGE | grep $IPV6_PUBLIC_NETWORK_GATEWAY | awk '{ print $2 }')
841
+            sudo ip -6 addr del $v6_gateway dev $OVS_PHYSICAL_BRIDGE
838 842
             _move_neutron_addresses_route "$OVS_PHYSICAL_BRIDGE" "$PUBLIC_INTERFACE" False "inet6"
839 843
         fi
840 844