diff options
author | Ermal Luçi <eri@pfsense.org> | 2010-02-05 19:50:20 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2010-02-05 19:51:09 +0000 |
commit | fcd4a42519016d696abad314ecaa591b5be703b5 (patch) | |
tree | 5cf705edfe885490d8faef4dfcca0f829d1e0cf1 | |
parent | 3066a36fbd0c0ec44fb8a31c69068316f55f2500 (diff) | |
download | pfsense-fcd4a42519016d696abad314ecaa591b5be703b5.zip pfsense-fcd4a42519016d696abad314ecaa591b5be703b5.tar.gz |
Ticket #272. When reconfiguring an interface that is part of a bridge just add it to the bridge instead of reconfiguring the bridge again. This helps even in overall bridge functionality.
-rw-r--r-- | etc/inc/interfaces.inc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 5f6ce74..7de3e55 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -456,6 +456,21 @@ function interface_bridge_configure(&$bridge) { return $bridgeif; } +function interface_bridge_add_member($bridgeif, $interface) { + + if (!does_interface_exist($bridgeif) || !does_interface_exist($interface)) + return; + + $mtu = get_interface_mtu($brigeif); + $mtum = get_interface_mtu($interface); + + if ($mtu != $mtum) + mwexec("/sbin/ifconfig {$interface} mtu {$mtu}"); + + interfaces_bring_up($interface); + mwexec("/sbin/ifconfig {$bridgeif} addm {$interface}"); +} + function interfaces_lagg_configure() { global $config, $g; @@ -1745,7 +1760,7 @@ function interface_configure($interface = "wan", $reloadall = false) { if (link_interface_to_bridge($interface)) { foreach ($config['bridges']['bridged'] as $bridge) if (stristr($bridge['members'], "{$interface}")) - interface_bridge_configure($bridge); + interface_bridge_add_member($bridge['bridgeif'], $realif); } link_interface_to_vips($interface, "update"); |