public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH pve-container] fix #4457: use bridge mtu if no mtu is defined
@ 2023-04-11 12:44 Alexandre Derumier
  2023-06-06 16:19 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandre Derumier @ 2023-04-11 12:44 UTC (permalink / raw)
  To: pve-devel

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: [PATCH pve-container] fix #4457: use bridge mtu if no mtu is defined
  2023-04-11 12:44 [pve-devel] [PATCH pve-container] fix #4457: use bridge mtu if no mtu is defined Alexandre Derumier
@ 2023-06-06 16:19 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2023-06-06 16:19 UTC (permalink / raw)
  To: Proxmox VE development discussion, Alexandre Derumier

Am 11/04/2023 um 14:44 schrieb Alexandre Derumier:
> Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
> ---
>  src/PVE/LXC.pm | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
>

applied, thanks!




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-06-06 16:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-11 12:44 [pve-devel] [PATCH pve-container] fix #4457: use bridge mtu if no mtu is defined Alexandre Derumier
2023-06-06 16:19 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal