conf: try to retrieve mtu from veth

When the mtu cannot be retrieved from netdev->link try from veth device.

Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
This commit is contained in:
Christian Brauner 2016-09-21 21:07:24 +02:00
parent e9280f6590
commit 729e8bf685
No known key found for this signature in database
GPG Key ID: 8EB056D53EECB12D

View File

@ -2577,10 +2577,13 @@ static int instantiate_veth(struct lxc_handler *handler, struct lxc_netdev *netd
INFO("Retrieved mtu %d", mtu);
} else if (netdev->link) {
bridge_index = if_nametoindex(netdev->link);
if (!bridge_index)
INFO("Could not retrieve mtu from %s", netdev->link);
mtu = netdev_get_mtu(bridge_index);
INFO("Retrieved mtu %d from %s", mtu, netdev->link);
if (bridge_index) {
mtu = netdev_get_mtu(bridge_index);
INFO("Retrieved mtu %d from %s", mtu, netdev->link);
} else {
mtu = netdev_get_mtu(netdev->ifindex);
INFO("Retrieved mtu %d from %s", mtu, veth2);
}
}
if (mtu) {