Commit f9dff13d authored by Ad Schellevis's avatar Ad Schellevis

(legacy) from crash reports, Warning: Illegal string offset 'vip' in...

(legacy) from crash reports, Warning: Illegal string offset 'vip' in /usr/local/etc/inc/xmlrpc/legacy.inc on line 304
parent 61e6bb5d
...@@ -301,39 +301,41 @@ function restore_config_section_xmlrpc($new_config) ...@@ -301,39 +301,41 @@ function restore_config_section_xmlrpc($new_config)
if (isset($new_config['virtualip']['vip'])) { if (isset($new_config['virtualip']['vip'])) {
$carp_setuped = false; $carp_setuped = false;
$anyproxyarp = false; $anyproxyarp = false;
foreach ($config['virtualip']['vip'] as $vip) { if (isset($config['virtualip']['vip'])) {
if ($vip['mode'] == "carp" && isset($oldvips["{$vip['interface']}_vip{$vip['vhid']}"])) { foreach ($config['virtualip']['vip'] as $vip) {
if ($oldvips["{$vip['interface']}_vip{$vip['vhid']}"] == "{$vip['password']}{$vip['advskew']}{$vip['subnet']}{$vip['subnet_bits']}{$vip['advbase']}") { if ($vip['mode'] == "carp" && isset($oldvips["{$vip['interface']}_vip{$vip['vhid']}"])) {
if (does_vip_exist($vip)) { if ($oldvips["{$vip['interface']}_vip{$vip['vhid']}"] == "{$vip['password']}{$vip['advskew']}{$vip['subnet']}{$vip['subnet_bits']}{$vip['advbase']}") {
unset($oldvips["{$vip['interface']}_vip{$vip['vhid']}"]); if (does_vip_exist($vip)) {
continue; // Skip reconfiguring this vips since nothing has changed. unset($oldvips["{$vip['interface']}_vip{$vip['vhid']}"]);
} continue; // Skip reconfiguring this vips since nothing has changed.
} }
unset($oldvips["{$vip['interface']}_vip{$vip['vhid']}"]); }
} else if ($vip['mode'] == "ipalias" && strstr($vip['interface'], "_vip") && isset($oldvips[$vip['subnet']])) { unset($oldvips["{$vip['interface']}_vip{$vip['vhid']}"]);
if ($oldvips[$vip['subnet']] == "{$vip['interface']}{$vip['subnet']}{$vip['subnet_bits']}") { } else if ($vip['mode'] == "ipalias" && strstr($vip['interface'], "_vip") && isset($oldvips[$vip['subnet']])) {
if (does_vip_exist($vip)) { if ($oldvips[$vip['subnet']] == "{$vip['interface']}{$vip['subnet']}{$vip['subnet_bits']}") {
unset($oldvips[$vip['subnet']]); if (does_vip_exist($vip)) {
continue; // Skip reconfiguring this vips since nothing has changed. unset($oldvips[$vip['subnet']]);
} continue; // Skip reconfiguring this vips since nothing has changed.
} }
unset($oldvips[$vip['subnet']]); }
} unset($oldvips[$vip['subnet']]);
}
switch ($vip['mode']) {
case "proxyarp": switch ($vip['mode']) {
$anyproxyarp = true; case "proxyarp":
break; $anyproxyarp = true;
case "ipalias": break;
interface_ipalias_configure($vip); case "ipalias":
break; interface_ipalias_configure($vip);
case "carp": break;
if (!$carp_setuped) { case "carp":
$carp_setuped = true; if (!$carp_setuped) {
} $carp_setuped = true;
interface_carp_configure($vip); }
break; interface_carp_configure($vip);
} break;
}
}
} }
if ($carp_setuped) { if ($carp_setuped) {
interfaces_carp_setup(); interfaces_carp_setup();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment