diff options
-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"); |