diff options
Diffstat (limited to 'usr/local/www/services_proxyarp_edit.php')
-rwxr-xr-x | usr/local/www/services_proxyarp_edit.php | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/usr/local/www/services_proxyarp_edit.php b/usr/local/www/services_proxyarp_edit.php index 0e93924..c84fdbc 100755 --- a/usr/local/www/services_proxyarp_edit.php +++ b/usr/local/www/services_proxyarp_edit.php @@ -36,27 +36,27 @@ ##|*MATCH=services_proxyarp_edit.php* ##|-PRIV -function proxyarp_sort() { - global $g, $config; +function proxyarpcmp($a, $b) { + if (isset($a['network'])) + list($ast,$asn) = explode("/", $a['network']); + else if (isset($a['range'])) { + $ast = $a['range']['from']; + $asn = 32; + } + if (isset($b['network'])) + list($bst,$bsn) = explode("/", $b['network']); + else if (isset($b['range'])) { + $bst = $b['range']['from']; + $bsn = 32; + } + if (ipcmp($ast, $bst) == 0) + return ($asn - $bsn); + else + return ipcmp($ast, $bst); +} - function proxyarpcmp($a, $b) { - if (isset($a['network'])) - list($ast,$asn) = explode("/", $a['network']); - else if (isset($a['range'])) { - $ast = $a['range']['from']; - $asn = 32; - } - if (isset($b['network'])) - list($bst,$bsn) = explode("/", $b['network']); - else if (isset($b['range'])) { - $bst = $b['range']['from']; - $bsn = 32; - } - if (ipcmp($ast, $bst) == 0) - return ($asn - $bsn); - else - return ipcmp($ast, $bst); - } +function proxyarp_sort() { + global $config; usort($config['proxyarp']['proxyarpnet'], "proxyarpcmp"); } |