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
diff --git a/lib/neutron-legacy b/lib/neutron-legacy
index 2c0c9cf..eed477a 100644
--- a/lib/neutron-legacy
+++ b/lib/neutron-legacy
@@ -807,7 +807,7 @@
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