From 3185f659cd3ec7157595b3b701a371b21292e706 Mon Sep 17 00:00:00 2001 From: Luiz Otavio O Souza Date: Tue, 16 Feb 2016 11:31:20 -0600 Subject: Fix link_interface_to_vips() to account for IP alias over CARP. --- src/etc/inc/interfaces.inc | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src/etc/inc/interfaces.inc') diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index 53fa9ba..38db490 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -5038,18 +5038,24 @@ function link_interface_to_vips($int, $action = "", $vhid = '') { if (is_array($config['virtualip']['vip'])) { $result = array(); foreach ($config['virtualip']['vip'] as $vip) { - if ($int == $vip['interface']) { - if ($action == "update") { - interfaces_vips_configure($int); - } else { - if (empty($vhid) || ($vhid == $vip['vhid'])) { - $result[] = $vip; - } + if (substr($vip['interface'], 0, 4) == "_vip") + $iface = get_configured_vip_interface($vip['interface']); + else + $iface = $vip['interface']; + if ($int != $iface) + continue; + if ($action == "update") { + interfaces_vips_configure($int); + } else { + if (empty($vhid) || ($vhid == $vip['vhid'])) { + $result[] = $vip; } } } return $result; } + + return NULL; } /****f* interfaces/link_interface_to_bridge -- cgit v1.1