diff options
author | Ermal <eri@pfsense.org> | 2010-08-26 14:21:47 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-08-26 14:21:47 +0000 |
commit | 48f236320d930978ecb8b7eabb5256c368ba1de9 (patch) | |
tree | c48986c325a22046846eee15a19956adf4a9d4c3 /etc | |
parent | 52ab1d445a2dfb671a8ec958980ae0997dcb9923 (diff) | |
download | pfsense-48f236320d930978ecb8b7eabb5256c368ba1de9.zip pfsense-48f236320d930978ecb8b7eabb5256c368ba1de9.tar.gz |
Fixes #847. Check even interface groups before allowing deletion of an interface. Also try to readd to a group an interface when configuring.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/interfaces.inc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 6ce101c..ab917fd 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -2489,6 +2489,10 @@ function interface_configure($interface = "wan", $reloadall = false) { link_interface_to_vips($interface, "update"); + $grouptmp = link_interface_to_group($interface); + if (!empty($grouptmp)) + interface_group_add_member($realif, $grouptmp); + if ($interface == "lan") /* make new hosts file */ system_hosts_generate(); @@ -2627,6 +2631,10 @@ function interface_group_setup(&$groupname /* The parameter is an array */) { return; } + +function interface_group_add_member($interface, $groupname) { + mwexec("/sbin/ifconfig {$interface} group {$groupname}", true); +} /* COMPAT Function */ function convert_friendly_interface_to_real_interface_name($interface) { @@ -3026,6 +3034,17 @@ function link_interface_to_bridge($int) { } } +function link_interface_to_group($int) { + global $config; + + if (is_array($config['ifgroups']['ifgroupentry'])) { + foreach ($config['ifgroups']['ifgroupentry'] as $group) { + if (in_array($int, explode(" ", $groupname['members']))) + return "{$group['ifname']}"; + } + } +} + function link_interface_to_gre($interface) { global $config; |