summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Fonnesbeck <efonnes@gmail.com>2010-08-01 18:38:59 -0600
committerErik Fonnesbeck <efonnes@gmail.com>2010-08-01 21:53:06 -0600
commit57c52d45073cfb4de8ef2946f52d9cbc4e073b38 (patch)
tree99ea5f5c043356561e3b8091f57df4fe9bed3285
parentb12cc5994979c9d6a5b4e5f70ba6faf883917187 (diff)
downloadpfsense-57c52d45073cfb4de8ef2946f52d9cbc4e073b38.zip
pfsense-57c52d45073cfb4de8ef2946f52d9cbc4e073b38.tar.gz
Small optimization for convert_friendly_interface_to_friendly_descr. Do not build an interface list for the most common cases.
-rw-r--r--etc/inc/interfaces.inc7
1 files changed, 7 insertions, 0 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 90c927f..3d415a3 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -2583,6 +2583,13 @@ function convert_friendly_interface_to_friendly_descr($interface) {
$ifdesc = "IPsec";
break;
default:
+ if (isset($config['interfaces'][$interface])) {
+ if (empty($config['interfaces'][$interface]['descr']))
+ $ifdesc = strtoupper($interface);
+ else
+ $ifdesc = strtoupper($config['interfaces'][$interface]['descr']);
+ break;
+ }
/* if list */
$ifdescrs = get_configured_interface_with_descr(false, true);
foreach ($ifdescrs as $if => $ifname) {
OpenPOWER on IntegriCloud