This patch uses mptcp_pm_parse_entry() to parse the local entry to get
the flags of this entry, instead of using mptcp_pm_parse_addr() to parse
the addr_l address when creating a subflow in userspace PM.
Fixes: e5ed101a6028 ("mptcp: userspace pm allow creating id 0 subflow")
Signed-off-by: Geliang Tang <geliang.tang@linux.dev>
---
net/mptcp/pm_userspace.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
index efecbe3cf415..8134dbdc7005 100644
--- a/net/mptcp/pm_userspace.c
+++ b/net/mptcp/pm_userspace.c
@@ -348,11 +348,12 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *skb, struct genl_info *info)
goto create_err;
}
- err = mptcp_pm_parse_addr(laddr, info, &addr_l);
+ err = mptcp_pm_parse_entry(laddr, info, true, &local);
if (err < 0) {
NL_SET_ERR_MSG_ATTR(info->extack, laddr, "error parsing local addr");
goto create_err;
}
+ addr_l = local.addr;
err = mptcp_pm_parse_addr(raddr, info, &addr_r);
if (err < 0) {
@@ -366,7 +367,6 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *skb, struct genl_info *info)
goto create_err;
}
- local.addr = addr_l;
err = mptcp_userspace_pm_append_new_local_addr(msk, &local);
if (err < 0) {
GENL_SET_ERR_MSG(info, "did not match address and id");
--
2.39.2