Configure first the vhid and than pass the vhid when configuring the carp this makes the ip assigned to carp as well

This commit is contained in:
Ermal 2014-03-20 18:54:51 +00:00
parent a63e5eadef
commit 00a6fcb7fb

View File

@ -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;
}