summaryrefslogtreecommitdiffstats
path: root/usr/local/www
diff options
context:
space:
mode:
Diffstat (limited to 'usr/local/www')
-rwxr-xr-xusr/local/www/guiconfig.inc19
-rwxr-xr-xusr/local/www/interfaces_assign.php17
2 files changed, 12 insertions, 24 deletions
diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc
index 4c68a32..d1a92c7 100755
--- a/usr/local/www/guiconfig.inc
+++ b/usr/local/www/guiconfig.inc
@@ -464,19 +464,22 @@ function filter_rules_sort() {
for ($i = 0; isset($config['filter']['rule'][$i]); $i++)
$config['filter']['rule'][$i]['seq'] = $i;
- function filtercmp($a, $b) {
- if ($a['interface'] == $b['interface'])
- return $a['seq'] - $b['seq'];
- else
- return -strcmp($a['interface'], $b['interface']);
- }
-
- usort($config['filter']['rule'], "filtercmp");
+ usort($config['filter']['rule'], "filter_rules_compare");
/* strip the sequence numbers again */
for ($i = 0; isset($config['filter']['rule'][$i]); $i++)
unset($config['filter']['rule'][$i]['seq']);
}
+function filter_rules_compare($a, $b) {
+ if ($a['interface'] == $b['interface'] || ( isset($a['floating']) && isset($b['floating']) ))
+ return $a['seq'] - $b['seq'];
+ else if (isset($a['floating']))
+ return -1;
+ else if (isset($b['floating']))
+ return 1;
+ else
+ return compare_interface_friendly_names($a['interface'], $b['interface']);
+}
function firewall_check_for_advanced_options(&$item) {
$item_set = "";
diff --git a/usr/local/www/interfaces_assign.php b/usr/local/www/interfaces_assign.php
index b4c8525..fbd6e7f 100755
--- a/usr/local/www/interfaces_assign.php
+++ b/usr/local/www/interfaces_assign.php
@@ -320,7 +320,7 @@ if ($_GET['act'] == "add") {
$config['interfaces'][$newifname]['descr'] = $descr;
}
- uksort($config['interfaces'], "compare_interface_names");
+ uksort($config['interfaces'], "compare_interface_friendly_names");
/* Find an unused port for this interface */
foreach ($portlist as $portname => $portinfo) {
@@ -350,21 +350,6 @@ 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"))
OpenPOWER on IntegriCloud