diff options
author | Ermal Luçi <eri@pfsense.org> | 2009-03-17 00:01:53 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2009-03-17 00:01:53 +0000 |
commit | 42753d259b3c7b51003cbd161e5ef15fa8a01d5c (patch) | |
tree | 73a9ff85299d7c1b8103ff3da6bc119a57d7f0ca /etc | |
parent | 0ec2fdf0ad985ff390c6230f375e88cde5a4d61b (diff) | |
download | pfsense-42753d259b3c7b51003cbd161e5ef15fa8a01d5c.zip pfsense-42753d259b3c7b51003cbd161e5ef15fa8a01d5c.tar.gz |
Actually merge the part that does the real work with FreeBSD groups.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/interfaces.inc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 7cb1524..f5826a5 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -560,6 +560,9 @@ function interfaces_configure() { /* bring ip IP aliases */ interfaces_ipalias_configure(); + /* configure interface groups */ + interfaces_group_setup(); + if (!$g['booting']) { /* reconfigure static routes (kernel may have deleted them) */ system_routing_configure(); @@ -1758,6 +1761,33 @@ EOD; return 0; } + +function interfaces_group_setup() { + global $config; + + if (!is_array($config['ifgroups']['ifgroupentry'])) + return; + + foreach ($config['ifgroups']['ifgroupentry'] as $grouppar) + interface_group_setup($groupar); + + return; +} + +function interface_group_setup($groupname /* The parameter is an array */) { + global $config; + + if (!is_array($groupname)) + return; + $members = explode(" ", $groupname['members']); + foreach($members as $ifs) { + $realif = get_real_interface($ifs); + if ($realif) + mwexec("/sbin/ifconfig {$realif} group {$groupname['ifname']}"); + } + + return; +} /* XXX: stub for code that references the old functions(mostly packages) */ function get_real_wan_interface($interface = "wan") { |