summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-10-12 23:45:41 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-10-12 23:45:41 +0000
commitce33da32e8f9ddbed2ab9c639034ba70805b5058 (patch)
treec798e54ad39d74e43243e909c255ea175d8c235c /etc/inc
parentaf1b4b28ebfd6d1f9474fdab2f4c68df10b8fb98 (diff)
downloadpfsense-ce33da32e8f9ddbed2ab9c639034ba70805b5058.zip
pfsense-ce33da32e8f9ddbed2ab9c639034ba70805b5058.tar.gz
Make get_number_of_bridged_interfaces() a little more industrial strength by actually looking at the bridge numbers instead of the quantity of bridges
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/interfaces.inc9
1 files changed, 7 insertions, 2 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index a89d1a3..85c8b33 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -1282,8 +1282,13 @@ function is_altq_capable($int) {
}
function get_number_of_bridged_interfaces() {
- $bridges = trim(`/sbin/ifconfig -a | /usr/bin/grep bridge | /usr/bin/wc -l`);
- return "{$bridges}";
+ $bridges_total = 0;
+ $bridges = split("\n", `/sbin/ifconfig -a | /usr/bin/grep bridge | grep flags`);
+ foreach($bridges as $bridge) {
+ preg_match_all("/bridge(.*):/",$bridge,$match_array);
+ $bridges_total = $match_array[1][0];
+ }
+ return "{$bridges_total}";
}
function get_next_available_bridge_interface() {
OpenPOWER on IntegriCloud