If a gateway is being used by the load balancer pool, do not allow operator to reassign the gateway ip to an interface. This creates a route loop and is bad.

This commit is contained in:
Scott Ullrich 2006-07-24 19:11:24 +00:00
parent 63190d361b
commit 6fc5bf35d7
3 changed files with 45 additions and 0 deletions

View File

@ -92,6 +92,21 @@ if ($_POST) {
unset($input_errors);
$pconfig = $_POST;
if($_POST['gateway']) {
/* enumerate slbd gateways and make sure we are not creating a route loop */
if(is_array($config['load_balancer']['lbpool'])) {
foreach($config['load_balancer']['lbpool'] as $lbpool) {
if($lbpool['type'] == "gateway") {
foreach ((array) $lbpool['servers'] as $server) {
$svr = split("\|", $server);
if($svr[1] == $_POST['gateway'])
$intput_errors[] = "Cannot change {$svr[1]} gateway. It is currently referenced by the load balancer pools.";
}
}
}
}
}
/* input validation */
if ($_POST['type'] == "Static") {
$reqdfields = explode(" ", "ipaddr subnet gateway");

View File

@ -85,6 +85,21 @@ if ($_POST) {
$pconfig = $_POST;
if($_POST['gateway']) {
/* enumerate slbd gateways and make sure we are not creating a route loop */
if(is_array($config['load_balancer']['lbpool'])) {
foreach($config['load_balancer']['lbpool'] as $lbpool) {
if($lbpool['type'] == "gateway") {
foreach ((array) $lbpool['servers'] as $server) {
$svr = split("\|", $server);
if($svr[1] == $_POST['gateway'])
$intput_errors[] = "Cannot change {$svr[1]} gateway. It is currently referenced by the load balancer pools.";
}
}
}
}
}
/* input validation */
if ($_POST['enable']) {

View File

@ -92,6 +92,21 @@ if ($_POST) {
unset($input_errors);
$pconfig = $_POST;
if($_POST['gateway']) {
/* enumerate slbd gateways and make sure we are not creating a route loop */
if(is_array($config['load_balancer']['lbpool'])) {
foreach($config['load_balancer']['lbpool'] as $lbpool) {
if($lbpool['type'] == "gateway") {
foreach ((array) $lbpool['servers'] as $server) {
$svr = split("\|", $server);
if($svr[1] == $_POST['gateway'])
$intput_errors[] = "Cannot change {$svr[1]} gateway. It is currently referenced by the load balancer pools.";
}
}
}
}
}
/* input validation */
if ($_POST['type'] == "Static") {
$reqdfields = explode(" ", "ipaddr subnet gateway");