summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorBill Marquette <billm@pfsense.org>2006-08-11 03:13:31 +0000
committerBill Marquette <billm@pfsense.org>2006-08-11 03:13:31 +0000
commit547a126d2456122ed6e2d2df6cabe147a6058b8b (patch)
treed0274524696cceaa45d90e52ae37a7b09dcce4d0 /etc
parent8b124b2a2a28a23dddfc2314022c02e3daf34ae6 (diff)
downloadpfsense-547a126d2456122ed6e2d2df6cabe147a6058b8b.zip
pfsense-547a126d2456122ed6e2d2df6cabe147a6058b8b.tar.gz
partial MFC of 13717
eek out another 10 seconds on my 4801 for rc.filter_configure
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/interfaces.inc9
-rw-r--r--etc/inc/pfsense-utils.inc6
2 files changed, 12 insertions, 3 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index acaa897..ae084dc 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -159,6 +159,8 @@ function interfaces_lan_configure() {
mwexec("/sbin/ifconfig bridge{$bridges_total} up");
$bridges_total++;
+ /* update cache */
+ find_number_of_created_bridges();
}
/* media */
@@ -319,7 +321,8 @@ function interfaces_optional_configure_if($opti) {
mwexec("/sbin/ifconfig bridge{$bridges_total} up");
$bridges_total++;
-
+ /* update cache */
+ find_number_of_created_bridges();
} else {
/* if user has selected DHCP type then act accordingly */
if($optcfg['ipaddr'] == "dhcp") {
@@ -876,6 +879,8 @@ function interfaces_wan_configure() {
mwexec("/sbin/ifconfig bridge{$bridges_total} up");
$bridges_total++;
+ /* update cache */
+ find_number_of_created_bridges();
}
if (!$g['booting']) {
@@ -1564,4 +1569,4 @@ function get_wireless_modes($interface)
return($wireless_modes);
}
-?> \ No newline at end of file
+?>
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 01b61d6..98981f8 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -705,7 +705,11 @@ function setup_filter_bridge() {
* find_number_of_created_bridges(): returns the number of currently created bridges
*/
function find_number_of_created_bridges() {
- return `/sbin/ifconfig | grep "bridge[0-999]" | wc -l`;
+ global $bridge_interface_count_cache;
+ if(!isset($bridge_interface_count_cache))
+ $bridge_interface_count_cache = exec_command('/sbin/ifconfig | /usr/bin/grep "bridge[0-999]" | /usr/bin/wc -l');
+
+ return $bridge_interface_count_cache;
}
/*
OpenPOWER on IntegriCloud