From: Alexandre Derumier <aderumier@odiso.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH pve-container] fix #4457: use bridge mtu if no mtu is defined
Date: Tue, 11 Apr 2023 14:44:48 +0200 [thread overview]
Message-ID: <20230411124448.1441242-1-aderumier@odiso.com> (raw)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
src/PVE/LXC.pm | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index c4d53e8..0ccbb33 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -731,14 +731,14 @@ sub update_lxc_config {
$raw .= "lxc.net.$ind.hwaddr = $d->{hwaddr}\n" if defined($d->{hwaddr});
$raw .= "lxc.net.$ind.name = $d->{name}\n" if defined($d->{name});
+ my $bridge_mtu = PVE::Network::read_bridge_mtu($d->{bridge});
+ my $mtu = $d->{mtu} || $bridge_mtu;
+
# Keep container from starting with invalid mtu configuration
- if (my $mtu = $d->{mtu}) {
- my $bridge_mtu = PVE::Network::read_bridge_mtu($d->{bridge});
- die "$k: MTU size '$mtu' is bigger than bridge MTU '$bridge_mtu'\n"
- if ($mtu > $bridge_mtu);
+ die "$k: MTU size '$mtu' is bigger than bridge MTU '$bridge_mtu'\n"
+ if ($mtu > $bridge_mtu);
- $raw .= "lxc.net.$ind.mtu = $mtu\n";
- }
+ $raw .= "lxc.net.$ind.mtu = $mtu\n";
# Starting with lxc 4.0, we do not patch lxc to execute our up-scripts.
if ($lxc_major >= 4) {
--
2.30.2
next reply other threads:[~2023-04-11 12:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-11 12:44 Alexandre Derumier [this message]
2023-06-06 16:19 ` [pve-devel] applied: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230411124448.1441242-1-aderumier@odiso.com \
--to=aderumier@odiso.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox