diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-07-24 19:11:24 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-07-24 19:11:24 +0000 |
commit | 6fc5bf35d72b45f04de683fc59b11394da8ab7db (patch) | |
tree | d4a2b77c2d1f20b9853ae15aeabee528f0c1563f /usr | |
parent | 63190d361b2c9d563c41f96f79461c05c232b50f (diff) | |
download | pfsense-6fc5bf35d72b45f04de683fc59b11394da8ab7db.zip pfsense-6fc5bf35d72b45f04de683fc59b11394da8ab7db.tar.gz |
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.
Ticket #1039
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/interfaces.php | 15 | ||||
-rwxr-xr-x | usr/local/www/interfaces_opt.php | 15 | ||||
-rwxr-xr-x | usr/local/www/interfaces_wan.php | 15 |
3 files changed, 45 insertions, 0 deletions
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 2504c2a..f39e63b 100755 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -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"); diff --git a/usr/local/www/interfaces_opt.php b/usr/local/www/interfaces_opt.php index 626ccd0..1233085 100755 --- a/usr/local/www/interfaces_opt.php +++ b/usr/local/www/interfaces_opt.php @@ -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']) { diff --git a/usr/local/www/interfaces_wan.php b/usr/local/www/interfaces_wan.php index 2504c2a..f39e63b 100755 --- a/usr/local/www/interfaces_wan.php +++ b/usr/local/www/interfaces_wan.php @@ -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"); |