diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index 1d14086ba..e0fdf10d6 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -4362,11 +4362,12 @@ function interfaces_primary_address($interface, $ifconfig_details = null) return [ $ifcfgip, $network, $subnetbits ]; } -function interfaces_primary_address6($interface, $ifconfig_details = null) +/* XXX rename "primary" to "routed" as that is what it is */ +function interfaces_primary_address6($interface, $ifconfig_details = null, $allow_track = true) { $ifcfgipv6 = $networkv6 = $subnetbitsv6 = null; - if (interfaces_has_prefix_only($interface)) { + if (interfaces_has_prefix_only($interface) && $allow_track) { /* extend the search scope for a non-NA mode to tracking interfaces */ $interface = array_merge([$interface], array_keys(link_interface_to_track6($interface))); } @@ -4403,6 +4404,7 @@ function interfaces_scoped_address6($interface, $ifconfig_details = null) return [ $ifcfgipv6, $networkv6, $subnetbitsv6 ]; } +/* XXX rename "prefix" to "primary" as that is what it is */ function interfaces_prefix_address6($interface, $ifconfig_details = null) { $ifcfgipv6 = $networkv6 = $subnetbitsv6 = null; @@ -4411,5 +4413,5 @@ function interfaces_prefix_address6($interface, $ifconfig_details = null) return interfaces_scoped_address6($interface, $ifconfig_details); } - return interfaces_primary_address6($interface, $ifconfig_details); + return interfaces_primary_address6($interface, $ifconfig_details, false); } diff --git a/src/etc/rc.newwanip b/src/etc/rc.newwanip index 5483b533c..992e0da65 100755 --- a/src/etc/rc.newwanip +++ b/src/etc/rc.newwanip @@ -62,7 +62,7 @@ if (!isset($config['interfaces'][$interface]['enable'])) { system_resolver_configure(); $interface_descr = convert_friendly_interface_to_friendly_descr($interface); -$ip = get_interface_ip($interface); +list ($ip) = interfaces_primary_address($interface); if (!is_ipaddr($ip)) { /* diff --git a/src/etc/rc.newwanipv6 b/src/etc/rc.newwanipv6 index 32fe6edec..7e48e534d 100755 --- a/src/etc/rc.newwanipv6 +++ b/src/etc/rc.newwanipv6 @@ -62,7 +62,7 @@ if (!isset($config['interfaces'][$interface]['enable'])) { system_resolver_configure(); $interface_descr = convert_friendly_interface_to_friendly_descr($interface); -$ip = get_interface_ipv6($interface); +list ($ip) = interfaces_prefix_address6($interface); if (!is_ipaddr($ip)) { /* interface is not ready */