Browse code

Filter out temporary addresses

Some IPv6 addresses are temporary and are generated by IPv6 privacy
extensions. They eventually expire and are regenerated, so we should
filter them out.

Change-Id: I916d6a335bab096f765ae8c7e0e540a4349dd15f
Closes-Bug: #1488691

Sean M. Collins authored on 2015/08/26 08:24:51
Showing 1 changed files
... ...
@@ -591,7 +591,7 @@ function get_default_host_ip {
591 591
         host_ip=""
592 592
         # Find the interface used for the default route
593 593
         host_ip_iface=${host_ip_iface:-$(ip -f $af route | awk '/default/ {print $5}' | head -1)}
594
-        local host_ips=$(LC_ALL=C ip -f $af addr show ${host_ip_iface} | awk /$af'/ {split($2,parts,"/");  print parts[1]}')
594
+        local host_ips=$(LC_ALL=C ip -f $af addr show ${host_ip_iface} | sed /temporary/d |awk /$af'/ {split($2,parts,"/");  print parts[1]}')
595 595
         local ip
596 596
         for ip in $host_ips; do
597 597
             # Attempt to filter out IP addresses that are part of the fixed and