From ee968e4f29df3684e76be1d07ad6f67e48ffe6a4 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 24 Jul 2006 19:42:38 +0000 Subject: [PATCH] Compare against $pconfig and only check items if gateway is changing. --- usr/local/www/interfaces.php | 2 +- usr/local/www/interfaces_opt.php | 6 +++--- usr/local/www/interfaces_wan.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 3c706a470b..b80fa578d7 100755 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -92,7 +92,7 @@ if ($_POST) { unset($input_errors); $pconfig = $_POST; - if($_POST['gateway']) { + if($_POST['gateway'] and $pconfig['gateway'] <> $_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) { diff --git a/usr/local/www/interfaces_opt.php b/usr/local/www/interfaces_opt.php index ff5894bbeb..92a96df00a 100755 --- a/usr/local/www/interfaces_opt.php +++ b/usr/local/www/interfaces_opt.php @@ -83,9 +83,7 @@ if ($_POST) { /* filter out spaces from descriptions */ $POST['descr'] = remove_bad_chars($POST['descr']); - $pconfig = $_POST; - - if($_POST['gateway']) { + if($_POST['gateway'] and $pconfig['gateway'] <> $_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) { @@ -100,6 +98,8 @@ if ($_POST) { } } + $pconfig = $_POST; + /* input validation */ if ($_POST['enable']) { diff --git a/usr/local/www/interfaces_wan.php b/usr/local/www/interfaces_wan.php index 3c706a470b..b80fa578d7 100755 --- a/usr/local/www/interfaces_wan.php +++ b/usr/local/www/interfaces_wan.php @@ -92,7 +92,7 @@ if ($_POST) { unset($input_errors); $pconfig = $_POST; - if($_POST['gateway']) { + if($_POST['gateway'] and $pconfig['gateway'] <> $_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) {