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

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) ===
Closes #6270

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From a1f5e2fba281683f1d149487724a72ba22012f18 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Tue, 1 Oct 2019 13:00:51 -0400
Subject: [PATCH] lxd/devices/nic: Set MTU on both side of veth
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #6270

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 lxd/device/device_utils_network.go | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/lxd/device/device_utils_network.go 
b/lxd/device/device_utils_network.go
index da17438110..e2eeed970b 100644
--- a/lxd/device/device_utils_network.go
+++ b/lxd/device/device_utils_network.go
@@ -300,7 +300,6 @@ func networkCreateVethPair(hostName string, m 
deviceConfig.Device) (string, erro
                MTU, err := strconv.ParseUint(m["mtu"], 10, 32)
                if err != nil {
                        return "", fmt.Errorf("Invalid MTU specified: %v", err)
-
                }
 
                err = NetworkSetDevMTU(peerName, MTU)
@@ -308,16 +307,29 @@ func networkCreateVethPair(hostName string, m 
deviceConfig.Device) (string, erro
                        NetworkRemoveInterface(peerName)
                        return "", fmt.Errorf("Failed to set the MTU: %v", err)
                }
+
+               err = NetworkSetDevMTU(hostName, MTU)
+               if err != nil {
+                       NetworkRemoveInterface(peerName)
+                       return "", fmt.Errorf("Failed to set the MTU: %v", err)
+               }
        } else if m["parent"] != "" {
                parentMTU, err := NetworkGetDevMTU(m["parent"])
                if err != nil {
                        return "", fmt.Errorf("Failed to get the parent MTU: 
%v", err)
                }
+
                err = NetworkSetDevMTU(peerName, parentMTU)
                if err != nil {
                        NetworkRemoveInterface(peerName)
                        return "", fmt.Errorf("Failed to set the MTU: %v", err)
                }
+
+               err = NetworkSetDevMTU(hostName, parentMTU)
+               if err != nil {
+                       NetworkRemoveInterface(peerName)
+                       return "", fmt.Errorf("Failed to set the MTU: %v", err)
+               }
        }
 
        return peerName, nil
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to