From d20435bdd4fb5ea856497c797376517ed516d833 Mon Sep 17 00:00:00 2001 From: "Sean M. Collins" Date: Tue, 25 Aug 2015 19:24:51 -0400 Subject: [PATCH] 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 --- functions-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions-common b/functions-common index f6a525354f..446de5374f 100644 --- a/functions-common +++ b/functions-common @@ -591,7 +591,7 @@ function get_default_host_ip { host_ip="" # Find the interface used for the default route host_ip_iface=${host_ip_iface:-$(ip -f $af route | awk '/default/ {print $5}' | head -1)} - local host_ips=$(LC_ALL=C ip -f $af addr show ${host_ip_iface} | awk /$af'/ {split($2,parts,"/"); print parts[1]}') + 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]}') local ip for ip in $host_ips; do # Attempt to filter out IP addresses that are part of the fixed and