]> git.ipfire.org Git - people/jschlag/network.git/commitdiff
Improve MTU handling on bridges
authorArne Fitzenreiter <arne_f@ipfire.org>
Wed, 19 Oct 2016 20:28:22 +0000 (20:28 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 19 Oct 2016 21:58:03 +0000 (22:58 +0100)
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@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.device

index 571b1fb4c5a62fb711a55686f3bc788599dbbc2b..a261335bc7fa3949ba21a6b55e6e7144a1eebd0f 100644 (file)
@@ -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