From 00a6fcb7fbaaeb070a6279874a85b74015efa2b4 Mon Sep 17 00:00:00 2001 From: Ermal Date: Thu, 20 Mar 2014 18:54:51 +0000 Subject: [PATCH] Configure first the vhid and than pass the vhid when configuring the carp this makes the ip assigned to carp as well --- etc/inc/interfaces.inc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 90dcf10339..311276775a 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -2174,13 +2174,13 @@ function interface_carp_configure(&$vip) { if (!empty($vip['advbase'])) $advbase = "advbase " . escapeshellarg($vip['advbase']); - if (is_ipaddrv4($vip['subnet'])) - mwexec("/sbin/ifconfig {$realif} " . escapeshellarg($vip['subnet']) . "/" . escapeshellarg($vip['subnet_bits']) . " alias"); - else if (is_ipaddrv6($vip['subnet'])) - mwexec("/sbin/ifconfig {$realif} inet6 " . escapeshellarg($vip['subnet']) . " prefixlen " . escapeshellarg($vip['subnet_bits'])); - mwexec("/sbin/ifconfig {$realif} vhid " . escapeshellarg($vip['vhid']) . " advskew " . escapeshellarg($vip['advskew']) . " {$advbase} {$password}"); + if (is_ipaddrv4($vip['subnet'])) + mwexec("/sbin/ifconfig {$realif} " . escapeshellarg($vip['subnet']) . "/" . escapeshellarg($vip['subnet_bits']) . " alias vhid " . escapeshellarg($vip['vhid'])); + else if (is_ipaddrv6($vip['subnet'])) + mwexec("/sbin/ifconfig {$realif} inet6 " . escapeshellarg($vip['subnet']) . " prefixlen " . escapeshellarg($vip['subnet_bits']) . " vhid " . escapeshellarg($vip['vhid'])); + return $realif; }