[pve-devel] [PATCH] pve-bridge : use mtu of the bridge for tap interface

Alexandre Derumier aderumier at odiso.com
Thu Sep 27 10:13:33 CEST 2012


currently if the bridge have a mtu of 9000, when putting a tap interface on it (mtu 1500 by default),
the mtu of the bridge goes to 1500.

we want that the mtu of the tap interface equal the mtu of the bridge

correcting bug:
https://bugzilla.proxmox.com/show_bug.cgi?id=258

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/QemuServer.pm |    1 +
 pve-bridge        |    4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 157b4a9..aaf2e4a 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3718,6 +3718,7 @@ my $snapshot_prepare = sub {
 		    if !(($scfg->{path} && $volname =~ m/\.qcow2$/) ||
 			 ($scfg->{type} eq 'nexenta') || 
 			 ($scfg->{type} eq 'rbd') || 
+			 ($scfg->{type} eq 'nfs') || 
 			 ($scfg->{type} eq 'sheepdog'));
 	    } elsif ($volid =~ m|^(/.+)$| && -e $volid) {
 		die "snapshot device '$volid' is not possible\n";
diff --git a/pve-bridge b/pve-bridge
index 2054705..f63be85 100755
--- a/pve-bridge
+++ b/pve-bridge
@@ -28,7 +28,9 @@ die "unable to parse network config '$netid'\n" if !$net;
 my $bridge = $net->{bridge};
 die "unable to get bridge setting\n" if !$bridge;
 
-system ("/sbin/ifconfig $iface 0.0.0.0 promisc up") == 0 ||
+my $bridgemtu = PVE::Tools::file_read_firstline("/sys/class/net/$bridge/mtu");
+
+system ("/sbin/ifconfig $iface 0.0.0.0 promisc up mtu $bridgemtu") == 0 ||
     die "interface activation failed\n";
 
 if ($net->{rate}) {
-- 
1.7.10




More information about the pve-devel mailing list