mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-07 06:11:42 +00:00
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:
parent
bac8958311
commit
fb6d9b2f40
@ -1025,7 +1025,8 @@ static int setup_netdev(struct lxc_netdev *netdev)
|
|||||||
|
|
||||||
/* default: let the system to choose one interface name */
|
/* default: let the system to choose one interface name */
|
||||||
if (!netdev->name)
|
if (!netdev->name)
|
||||||
netdev->name = "eth%d";
|
netdev->name = netdev->type == LXC_NET_PHYS ?
|
||||||
|
netdev->link : "eth%d";
|
||||||
|
|
||||||
/* rename the interface name */
|
/* rename the interface name */
|
||||||
err = lxc_device_rename(ifname, netdev->name);
|
err = lxc_device_rename(ifname, netdev->name);
|
||||||
|
Loading…
Reference in New Issue
Block a user