From: Daniel Lezcano Date: Thu, 22 Jul 2010 13:59:44 +0000 (+0200) Subject: keep the name of the physical interface X-Git-Tag: lxc-0.7.2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb6d9b2f40efabe612b5eea4843cbddf5ce170cc;p=thirdparty%2Flxc.git 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 Reported-by: Sabdar --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 3aaf31cbc..a118ae197 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);