Browse code

HOST_IP should not be used in moving address to route

In neutron-legacy function _move_neutron_addresses_route, there are
few lines trying to figure out the bridge IP by assuming that the
bridge IP will be always same as the HOST_IP, this is not always true.
When the nic bears the HOST_IP and the nic which will be used as the
public network are different nics, the code in that method fails.
Eventually the function fails with network unreachable error.

This patch set fixes the problem, so that when HOST_IP and the IP for
the bridge are different, devstack will still be setup correctly.

Change-Id: I4d67f61c2ffd93f1e8ea2f8fe3b551044fab294e
Closes-bug: #1498538

Tong Li authored on 2015/09/23 00:16:11
Showing 1 changed files
... ...
@@ -810,11 +810,11 @@ function _move_neutron_addresses_route {
810 810
         local ADD_OVS_PORT=""
811 811
 
812 812
         if [[ $af == "inet" ]]; then
813
-            IP_BRD=$(ip -f $af a s dev $from_intf | grep $HOST_IP | awk '{ print $2, $3, $4; exit }')
813
+            IP_BRD=$(ip -f $af a s dev $from_intf | grep inet | awk '{ print $2, $3, $4; exit }')
814 814
         fi
815 815
 
816 816
         if [[ $af == "inet6" ]]; then
817
-            IP_BRD=$(ip -f $af a s dev $from_intf | grep $HOST_IPV6 | awk '{ print $2, $3, $4; exit }')
817
+            IP_BRD=$(ip -f $af a s dev $from_intf | grep inet6 | awk '{ print $2, $3, $4; exit }')
818 818
         fi
819 819
 
820 820
         if [ "$DEFAULT_ROUTE_GW" != "" ]; then