aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@free.fr>2010-07-22 15:59:44 +0200
committerDaniel Lezcano <dlezcano@fr.ibm.com>2010-07-22 15:59:44 +0200
commitfb6d9b2f40efabe612b5eea4843cbddf5ce170cc (patch)
tree042769e40e3b20b21fa09eab23715d627aaf20e5
parentfix inverted network interface creation (diff)
downloadlxc-fb6d9b2f40efabe612b5eea4843cbddf5ce170cc.tar.gz
lxc-fb6d9b2f40efabe612b5eea4843cbddf5ce170cc.tar.bz2
lxc-fb6d9b2f40efabe612b5eea4843cbddf5ce170cc.zip
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>
-rw-r--r--src/lxc/conf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 3aaf31c..a118ae1 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -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);