Skip to content

Commit

Permalink
mptcp: drop skb parameter of set_flags
Browse files Browse the repository at this point in the history
The first parameters "skb" in set_flags() interfaces are only used to
obtained the network namespace, which can also be obtained through the
second parameters "info" by using genl_info_net() helper. This patch
drop these useless parameters in all three set_flags() interfaces.

Signed-off-by: Geliang Tang <[email protected]>
  • Loading branch information
Geliang Tang authored and intel-lab-lkp committed Sep 30, 2024
1 parent be830f6 commit 8ac5504
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions net/mptcp/pm_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -2025,13 +2025,13 @@ static int mptcp_nl_set_flags(struct net *net,
return ret;
}

static int mptcp_pm_nl_set_flags(struct sk_buff *skb, struct genl_info *info)
static 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;
Expand Down Expand Up @@ -2079,16 +2079,16 @@ static int mptcp_pm_nl_set_flags(struct sk_buff *skb, struct genl_info *info)
return 0;
}

static int mptcp_pm_set_flags(struct sk_buff *skb, struct genl_info *info)
static 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);
}

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)
Expand Down
4 changes: 2 additions & 2 deletions net/mptcp/pm_userspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,14 +552,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 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 mptcp_addr_info rem = { .family = AF_UNSPEC, };
struct net *net = sock_net(skb->sk);
struct net *net = genl_info_net(info);
struct mptcp_sock *msk;
int ret = -EINVAL;
struct sock *sk;
Expand Down
2 changes: 1 addition & 1 deletion net/mptcp/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ 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_userspace_pm_set_flags(struct sk_buff *skb, 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);
Expand Down

0 comments on commit 8ac5504

Please sign in to comment.