diff --git a/src/etc/inc/xmlrpc/legacy.inc b/src/etc/inc/xmlrpc/legacy.inc index bab616d01..4da647fc4 100644 --- a/src/etc/inc/xmlrpc/legacy.inc +++ b/src/etc/inc/xmlrpc/legacy.inc @@ -169,8 +169,8 @@ function restore_config_section_xmlrpc($new_config) $oldvips = array(); if (isset($new_config['virtualip']['vip']) && isset($config['virtualip']['vip'])) { foreach ($config['virtualip']['vip'] as $vipindex => $vip) { - if ($vip['mode'] == "carp") { - // rc.filter_synchronize only sends carp vips, keep the rest like it was + if (vip_is_eligible_for_sync($vip)) { + // rc.filter_synchronize only sends CARP VIPs and IP Aliases with a VHID. Keep the rest like it was. $oldvips["{$vip['interface']}_vip{$vip['vhid']}"] = $vip ; } else { $vipbackup[] = $vip; @@ -200,7 +200,7 @@ function restore_config_section_xmlrpc($new_config) $anyproxyarp = false; if (isset($config['virtualip']['vip'])) { foreach ($config['virtualip']['vip'] as $vip) { - if ($vip['mode'] == "carp" && isset($oldvips["{$vip['interface']}_vip{$vip['vhid']}"])) { + if (vip_is_eligible_for_sync($vip) && isset($oldvips["{$vip['interface']}_vip{$vip['vhid']}"])) { $is_changed = false; foreach (array('password', 'advskew', 'subnet', 'subnet_bits', 'advbase') as $chk_key) { if ($oldvips["{$vip['interface']}_vip{$vip['vhid']}"][$chk_key] != $vip[$chk_key]) { @@ -254,3 +254,9 @@ function restore_config_section_xmlrpc($new_config) return true; } + +function vip_is_eligible_for_sync(array $vip) +{ + return $vip['mode'] === 'carp' || + ($vip['mode'] === 'ipalias' && isset($vip['vhid']) && $vip['vhid'] > 0); +} \ No newline at end of file