Skip to content

Commit

Permalink
Only call interfaces_vips_configure once if it's needed, rather than …
Browse files Browse the repository at this point in the history
…doing the same thing over and over for every VIP on an interface. Ticket #6515
  • Loading branch information
Chris Buechler committed Jun 22, 2016
1 parent 6812622 commit d75c55f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/etc/inc/interfaces.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5062,6 +5062,7 @@ function link_interface_to_vlans($int, $action = "") {
function link_interface_to_vips($int, $action = "", $vhid = '') {
global $config;

$updatevips = false;
if (is_array($config['virtualip']['vip'])) {
$result = array();
foreach ($config['virtualip']['vip'] as $vip) {
Expand All @@ -5074,14 +5075,17 @@ function link_interface_to_vips($int, $action = "", $vhid = '') {
continue;
}
if ($action == "update") {
interfaces_vips_configure($int);
$updatevips = true;
} else {
if (empty($vhid) || ($vhid == $vip['vhid']) ||
substr($vip['interface'], 0, 4) == "_vip") {
$result[] = $vip;
}
}
}
if ($updatevips === true) {
interfaces_vips_configure($int);
}
return $result;
}

Expand Down

0 comments on commit d75c55f

Please sign in to comment.