From 2cfcc5f03ec63deff63716ff716f67b94315da14 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Sun, 28 Apr 2019 16:18:59 +0200 Subject: [PATCH] interfaces: now that get_real_interface() always returns... Prioritize '_vip' fake handling in getting an IP address. It might be better to look it up, but that is for later. --- src/etc/inc/interfaces.inc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index 8d182fb0d..72c6c2732 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -4010,15 +4010,15 @@ function ip_in_interface_alias_subnet($interface, $ipalias) function get_interface_ip($interface = 'wan') { + if (strstr($interface, '_vip')) { + return get_configured_carp_interface_list($interface); + } + $realif = get_real_interface($interface); if ($realif) { return find_interface_ip($realif); } - if (strstr($interface, '_vip')) { - return get_configured_carp_interface_list($interface); - } - return null; } @@ -4026,16 +4026,16 @@ function get_interface_ipv6($interface = 'wan') { global $config; + if (strstr($interface, '_vip')) { + return get_configured_carp_interface_list($interface, 'inet6'); + } + $realif = get_real_interface($interface, 'inet6'); if ($realif) { return isset($config['interfaces'][$interface]['dhcp6prefixonly']) ? find_interface_ipv6_ll($realif) : find_interface_ipv6($realif); } - if (strstr($interface, '_vip')) { - return get_configured_carp_interface_list($interface, 'inet6'); - } - return null; }