summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2008-08-31 13:47:21 +0000
committerErmal Luçi <eri@pfsense.org>2008-08-31 13:47:21 +0000
commit63182e6083d1a920248120a3b9fbd7eeafc39460 (patch)
treeee6cdd3ea6b44b2334854791c732975a47cd1c88 /etc/inc
parent6a418ab72b5b9a5ff95ef7410afa1afb75a653b3 (diff)
downloadpfsense-63182e6083d1a920248120a3b9fbd7eeafc39460.zip
pfsense-63182e6083d1a920248120a3b9fbd7eeafc39460.tar.gz
Bring bridge related support functions up to date with the other bridge code.
NOTE: that the function link_int_to_bridge_interface needs a friendly interface as a parameter now i.e. "wan/lan/optX".
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/config.inc7
-rw-r--r--etc/inc/pfsense-utils.inc28
2 files changed, 8 insertions, 27 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc
index 7878207..c789f87 100644
--- a/etc/inc/config.inc
+++ b/etc/inc/config.inc
@@ -2614,11 +2614,8 @@ function system_start_ftp_helpers() {
}
}
/* support bridged interfaces. even they need ftp mojo */
- $num_bridges = find_number_of_created_bridges();
- $num_bridges++;
- for($x=0; $x<$num_bridges; $x++) {
- mwexec("/usr/local/sbin/ftpsesame {$shaper_queue} -i bridge{$x}");
- }
+ foreach($config['bridges']['bridged'] as $bridge)
+ mwexec("/usr/local/sbin/ftpsesame {$shaper_queue} -i {$bridge['bridgeif']}");
}
function cleanup_backupcache($revisions = 30) {
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 0f4c9f5..0f5308a 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -1233,16 +1233,11 @@ function find_number_of_created_carp_interfaces($flush = false) {
* bridge[0-99]
******/
function link_int_to_bridge_interface($int) {
- global $config, $g;
- $real_int = convert_friendly_interface_to_real_interface_name($int);
- $num_bridges = find_number_of_created_bridges();
- for($x=0; $x<$num_bridges; $x++) {
- $matches = "";
- $bridge_info = `/sbin/ifconfig bridge{$x}`;
- if(stristr($bridge_info, "member: {$real_int}")) {
- return "bridge{$x}";
- }
- }
+ global $config;
+
+ foreach ($config['bridges']['bridged'] as $bridge)
+ if(stristr($bridge['members'], "{$int}"))
+ return "{$bridge['bridgeif']}";
}
function link_carp_interface_to_parent($interface) {
@@ -1522,17 +1517,6 @@ function find_carp_interface($ip) {
}
/*
- * find_number_of_created_bridges(): returns the number of currently created bridges
- */
-function find_number_of_created_bridges($flush = false) {
- global $bridge_interface_count_cache;
- if(!isset($bridge_interface_count_cache) or $flush)
- $bridge_interface_count_cache = exec_command('/sbin/ifconfig | /usr/bin/grep "bridge[0-999]" | /usr/bin/wc -l');
-
- return $bridge_interface_count_cache;
-}
-
-/*
* add_rule_to_anchor($anchor, $rule): adds the specified rule to an anchor
*/
function add_rule_to_anchor($anchor, $rule, $label) {
@@ -3664,7 +3648,7 @@ function get_interface_info($ifdescr) {
}
$bridge = "";
- $bridge = link_int_to_bridge_interface($ifinfo['if']);
+ $bridge = link_int_to_bridge_interface($ifdescr);
if($bridge) {
$bridge_text = `/sbin/ifconfig {$bridge}`;
if(stristr($bridge_text, "blocking") <> false) {
OpenPOWER on IntegriCloud