]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
keep the name of the physical interface
authorDaniel Lezcano <daniel.lezcano@free.fr>
Thu, 22 Jul 2010 13:59:44 +0000 (15:59 +0200)
committerDaniel Lezcano <dlezcano@fr.ibm.com>
Thu, 22 Jul 2010 13:59:44 +0000 (15:59 +0200)
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>
src/lxc/conf.c

index 3aaf31cbc08ae44446ffb05d9c0dc06e92a93015..a118ae197cc75ef6b6a87f79adc8eaab4dd588f8 100644 (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);