net: remove the new_ifindex argument from dev_change_net_namespace

Here is only one place where we want to specify new_ifindex. In all
other cases, callers pass 0 as new_ifindex. It looks reasonable to add a
low-level function with new_ifindex and to convert
dev_change_net_namespace to a static inline wrapper.

Fixes: eeb85a14ee ("net: Allow to specify ifindex when device is moved to another namespace")
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Andrei Vagin
2021-04-06 23:40:51 -07:00
committed by David S. Miller
parent 7e4a51319d
commit 0854fa82c9
6 changed files with 19 additions and 13 deletions

View File

@@ -2619,7 +2619,7 @@ static int do_setlink(const struct sk_buff *skb,
else
new_ifindex = 0;
err = dev_change_net_namespace(dev, net, ifname, new_ifindex);
err = __dev_change_net_namespace(dev, net, ifname, new_ifindex);
put_net(net);
if (err)
goto errout;
@@ -3461,7 +3461,7 @@ replay:
if (err < 0)
goto out_unregister;
if (link_net) {
err = dev_change_net_namespace(dev, dest_net, ifname, 0);
err = dev_change_net_namespace(dev, dest_net, ifname);
if (err < 0)
goto out_unregister;
}