The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/3253

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
If MTU setting is provided in network device config then always use it rather than inheriting from the link device.

Affected both bridge and router veth modes.

Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>
From e7a7daea3cab94b487f1cdbd094c7a4e68673dc7 Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parr...@canonical.com>
Date: Wed, 15 Jan 2020 09:33:31 +0000
Subject: [PATCH] network: Restore fixed MTU functionality

If MTU setting is provided in network device config then always use it rather 
than inheriting from the link device.

Affected both bridge and router veth modes.

Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>
---
 src/lxc/network.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/lxc/network.c b/src/lxc/network.c
index c8f44dd807..327bd97bd9 100644
--- a/src/lxc/network.c
+++ b/src/lxc/network.c
@@ -302,8 +302,10 @@ static int instantiate_veth(struct lxc_handler *handler, 
struct lxc_netdev *netd
        if (!veth2)
                return -1;
 
-       if (netdev->mtu && lxc_safe_uint(netdev->mtu, &mtu)) {
-               return log_error_errno(-1, errno, "Failed to parse mtu");
+       /* if mtu is specified in config then use that, otherwise inherit from 
link device if provided. */
+       if (netdev->mtu) {
+               if (lxc_safe_uint(netdev->mtu, &mtu))
+                       return log_error_errno(-1, errno, "Failed to parse 
mtu");
        } else if (netdev->link[0] != '\0') {
                int ifindex_mtu;
 
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to