Verify carp VHIDS no matter what and compare to current id if needed Resolves #189

This commit is contained in:
sullrich 2009-11-28 18:38:01 -05:00
parent 07a3b40b0b
commit 03fdfdd652

View File

@ -127,14 +127,12 @@ if ($_POST) {
* on one of our interfaces (wan, lan optX)
*/
if ($_POST['mode'] == "carp" or $_POST['mode'] == "carpdev-dhcp") {
if(!$id) {
/* verify against reusage of vhids */
$idtracker=0;
foreach($config['virtualip']['vip'] as $vip) {
if($vip['vhid'] == $_POST['vhid'] and $idtracker <> $id)
$input_errors[] = "VHID {$_POST['vhid']} is already in use. Pick a unique number.";
$idtracker++;
}
/* verify against reusage of vhids */
$idtracker = 0;
foreach($config['virtualip']['vip'] as $vip) {
if($vip['vhid'] == $_POST['vhid'] and $idtracker <> $id)
$input_errors[] = "VHID {$_POST['vhid']} is already in use. Pick a unique number.";
$idtracker++;
}
if($_POST['password'] == "")
$input_errors[] = "You must specify a CARP password that is shared between the two VHID members.";