From: Vitaly Lavrov Date: Thu, 30 Jun 2016 17:04:49 +0000 (+0300) Subject: Set up MTU for vlan-type interfaces. X-Git-Tag: lxc-2.1.0~381^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F1074%2Fhead;p=thirdparty%2Flxc.git Set up MTU for vlan-type interfaces. Signed-off-by: Vitaly Lavrov --- 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; }