Skip to content

Commit

Permalink
mptcp: get addr in userspace pm list
Browse files Browse the repository at this point in the history
This patch renames mptcp_pm_nl_get_addr_doit() to in-kernel netlink
PM get addr function mptcp_pm_nl_get_addr(). If a token is gotten in
mptcp_pm_nl_get_addr_doit(), that means a userspace PM is used. So
invoke mptcp_userspace_pm_get_addr() to get addr in userspace PM list.
Otherwise, invoke mptcp_pm_nl_get_addr().

Signed-off-by: Geliang Tang <[email protected]>
  • Loading branch information
Geliang Tang authored and intel-lab-lkp committed Dec 19, 2023
1 parent 8d6cc74 commit 7b06135
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion net/mptcp/pm_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1653,7 +1653,7 @@ int mptcp_nl_fill_addr(struct sk_buff *skb,
return -EMSGSIZE;
}

int mptcp_pm_nl_get_addr_doit(struct sk_buff *skb, struct genl_info *info)
static int mptcp_pm_nl_get_addr(struct sk_buff *skb, struct genl_info *info)
{
struct nlattr *attr = info->attrs[MPTCP_PM_ENDPOINT_ADDR];
struct pm_nl_pernet *pernet = genl_info_pm_nl(info);
Expand Down Expand Up @@ -1703,6 +1703,14 @@ int mptcp_pm_nl_get_addr_doit(struct sk_buff *skb, struct genl_info *info)
return ret;
}

int mptcp_pm_nl_get_addr_doit(struct sk_buff *skb, struct genl_info *info)
{
if (info->attrs[MPTCP_PM_ATTR_TOKEN])
return mptcp_userspace_pm_get_addr(skb, info);

return mptcp_pm_nl_get_addr(skb, info);
}

static int mptcp_pm_nl_dump_addr(struct sk_buff *msg,
struct netlink_callback *cb)
{
Expand Down

0 comments on commit 7b06135

Please sign in to comment.