diff options
author | Erik Fonnesbeck <efonnes@gmail.com> | 2010-05-08 22:39:49 -0600 |
---|---|---|
committer | Erik Fonnesbeck <efonnes@gmail.com> | 2010-05-08 22:41:34 -0600 |
commit | cec4323f9731ce8ecea87c5c70652a7b28e75c7a (patch) | |
tree | bdf5b7a509fe174663ce229de6113ff619f8b6df /usr | |
parent | c013d3f5fa9752a413844ee7901054afbaf115b6 (diff) | |
download | pfsense-cec4323f9731ce8ecea87c5c70652a7b28e75c7a.zip pfsense-cec4323f9731ce8ecea87c5c70652a7b28e75c7a.tar.gz |
Make interface sort order on creation consistent with the order displayed elsewhere, and fix possible missing description on LAN upon creation.
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/interfaces_assign.php | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/usr/local/www/interfaces_assign.php b/usr/local/www/interfaces_assign.php index 74be363..ecd47ad 100755 --- a/usr/local/www/interfaces_assign.php +++ b/usr/local/www/interfaces_assign.php @@ -301,6 +301,7 @@ if ($_GET['act'] == "add") { /* find next free optional interface number */ if(!$config['interfaces']['lan']) { $newifname = "lan"; + $descr = "LAN"; $config['interfaces'][$newifname] = array(); $config['interfaces'][$newifname]['descr'] = $descr; } else { @@ -312,9 +313,10 @@ if ($_GET['act'] == "add") { $descr = "OPT{$i}"; $config['interfaces'][$newifname] = array(); $config['interfaces'][$newifname]['descr'] = $descr; - uksort($config['interfaces'], "strnatcmp"); } - + + uksort($config['interfaces'], "compare_interface_names"); + /* Find an unused port for this interface */ foreach ($portlist as $portname => $portinfo) { $portused = false; @@ -343,6 +345,21 @@ if ($_GET['act'] == "add") { } +function compare_interface_names($a, $b) { + if ($a == $b) + return 0; + else if ($a == 'wan') + return -1; + else if ($b == 'wan') + return 1; + else if ($a == 'lan') + return -1; + else if ($b == 'lan') + return 1; + + return strnatcmp($a, $b); +} + include("head.inc"); if(file_exists("/var/run/interface_mismatch_reboot_needed")) |