Only take the first global, non temporary ipv6 address

Taking a temporary IPv6 address created through the OS' support for
Privacy Extensions (RFC 4941) is not very useful. It would occur because
it happened to be the first in the list returned from ip(8). Instead,
grab the first IPv6 address that is not a temporary address.

Related-Bug: #1488691

Change-Id: I7f455572241e7d0c7406f173239a2270a4d8926a
This commit is contained in:
Sean M. Collins 2015-11-10 13:30:20 -05:00
parent 59e86a3aae
commit 9af81997b5

View File

@ -807,7 +807,7 @@ function _move_neutron_addresses_route {
fi
if [[ $af == "inet6" ]]; then
IP_BRD=$(ip -f $af a s dev $from_intf | grep inet6 | awk '{ print $2, $3, $4; exit }')
IP_BRD=$(ip -f $af a s dev $from_intf | grep 'scope global' | sed '/temporary/d' | awk '{ print $2, $3, $4; exit }')
fi
if [ "$DEFAULT_ROUTE_GW" != "" ]; then