]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
conf: try to retrieve mtu from veth 1203/head
authorChristian Brauner <christian.brauner@canonical.com>
Wed, 21 Sep 2016 19:07:24 +0000 (21:07 +0200)
committerChristian Brauner <christian.brauner@canonical.com>
Wed, 21 Sep 2016 19:07:24 +0000 (21:07 +0200)
When the mtu cannot be retrieved from netdev->link try from veth device.

Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
src/lxc/conf.c

index 53182fb0faaf96f1d01d3dad55b27ae2e800b092..f688f9432fea380570bdeca9a45e3b3b46aa369b 100644 (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) {