Commit af651aa9 by Stephane Nguyen Committed by Stéphane Graber

Fixing MTU calculation in instantiate_veth()]

parent 28272964
...@@ -2600,10 +2600,16 @@ static int instantiate_veth(struct lxc_handler *handler, struct lxc_netdev *netd ...@@ -2600,10 +2600,16 @@ static int instantiate_veth(struct lxc_handler *handler, struct lxc_netdev *netd
goto out_delete; goto out_delete;
} }
netdev->ifindex = if_nametoindex(veth2);
if (!netdev->ifindex) {
ERROR("failed to retrieve the index for %s", veth2);
goto out_delete;
}
if (netdev->mtu) { if (netdev->mtu) {
mtu = atoi(netdev->mtu); mtu = atoi(netdev->mtu);
} else if (netdev->link) { } else if (netdev->link) {
mtu = netdev_get_mtu(if_nametoindex(netdev->link)); mtu = netdev_get_mtu(netdev->ifindex);
} }
if (mtu) { if (mtu) {
...@@ -2626,12 +2632,6 @@ static int instantiate_veth(struct lxc_handler *handler, struct lxc_netdev *netd ...@@ -2626,12 +2632,6 @@ static int instantiate_veth(struct lxc_handler *handler, struct lxc_netdev *netd
} }
} }
netdev->ifindex = if_nametoindex(veth2);
if (!netdev->ifindex) {
ERROR("failed to retrieve the index for %s", veth2);
goto out_delete;
}
err = lxc_netdev_up(veth1); err = lxc_netdev_up(veth1);
if (err) { if (err) {
ERROR("failed to set %s up : %s", veth1, strerror(-err)); ERROR("failed to set %s up : %s", veth1, strerror(-err));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment