From b4fb7de1b6214337d10cdd2527aa1daaf859e4d7 Mon Sep 17 00:00:00 2001 From: Vitaly Lavrov Date: Thu, 30 Jun 2016 20:04:49 +0300 Subject: [PATCH] Set up MTU for vlan-type interfaces. Signed-off-by: Vitaly Lavrov --- src/lxc/conf.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lxc/conf.c b/src/lxc/conf.c index e8dfaaee2..4bb345376 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -2741,6 +2741,15 @@ 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) { + err = lxc_netdev_set_mtu(peer, atoi(netdev->mtu)); + 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; } -- 2.47.2