Merge "Use arping when moving an IP address"

This commit is contained in:
Jenkins 2016-05-11 20:46:41 +00:00 committed by Gerrit Code Review
commit bba6b2a3fd

View File

@ -624,6 +624,13 @@ function _move_neutron_addresses_route {
IP_BRD=$(ip -f $af a s dev $from_intf scope global primary | grep inet | awk '{ print $2, $3, $4; exit }')
if [[ "$af" == "inet" ]]; then
IP=$(echo $IP_BRD | awk '{ print $1; exit }' | grep -o -E '(.*)/' | cut -d "/" -f1)
ARP_CMD="arping -A -c 3 -w 4.5 -I $to_intf $IP "
else
ARP_CMD=""
fi
if [ "$DEFAULT_ROUTE_GW" != "" ]; then
ADD_DEFAULT_ROUTE="sudo ip -f $af r replace default via $DEFAULT_ROUTE_GW dev $to_intf"
fi
@ -644,7 +651,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
$DEL_OVS_PORT; $IP_DEL; $IP_ADD; $IP_UP; $ADD_OVS_PORT; $ADD_DEFAULT_ROUTE; $ARP_CMD
fi
}