diff options
author | Ermal Luçi <eri@pfsense.org> | 2008-09-02 15:47:23 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2008-09-02 15:47:23 +0000 |
commit | 81f82bf7c6382ec1daa05f08928afb4b6c47a6b6 (patch) | |
tree | 5094c15abc81720b5eb96bb19ec3458ae70494da /usr/local | |
parent | 47fa7acf711ef0ce79df24ffca8619c18d637fbd (diff) | |
download | pfsense-81f82bf7c6382ec1daa05f08928afb4b6c47a6b6.zip pfsense-81f82bf7c6382ec1daa05f08928afb4b6c47a6b6.tar.gz |
Fix problem reported on http://forum.pfsense.org/index.php/topic,10984.0.html.
Actually this is a dumb php susbstr() function behaviour since the code logic was fine.
Either way this fixes the problem of not allowing more the 12 total interfaces present.
Diffstat (limited to 'usr/local')
-rwxr-xr-x | usr/local/www/interfaces_assign.php | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/usr/local/www/interfaces_assign.php b/usr/local/www/interfaces_assign.php index df9c70f..12bd653 100755 --- a/usr/local/www/interfaces_assign.php +++ b/usr/local/www/interfaces_assign.php @@ -241,16 +241,15 @@ if ($_GET['act'] == "add") { $config['interfaces'][$newifname] = array(); $config['interfaces'][$newifname]['descr'] = $descr; } else { - $i = 1; - foreach ($config['interfaces'] as $ifname => $if) { - if ($ifname == "wan" || $ifname == "lan") - continue; - if (substr($ifname, 3) == $i) { - $i++; - continue; - } - break; - } + /* + * 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; $newifname = 'opt' . $i; $descr = "OPT{$i}"; $config['interfaces'][$newifname] = array(); |