From e4be156889b8106055118d053e3ece46b9be3228 Mon Sep 17 00:00:00 2001 From: Laine Stump Date: Thu, 14 Jan 2021 11:57:45 -0500 Subject: [PATCH] network: explicitly set the MTU of the bridge device. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the past, the MTU of libvirt virtual network bridge devices was implicitly set by setting the MTU of the "dummy tap device" (which was being added in order to force a particular MAC address from the bridge). But the dummy tap device was removed in commit ee6c936fbb (libvirt-6.8.0), and so the mtu setting in the network is ignored. The solution is, of course, to explicitly set the bridge device MTU when it is created. Note that any guest interface with a larger MTU that is attached will cause the bridge to (temporarily) assume the larger MTU, but it will revert to the bridge's own MTU when that device is deleted (this is not due to anything libvirt does; it's just how Linux host bridges work). Fixes: ee6c936fbbfb217175326f0201d59cc6727a0678 Resolves: https://bugzilla.redhat.com/1913561 Signed-off-by: Laine Stump Reviewed-by: Ján Tomko --- src/network/bridge_driver.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index b7c604eaea..519a473995 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -2336,6 +2336,9 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr driver, /* Set bridge options */ + if (def->mtu && virNetDevSetMTU(def->bridge, def->mtu) < 0) + goto error; + /* delay is configured in seconds, but virNetDevBridgeSetSTPDelay * expects milliseconds */