From: Geliang Tang <tanggeliang@kylinos.cn>
The first parameter "skb" in mptcp_pm_nl_set_flags() or
mptcp_userspace_pm_set_flags() is only used to obtained the network
namespace, which can also be obtained through the second parameter
"info" by using genl_info_net() helper. This patch drop this useless
parameter in all three set_flags() interfaces:
mptcp_pm_set_flags()
mptcp_pm_nl_set_flags()
mptcp_userspace_pm_set_flags().
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
net/mptcp/pm.c | 6 +++---
net/mptcp/pm_netlink.c | 6 +++---
net/mptcp/pm_userspace.c | 4 ++--
net/mptcp/protocol.h | 6 +++---
4 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index 58181e846cec..4b9f7077db64 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -456,11 +456,11 @@ int mptcp_pm_dump_addr(struct sk_buff *msg, struct netlink_callback *cb)
return mptcp_pm_nl_dump_addr(msg, cb);
}
-int mptcp_pm_set_flags(struct sk_buff *skb, struct genl_info *info)
+int mptcp_pm_set_flags(struct genl_info *info)
{
if (info->attrs[MPTCP_PM_ATTR_TOKEN])
- return mptcp_userspace_pm_set_flags(skb, info);
- return mptcp_pm_nl_set_flags(skb, info);
+ return mptcp_userspace_pm_set_flags(info);
+ return mptcp_pm_nl_set_flags(info);
}
void mptcp_pm_subflow_chk_stale(const struct mptcp_sock *msk, struct sock *ssk)
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index ed236522a30e..9e2a866db1ad 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -2015,13 +2015,13 @@ static int mptcp_nl_set_flags(struct net *net,
return ret;
}
-int mptcp_pm_nl_set_flags(struct sk_buff *skb, struct genl_info *info)
+int mptcp_pm_nl_set_flags(struct genl_info *info)
{
struct mptcp_pm_addr_entry addr = { .addr = { .family = AF_UNSPEC }, };
struct nlattr *attr = info->attrs[MPTCP_PM_ATTR_ADDR];
u8 changed, mask = MPTCP_PM_ADDR_FLAG_BACKUP |
MPTCP_PM_ADDR_FLAG_FULLMESH;
- struct net *net = sock_net(skb->sk);
+ struct net *net = genl_info_net(info);
struct mptcp_pm_addr_entry *entry;
struct pm_nl_pernet *pernet;
u8 lookup_by_id = 0;
@@ -2071,7 +2071,7 @@ int mptcp_pm_nl_set_flags(struct sk_buff *skb, struct genl_info *info)
int mptcp_pm_nl_set_flags_doit(struct sk_buff *skb, struct genl_info *info)
{
- return mptcp_pm_set_flags(skb, info);
+ return mptcp_pm_set_flags(info);
}
static void mptcp_nl_mcast_send(struct net *net, struct sk_buff *nlskb, gfp_t gfp)
diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
index a68df40a62d3..0afbca4f7362 100644
--- a/net/mptcp/pm_userspace.c
+++ b/net/mptcp/pm_userspace.c
@@ -551,14 +551,14 @@ int mptcp_pm_nl_subflow_destroy_doit(struct sk_buff *skb, struct genl_info *info
return err;
}
-int mptcp_userspace_pm_set_flags(struct sk_buff *skb, struct genl_info *info)
+int mptcp_userspace_pm_set_flags(struct genl_info *info)
{
struct mptcp_pm_addr_entry loc = { .addr = { .family = AF_UNSPEC }, };
struct mptcp_pm_addr_entry rem = { .addr = { .family = AF_UNSPEC }, };
struct nlattr *attr_rem = info->attrs[MPTCP_PM_ATTR_ADDR_REMOTE];
struct nlattr *token = info->attrs[MPTCP_PM_ATTR_TOKEN];
struct nlattr *attr = info->attrs[MPTCP_PM_ATTR_ADDR];
- struct net *net = sock_net(skb->sk);
+ struct net *net = genl_info_net(info);
struct mptcp_sock *msk;
int ret = -EINVAL;
struct sock *sk;
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index ef66cc8c4d9a..d54ca66d1029 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -1029,9 +1029,9 @@ mptcp_pm_del_add_timer(struct mptcp_sock *msk,
struct mptcp_pm_add_entry *
mptcp_lookup_anno_list_by_saddr(const struct mptcp_sock *msk,
const struct mptcp_addr_info *addr);
-int mptcp_pm_set_flags(struct sk_buff *skb, struct genl_info *info);
-int mptcp_pm_nl_set_flags(struct sk_buff *skb, struct genl_info *info);
-int mptcp_userspace_pm_set_flags(struct sk_buff *skb, struct genl_info *info);
+int mptcp_pm_set_flags(struct genl_info *info);
+int mptcp_pm_nl_set_flags(struct genl_info *info);
+int mptcp_userspace_pm_set_flags(struct genl_info *info);
int mptcp_pm_announce_addr(struct mptcp_sock *msk,
const struct mptcp_addr_info *addr,
bool echo);
--
2.43.0
© 2016 - 2024 Red Hat, Inc.