aboutsummaryrefslogtreecommitdiffstats
path: root/net/mptcp/pm.c
diff options
context:
space:
mode:
authorGeliang Tang <[email protected]>2023-06-08 13:20:52 +0000
committerJakub Kicinski <[email protected]>2023-06-10 07:05:59 +0000
commit6ba7ce89905c5d5cdb4ff9ff7c763a6a1d31f48d (patch)
tree8d03f1a546f68545c53632a01ef78786be5f7b2e /net/mptcp/pm.c
parentmptcp: unify pm get_flags_and_ifindex_by_id (diff)
downloadkernel-6ba7ce89905c5d5cdb4ff9ff7c763a6a1d31f48d.tar.gz
kernel-6ba7ce89905c5d5cdb4ff9ff7c763a6a1d31f48d.zip
mptcp: unify pm set_flags interfaces
This patch unifies the three PM set_flags() interfaces: mptcp_pm_nl_set_flags() in mptcp/pm_netlink.c for the in-kernel PM and mptcp_userspace_pm_set_flags() in mptcp/pm_userspace.c for the userspace PM. They'll be switched in the common PM infterface mptcp_pm_set_flags() in mptcp/pm.c based on whether token is NULL or not. Signed-off-by: Geliang Tang <[email protected]> Reviewed-by: Matthieu Baerts <[email protected]> Signed-off-by: Matthieu Baerts <[email protected]> Reviewed-by: Larysa Zaremba <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/mptcp/pm.c')
-rw-r--r--net/mptcp/pm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index b4a1277b4bb5..7dbbad1e4f55 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -448,6 +448,15 @@ int mptcp_pm_get_flags_and_ifindex_by_id(struct mptcp_sock *msk, unsigned int id
return mptcp_pm_nl_get_flags_and_ifindex_by_id(msk, id, flags, ifindex);
}
+int mptcp_pm_set_flags(struct net *net, struct nlattr *token,
+ struct mptcp_pm_addr_entry *loc,
+ struct mptcp_pm_addr_entry *rem, u8 bkup)
+{
+ if (token)
+ return mptcp_userspace_pm_set_flags(net, token, loc, rem, bkup);
+ return mptcp_pm_nl_set_flags(net, loc, bkup);
+}
+
void mptcp_pm_subflow_chk_stale(const struct mptcp_sock *msk, struct sock *ssk)
{
struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(ssk);