[pve-devel] [PATCH pve-common 1/3] INotify: fix mtu check && add test

Alexandre Derumier aderumier at odiso.com
Fri Feb 7 12:40:26 CET 2020


reverse the parent-child. (bridge-port is the parent)
---
 src/PVE/INotify.pm                             |  2 +-
 .../etc_network_interfaces/t.create_network.pl | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)

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
-- 
2.20.1




More information about the pve-devel mailing list