[lxc-devel] [lxd/master] network: Bring mtu device up
stgraber on Github
lxc-bot at linuxcontainers.org
Wed Mar 20 05:33:08 UTC 2019
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190319/4800d3aa/attachment.bin>
-------------- next part --------------
From 1f15a603800d3463a62ae2bff9b8b80f8f9673af Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Tue, 19 Mar 2019 22:32:44 -0700
Subject: [PATCH] network: Bring mtu device up
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
lxd/networks.go | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lxd/networks.go b/lxd/networks.go
index 2f4188b4b6..b957452301 100644
--- a/lxd/networks.go
+++ b/lxd/networks.go
@@ -1070,7 +1070,10 @@ func (n *network) Start() error {
if mtu != "" && n.config["bridge.driver"] != "openvswitch" {
_, err = shared.RunCommand("ip", "link", "add", "dev", fmt.Sprintf("%s-mtu", n.name), "mtu", mtu, "type", "dummy")
if err == nil {
- networkAttachInterface(n.name, fmt.Sprintf("%s-mtu", n.name))
+ _, err = shared.RunCommand("ip", "link", "set", "dev", fmt.Sprintf("%s-mtu", n.name), "up")
+ if err == nil {
+ networkAttachInterface(n.name, fmt.Sprintf("%s-mtu", n.name))
+ }
}
}
More information about the lxc-devel
mailing list