When the MTU of a bridge is changed, device_set_mtu will
now change the MTU of all ports in that bridge, too.
This does not seem to be 100% necessary, but it makes it
clearer and probably avoids some other bugs.
Signed-off-by: Arne Fitzenreiter <arne_f(a)ipfire.org>
---
src/functions/functions.device | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/functions/functions.device b/src/functions/functions.device
index 571b1fb..a261335 100644
--- a/src/functions/functions.device
+++ b/src/functions/functions.device
@@ -659,6 +659,14 @@ device_set_mtu() {
assert device_exists ${device}
+ # Handle bridges differently
+ if device_is_bridge ${device}; then
+ local port
+ for port in $(bridge_get_members ${device}); do
+ device_set_mtu ${port} ${mtu}
+ done
+ fi
+
log INFO "Setting MTU of ${device} to ${mtu}"
local up
--
2.6.3