summaryrefslogtreecommitdiffstats
path: root/usr/local/www/interfaces_assign.php
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2008-09-03 16:19:27 +0000
committerErmal Luçi <eri@pfsense.org>2008-09-03 16:19:27 +0000
commit8a64810061b5464a8676c06d37ea0f3f4ef962bf (patch)
tree2df1d0784e7a41311f5573c0f7b07c37e3c49786 /usr/local/www/interfaces_assign.php
parent9710f0fa06f8f4dcde5b1be71ed4b1e04f0a7785 (diff)
downloadpfsense-8a64810061b5464a8676c06d37ea0f3f4ef962bf.zip
pfsense-8a64810061b5464a8676c06d37ea0f3f4ef962bf.tar.gz
Actually fix problem with assigning number of interfaces greater than 10 or 20.
Diffstat (limited to 'usr/local/www/interfaces_assign.php')
-rwxr-xr-xusr/local/www/interfaces_assign.php13
1 files changed, 4 insertions, 9 deletions
diff --git a/usr/local/www/interfaces_assign.php b/usr/local/www/interfaces_assign.php
index 12bd653..aef0c03 100755
--- a/usr/local/www/interfaces_assign.php
+++ b/usr/local/www/interfaces_assign.php
@@ -241,15 +241,10 @@ if ($_GET['act'] == "add") {
$config['interfaces'][$newifname] = array();
$config['interfaces'][$newifname]['descr'] = $descr;
} else {
- /*
- * Since we account above for LAN and we start counting
- * optional(opt#) interfaces from 1 the formula below
- * gives the next, to be added, opt# interface.
- *
- * XXX: The best of all i getting rid of lan and wan
- * from interface keys and just keeping their descriptions.
- */
- $i = count($config['interfaces']) - 1;
+ for ($i = 1; $i <= count($config['interfaces']); $i++) {
+ if (!$config['interfaces']["opt{$i}"])
+ break;
+ }
$newifname = 'opt' . $i;
$descr = "OPT{$i}";
$config['interfaces'][$newifname] = array();
OpenPOWER on IntegriCloud