aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/hyperv/netvsc_drv.c
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@gmail.com>2021-04-05 00:12:23 -0700
committerDavid S. Miller <davem@davemloft.net>2021-04-05 14:49:40 -0700
commiteeb85a14ee3494febb85ccfbee0772eda0823b13 (patch)
tree7d5dbe29daf44df707f4439e8f8e6441ed13ba43 /drivers/net/hyperv/netvsc_drv.c
parentnet: nfc: Fix spelling errors in net/nfc module (diff)
downloadlinux-dev-eeb85a14ee3494febb85ccfbee0772eda0823b13.tar.xz
linux-dev-eeb85a14ee3494febb85ccfbee0772eda0823b13.zip
net: Allow to specify ifindex when device is moved to another namespace
Currently, we can specify ifindex on link creation. This change allows to specify ifindex when a device is moved to another network namespace. Even now, a device ifindex can be changed if there is another device with the same ifindex in the target namespace. So this change doesn't introduce completely new behavior, it adds more control to the process. CRIU users want to restore containers with pre-created network devices. A user will provide network devices and instructions where they have to be restored, then CRIU will restore network namespaces and move devices into them. The problem is that devices have to be restored with the same indexes that they have before C/R. Cc: Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com> Suggested-by: Christian Brauner <christian.brauner@ubuntu.com> Signed-off-by: Andrei Vagin <avagin@gmail.com> Reviewed-by: Christian Brauner <christian.brauner@ubuntu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hyperv/netvsc_drv.c')
-rw-r--r--drivers/net/hyperv/netvsc_drv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 7349a70af083..8c0c70e1da77 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -2354,7 +2354,7 @@ static int netvsc_register_vf(struct net_device *vf_netdev)
*/
if (!net_eq(dev_net(ndev), dev_net(vf_netdev))) {
ret = dev_change_net_namespace(vf_netdev,
- dev_net(ndev), "eth%d");
+ dev_net(ndev), "eth%d", 0);
if (ret)
netdev_err(vf_netdev,
"could not move to same namespace as %s: %d\n",