From: Alexandre Derumier Date: Fri, 7 Feb 2020 11:40:26 +0000 (+0100) Subject: INotify: fix mtu check && add test X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=968c90f174059e75293e236cef513ef4141d6f4c INotify: fix mtu check && add test reverse the parent-child. (bridge-port is the parent) --- diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm index 9bfd6fb..6e7a78c 100644 --- a/src/PVE/INotify.pm +++ b/src/PVE/INotify.pm @@ -1565,7 +1565,7 @@ sub __write_etc_network_interfaces { if ($n->{method} eq 'static' && $n->{address} ne '0.0.0.0') || ($n->{method6} eq 'static' && $n->{address} ne '::'); - &$check_mtu($ifaces, $iface, $p); + &$check_mtu($ifaces, $p, $iface); $bridgeports->{$p} = $iface; } $bridges->{$iface} = $d; diff --git a/test/etc_network_interfaces/t.create_network.pl b/test/etc_network_interfaces/t.create_network.pl index bf5b4b6..d6418f4 100644 --- a/test/etc_network_interfaces/t.create_network.pl +++ b/test/etc_network_interfaces/t.create_network.pl @@ -325,6 +325,17 @@ $config->{ifaces}->{'eth1.100'} = { autostart => 1 }; +$config->{ifaces}->{'vmbr4'} = { + mtu => 1200, + type => 'bridge', + method => 'manual', + families => ['inet'], + bridge_stp => 'off', + bridge_fd => 0, + bridge_ports => 'bond0.100', + autostart => 1 +}; + expect load('loopback') . <<"CHECK"; source-directory interfaces.d @@ -355,6 +366,13 @@ $vmbr0_part $vmbr123_part +auto vmbr4 +iface vmbr4 inet manual + bridge-ports bond0.100 + bridge-stp off + bridge-fd 0 + mtu 1200 + auto vmbr1.100 iface vmbr1.100 inet manual mtu 1300