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

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) ===

From 76f5b64eae59851c7ee4cd46d6e6a1b50faa3209 Mon Sep 17 00:00:00 2001
From: Vitaly Lavrov <vel21r...@gmail.com>
Date: Thu, 30 Jun 2016 20:04:49 +0300
Subject: [PATCH] Set up MTU for vlan-type interfaces.

---
 src/lxc/conf.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index e8dfaae..d1f136e 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -2741,6 +2741,16 @@ static int instantiate_vlan(struct lxc_handler *handler, 
struct lxc_netdev *netd
 
        DEBUG("instantiated vlan '%s', ifindex is '%d'", " vlan1000",
              netdev->ifindex);
+       if (netdev->mtu) {
+               int mtu = atoi(netdev->mtu);
+               err = mtu > 64 && mtu < 65536 ? lxc_netdev_set_mtu(peer,mtu) : 
EINVAL;
+               if(err) {
+                       ERROR("failed to set mtu '%s' for %s : %s",
+                             netdev->mtu, peer, strerror(-err));
+                       lxc_netdev_delete_by_name(peer);
+                       return -1;
+               }
+       }
 
        return 0;
 }
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to