summaryrefslogtreecommitdiffstats
path: root/usr/local/www/interfaces_opt.php
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-07-24 19:11:24 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-07-24 19:11:24 +0000
commit6fc5bf35d72b45f04de683fc59b11394da8ab7db (patch)
treed4a2b77c2d1f20b9853ae15aeabee528f0c1563f /usr/local/www/interfaces_opt.php
parent63190d361b2c9d563c41f96f79461c05c232b50f (diff)
downloadpfsense-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/local/www/interfaces_opt.php')
-rwxr-xr-xusr/local/www/interfaces_opt.php15
1 files changed, 15 insertions, 0 deletions
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']) {
OpenPOWER on IntegriCloud