]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rtnetlink: Remove "net" from newlink params
authorXiao Liang <shaw.leon@gmail.com>
Wed, 19 Feb 2025 12:50:36 +0000 (20:50 +0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 21 Feb 2025 23:28:03 +0000 (15:28 -0800)
Now that devices have been converted to use the specific netns instead
of ambiguous "net", let's remove it from newlink parameters.

Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20250219125039.18024-11-shaw.leon@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/rtnetlink.h
net/core/rtnetlink.c

index b22a106621fb4a31a20f8cf6be89b53bd2695f65..ec65a8cebb9922bc05e4f55b00b39997bc44fbda 100644 (file)
@@ -72,7 +72,6 @@ static inline int rtnl_msg_family(const struct nlmsghdr *nlh)
 /**
  * struct rtnl_newlink_params - parameters of rtnl_link_ops::newlink()
  *
- * @net: Netns of interest
  * @src_net: Source netns of rtnetlink socket
  * @link_net: Link netns by IFLA_LINK_NETNSID, NULL if not specified
  * @peer_net: Peer netns
@@ -80,7 +79,6 @@ static inline int rtnl_msg_family(const struct nlmsghdr *nlh)
  * @data: IFLA_INFO_DATA attributes
  */
 struct rtnl_newlink_params {
-       struct net *net;
        struct net *src_net;
        struct net *link_net;
        struct net *peer_net;
index 9ebbde0d131cea4d053785da519c0185fceab6b6..e980481bdd286bbd4b089c2114e5e2def1615866 100644 (file)
@@ -3798,12 +3798,6 @@ static int rtnl_newlink_create(struct sk_buff *skb, struct ifinfomsg *ifm,
 
        dev->ifindex = ifm->ifi_index;
 
-       params.net = params.src_net;
-       if (link_net)
-               params.net = link_net;
-       if (peer_net)
-               params.net = peer_net;
-
        if (ops->newlink)
                err = ops->newlink(dev, &params, extack);
        else