mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
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:
parent
63190d361b
commit
6fc5bf35d7
@ -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");
|
||||
|
||||
@ -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']) {
|
||||
|
||||
|
||||
@ -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");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user