Skip to content

Commit

Permalink
mptcp: get addr in userspace pm list
Browse files Browse the repository at this point in the history
If a token is gotten in mptcp_pm_nl_get_addr_doit(), that means a userspace
PM is used. Invoke mptcp_userspace_pm_get_addr() to get addr in userspace
PM list.

Signed-off-by: Geliang Tang <geliang.tang@linux.dev>
  • Loading branch information
Geliang Tang authored and intel-lab-lkp committed Dec 18, 2023
1 parent 694abb4 commit 9728a40
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions net/mptcp/pm_netlink.c
Original file line number Diff line number Diff line change
@@ -1713,14 +1713,20 @@ int mptcp_pm_nl_put_entry_msg(struct sk_buff *msg,
int mptcp_pm_nl_get_addr_doit(struct sk_buff *skb, struct genl_info *info)
{
struct nlattr *attr = info->attrs[MPTCP_PM_ENDPOINT_ADDR];
struct nlattr *token = info->attrs[MPTCP_PM_ATTR_TOKEN];
struct pm_nl_pernet *pernet = genl_info_pm_nl(info);
struct mptcp_pm_addr_entry addr, *entry;
struct net *net = sock_net(skb->sk);
int ret;

ret = mptcp_pm_parse_entry(attr, info, false, &addr);
if (ret < 0)
return ret;

if (token)
return mptcp_userspace_pm_get_addr(net, info, nla_get_u32(token),
addr.addr.id);

spin_lock_bh(&pernet->lock);
entry = __lookup_addr_by_id(pernet, addr.addr.id);
if (!entry) {

0 comments on commit 9728a40

Please sign in to comment.