Browse code

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

Sean M. Collins authored on 2015/11/11 03:30:20
Showing 1 changed files
... ...
@@ -807,7 +807,7 @@ function _move_neutron_addresses_route {
807 807
         fi
808 808
 
809 809
         if [[ $af == "inet6" ]]; then
810
-            IP_BRD=$(ip -f $af a s dev $from_intf | grep inet6 | awk '{ print $2, $3, $4; exit }')
810
+            IP_BRD=$(ip -f $af a s dev $from_intf | grep 'scope global' | sed '/temporary/d' | awk '{ print $2, $3, $4; exit }')
811 811
         fi
812 812
 
813 813
         if [ "$DEFAULT_ROUTE_GW" != "" ]; then