interfaces: keep get_failover_interface() for now, mixed plugins env possible

This commit is contained in:
Franco Fichtner 2019-04-10 08:11:40 +02:00
parent 241716e8a7
commit d6324fc822

View File

@ -4153,6 +4153,31 @@ function interfaces_staticarp_configure($if)
}
}
/* XXX this function is unused and to be removed on our way to 19.7 */
function get_failover_interface($interface, $family = 'all')
{
global $config;
/* shortcut for known interfaces */
if (isset($config['interfaces'][$interface])) {
return get_real_interface($interface, $family);
}
/* compare against gateway groups */
$a_groups = return_gateway_groups_array();
if (isset($a_groups[$interface])) {
/* we found a gateway group, fetch the interface or vip */
if ($a_groups[$interface][0]['vip'] != '') {
return $a_groups[$interface][0]['vip'];
} else {
return $a_groups[$interface][0]['int'];
}
}
/* fall through to get real interface the hard way */
return get_real_interface($interface, $family);
}
//returns interface information
function get_interfaces_info()
{