From 9728a4004d6f6895b22360f0ce3dc483f79a09be Mon Sep 17 00:00:00 2001 From: Geliang Tang Date: Mon, 18 Dec 2023 17:23:42 +0800 Subject: [PATCH] mptcp: get addr in userspace pm list 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 --- net/mptcp/pm_netlink.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 0c1ea3c4258492..b27a0878882f59 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -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) {