diff options
author | Erik Fonnesbeck <efonnes@gmail.com> | 2010-11-10 22:03:07 -0700 |
---|---|---|
committer | Erik Fonnesbeck <efonnes@gmail.com> | 2010-11-10 22:43:08 -0700 |
commit | 88bc276013552268ebef7058cd7b58c89de67125 (patch) | |
tree | 5f496839e6dd01a9ece86526e869ac446568c114 /etc/inc/util.inc | |
parent | ea57ccb86b5c75246dabb8306c35b997cb4ede9d (diff) | |
download | pfsense-88bc276013552268ebef7058cd7b58c89de67125.zip pfsense-88bc276013552268ebef7058cd7b58c89de67125.tar.gz |
Fix filter_rules_sort's compare function to know about floating rules so it won't change their order.
Diffstat (limited to 'etc/inc/util.inc')
-rw-r--r-- | etc/inc/util.inc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc index 63b76da..2be567a 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -566,6 +566,22 @@ function get_configured_ip_aliases_list() { } +/* comparison function for sorting by the order in which interfaces are normally created */ +function compare_interface_friendly_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); +} + /* return the configured interfaces list. */ function get_configured_interface_list($only_opt = false, $withdisabled = false) { global $config; |