keep the name of the physical interface

When the interface used in the container is a physical
interface from the host, we keep the initial name.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Reported-by: Sabdar <sabdar@wellspringsys.com>
This commit is contained in:
Daniel Lezcano 2010-07-22 15:59:44 +02:00 committed by Daniel Lezcano
parent bac8958311
commit fb6d9b2f40

View File

@ -1025,7 +1025,8 @@ static int setup_netdev(struct lxc_netdev *netdev)
/* default: let the system to choose one interface name */
if (!netdev->name)
netdev->name = "eth%d";
netdev->name = netdev->type == LXC_NET_PHYS ?
netdev->link : "eth%d";
/* rename the interface name */
err = lxc_device_rename(ifname, netdev->name);