From: Daniel Lezcano <daniel.lezc...@free.fr>

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

Signed-off-by: Daniel Lezcano <dlezc...@fr.ibm.com>
Reported-by: Sabdar <sab...@wellspringsys.com>
---
 src/lxc/conf.c |    3 ++-
 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);
-- 
1.7.0.4


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel

Reply via email to