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