From ce4c5ab489f027a086040d09796bb166c39a66e8 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Thu, 3 Jan 2019 12:46:56 +0100 Subject: [PATCH] Also sync Virtual IPs with a VHID group to backup host --- src/etc/rc.filter_synchronize | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/etc/rc.filter_synchronize b/src/etc/rc.filter_synchronize index 192c5e5d2..297518dea 100755 --- a/src/etc/rc.filter_synchronize +++ b/src/etc/rc.filter_synchronize @@ -52,13 +52,14 @@ function get_vip_config_section(): array $temp = []; $temp['vip'] = []; foreach($config['virtualip']['vip'] as $section) { - if ($section['mode'] != 'carp') { - continue; + if ($section['mode'] === 'carp' || + ($section['mode'] === 'ipalias' && isset($section['vhid']) && $section['vhid'] > 0) + ) { + if (!empty($section['advskew'])) { + $section['advskew'] = min(intval($section['advskew']) + 100, 254); + } + $temp['vip'][] = $section; } - if (!empty($section['advskew'])) { - $section['advskew'] = min(intval($section['advskew']) + 100, 254); - } - $temp['vip'][] = $section; } return $temp; } @@ -170,7 +171,7 @@ function carp_sync_xml($url, $username, $password, $sections, $method = 'opnsens foreach ($sections as $section) { switch ($section) { case 'virtualip': - // only carp type VIP's may be transfered to the backup host + // Sync only eligible VIPs to the backup host $transport_data[$section] = get_vip_config_section(); break; default: