summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@gmail.com>2021-04-05 10:12:23 +0300
committerDavid S. Miller <davem@davemloft.net>2021-04-06 00:49:40 +0300
commiteeb85a14ee3494febb85ccfbee0772eda0823b13 (patch)
tree7d5dbe29daf44df707f4439e8f8e6441ed13ba43 /include
parentd3295869c40cb69a2c599000009b3fde43cec2ec (diff)
downloadlinux-eeb85a14ee3494febb85ccfbee0772eda0823b13.tar.xz
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 'include')
-rw-r--r--include/linux/netdevice.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index f57b70fc251f..b482236c0e99 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -4026,7 +4026,8 @@ void __dev_notify_flags(struct net_device *, unsigned int old_flags,
int dev_change_name(struct net_device *, const char *);
int dev_set_alias(struct net_device *, const char *, size_t);
int dev_get_alias(const struct net_device *, char *, size_t);
-int dev_change_net_namespace(struct net_device *, struct net *, const char *);
+int dev_change_net_namespace(struct net_device *dev, struct net *net,
+ const char *pat, int new_ifindex);
int __dev_set_mtu(struct net_device *, int);
int dev_validate_mtu(struct net_device *dev, int mtu,
struct netlink_ext_ack *extack);