FAILED: patch "[PATCH] mptcp: pm: fix backup support in signal endpoints" failed to apply to 6.1-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 6834097fc38c5416701c793da94558cea49c0a1f
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2024080727-stricken-overact-90c5@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..
Possible dependencies:
6834097fc38c ("mptcp: pm: fix backup support in signal endpoints") 9ae7846c4b6b ("mptcp: dump addrs in userspace pm list")34e74a5cf3b7 ("mptcp: implement mptcp_userspace_pm_dump_addr") aab4d8564947 ("net: mptcp: use policy generated by YAML spec") 1e07938e29c5 ("net: mptcp: rename netlink handlers to mptcp_pm_nl_<blah>_{doit,dumpit}") 1d0507f46843 ("net: mptcp: convert netlink from small_ops to ops") 740ebe35bd3f ("mptcp: add struct mptcp_sched_ops")6ba7ce89905c ("mptcp: unify pm set_flags interfaces")f40be0db0b76 ("mptcp: unify pm get_flags_and_ifindex_by_id")a963853fd465 ("mptcp: use net instead of sock_net")dfc8d0603033 ("mptcp: implement delayed seq generation for passive fastopen")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 6834097fc38c5416701c793da94558cea49c0a1f Mon Sep 17 00:00:00 2001
From: "Matthieu Baerts (NGI0)" <[email protected]>
Date: Sat, 27 Jul 2024 12:01:28 +0200
Subject: [PATCH] mptcp: pm: fix backup support in signal endpoints
There was a support for signal endpoints, but only when the endpoint's flag was changed during a connection. If an endpoint with the signal and backup was already present, the MP_JOIN reply was not containing the backup flag as expected.
That's confusing to have this inconsistent behaviour. On the other hand, the infrastructure to set the backup flag in the SYN + ACK + MP_JOIN was already there, it was just never set before. Now when requesting the local ID from the path-manager, the backup status is also requested.
Note that when the userspace PM is used, the backup flag can be set if the local address was already used before with a backup flag, e.g. if the address was announced with the 'backup' flag, or a subflow was created with the 'backup' flag.
net/mptcp/pm.c +12 -0
@@ -426,6 +426,18 @@ int mptcp_pm_get_local_id(struct mptcp_sock *msk, struct sock_common *skc)return mptcp_pm_nl_get_local_id (msk, &skc_local); } +bool mptcp_pm_is_backup (struct mptcp_sock *msk,struct sock_common *skc) +{ +struct mptcp_addr_info skc_local; + +mptcp_local_address ((struct sock_common *)skc, &skc_local); + +if (mptcp_pm_is_userspace (msk)) +return mptcp_userspace_pm_is_backup (msk, &skc_local); + +return mptcp_pm_nl_is_backup (msk, &skc_local); +} +int mptcp_pm_get_flags_and_ifindex_by_id (struct mptcp_sock *msk,unsigned int id,u8 *flags,int *ifindex) {
net/mptcp/pm_netlink.c +18 -0
@@ -1101,6 +1101,24 @@ int mptcp_pm_nl_get_local_id(struct mptcp_sock *msk, struct mptcp_addr_info *skcreturn ret; } +bool mptcp_pm_nl_is_backup (struct mptcp_sock *msk,struct mptcp_addr_info *skc) +{ +struct pm_nl_pernet *pernet =pm_nl_get_pernet_from_msk (msk); +struct mptcp_pm_addr_entry *entry; +bool backup = false; + +rcu_read_lock (); +list_for_each_entry_rcu (entry, &pernet->local_addr_list, list) { +if (mptcp_addresses_equal (&entry->addr, skc, entry->addr.port)) { + backup = !!(entry->flags &MPTCP_PM_ADDR_FLAG_BACKUP ); +break ; + } + } +rcu_read_unlock (); + +return backup; +} +#define MPTCP_PM_CMD_GRP_OFFSET 0#define MPTCP_PM_EV_GRP_OFFSET 1
net/mptcp/pm_userspace.c +18 -0
@@ -165,6 +165,24 @@ int mptcp_userspace_pm_get_local_id(struct mptcp_sock *msk,return mptcp_userspace_pm_append_new_local_addr (msk, &new_entry, true); } +bool mptcp_userspace_pm_is_backup (struct mptcp_sock *msk, +struct mptcp_addr_info *skc) +{ +struct mptcp_pm_addr_entry *entry; +bool backup = false; + +spin_lock_bh (&msk->pm.lock); +list_for_each_entry (entry, &msk->pm.userspace_pm_local_addr_list, list) { +if (mptcp_addresses_equal (&entry->addr, skc, false)) { + backup = !!(entry->flags &MPTCP_PM_ADDR_FLAG_BACKUP ); +break ; + } + } +spin_unlock_bh (&msk->pm.lock); + +return backup; +} +int mptcp_pm_nl_announce_doit (struct sk_buff *skb,struct genl_info *info) {struct nlattr *token = info->attrs[MPTCP_PM_ATTR_TOKEN ];
net/mptcp/protocol.h +3 -0
@@ -1109,6 +1109,9 @@ bool mptcp_pm_rm_addr_signal(struct mptcp_sock *msk, unsigned int remaining,int mptcp_pm_get_local_id (struct mptcp_sock *msk,struct sock_common *skc);int mptcp_pm_nl_get_local_id (struct mptcp_sock *msk,struct mptcp_addr_info *skc);int mptcp_userspace_pm_get_local_id (struct mptcp_sock *msk,struct mptcp_addr_info *skc); +bool mptcp_pm_is_backup (struct mptcp_sock *msk,struct sock_common *skc); +bool mptcp_pm_nl_is_backup (struct mptcp_sock *msk,struct mptcp_addr_info *skc); +bool mptcp_userspace_pm_is_backup (struct mptcp_sock *msk,struct mptcp_addr_info *skc);int mptcp_pm_dump_addr (struct sk_buff *msg,struct netlink_callback *cb);int mptcp_pm_nl_dump_addr (struct sk_buff *msg,struct netlink_callback *cb);
net/mptcp/subflow.c +3 -0
@@ -100,6 +100,7 @@ static struct mptcp_sock *subflow_token_join_request(struct request_sock *req)return NULL ; } subflow_req->local_id = local_id; + subflow_req->request_bkup =mptcp_pm_is_backup (msk, (struct sock_common *)req);return msk; }
@@ -620,6 +621,8 @@ static int subflow_chk_local_id(struct sock *sk)return err;subflow_set_local_id (subflow, err); + subflow->request_bkup =mptcp_pm_is_backup (msk, (struct sock_common *)sk); +return 0 ; }
Matthieu Baerts (NGI0)
maintainerPATCH 1/2 mptcp: export local_address
From: Geliang Tang <[email protected]>
commit dc886bce753cc2cf3c88ec5c7a6880a4e17d65ba upstream.
Rename local_address() with "mptcp_" prefix and export it in protocol.h.
This function will be re-used in the common PM code (pm.c) in the following commit.
Stable-dep-of: 6834097fc38c ("mptcp: pm: fix backup support in signal endpoints")
--- net/mptcp/pm_netlink.c | 17 ++++++++--------- net/mptcp/protocol.h | 1 + 2 files changed, 9 insertions(+), 9 deletions(-)
net/mptcp/pm_netlink.c +8 -9
@@ -86,8 +86,7 @@ bool mptcp_addresses_equal(const struct mptcp_addr_info *a,return a->port == b->port; } -static void local_address (const struct sock_common *skc, -struct mptcp_addr_info *addr) +void mptcp_local_address (const struct sock_common *skc,struct mptcp_addr_info *addr) { addr->family = skc->skc_family; addr->port =htons (skc->skc_num);
@@ -122,7 +121,7 @@ static bool lookup_subflow_by_saddr(const struct list_head *list,list_for_each_entry (subflow, list, node) { skc = (struct sock_common *)mptcp_subflow_tcp_sock (subflow); -local_address (skc, &cur); +mptcp_local_address (skc, &cur);if (mptcp_addresses_equal (&cur, saddr, saddr->port))return true; }
@@ -274,7 +273,7 @@ bool mptcp_pm_sport_in_anno_list(struct mptcp_sock *msk, const struct sock *sk)struct mptcp_addr_info saddr;bool ret = false; -local_address ((struct sock_common *)sk, &saddr); +mptcp_local_address ((struct sock_common *)sk, &saddr);spin_lock_bh (&msk->pm.lock);list_for_each_entry (entry, &msk->pm.anno_list, list) {
@@ -545,7 +544,7 @@ static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk)struct mptcp_addr_info mpc_addr;bool backup = false; -local_address ((struct sock_common *)msk->first, &mpc_addr); +mptcp_local_address ((struct sock_common *)msk->first, &mpc_addr);rcu_read_lock (); entry =__lookup_addr (pernet, &mpc_addr, false);if (entry) {
@@ -753,7 +752,7 @@ int mptcp_pm_nl_mp_prio_send_ack(struct mptcp_sock *msk,struct sock *ssk =mptcp_subflow_tcp_sock (subflow);struct mptcp_addr_info local, remote; -local_address ((struct sock_common *)ssk, &local); +mptcp_local_address ((struct sock_common *)ssk, &local);if (!mptcp_addresses_equal (&local, addr, addr->port))continue ;
@@ -1072,8 +1071,8 @@ int mptcp_pm_nl_get_local_id(struct mptcp_sock *msk, struct sock_common *skc)/* The 0 ID mapping is defined by the first subflow, copied into the msk * addr */ -local_address ((struct sock_common *)msk, &msk_local); -local_address ((struct sock_common *)skc, &skc_local); +mptcp_local_address ((struct sock_common *)msk, &msk_local); +mptcp_local_address ((struct sock_common *)skc, &skc_local);if (mptcp_addresses_equal (&msk_local, &skc_local, false))return 0 ;
@@ -1507,7 +1506,7 @@ static int mptcp_nl_remove_id_zero_address(struct net *net,if (list_empty (&msk->conn_list) ||mptcp_pm_is_userspace (msk)) goto next; -local_address ((struct sock_common *)msk, &msk_local); +mptcp_local_address ((struct sock_common *)msk, &msk_local);if (!mptcp_addresses_equal (&msk_local, addr, addr->port)) goto next;
net/mptcp/protocol.h +1 -0
@@ -618,6 +618,7 @@ void __mptcp_unaccepted_force_close(struct sock *sk);bool mptcp_addresses_equal (const struct mptcp_addr_info *a,const struct mptcp_addr_info *b,bool use_port); +void mptcp_local_address (const struct sock_common *skc,struct mptcp_addr_info *addr);/* called with sk socket lock held */ int __mptcp_subflow_connect(struct sock *sk, const struct mptcp_addr_info *loc,
Signature · 1 line
2.45.2
Matthieu Baerts (NGI0)
maintainerPATCH 2/2 mptcp: pm: fix backup support in signal endpoints
commit 6834097fc38c5416701c793da94558cea49c0a1f upstream.
There was a support for signal endpoints, but only when the endpoint's flag was changed during a connection. If an endpoint with the signal and backup was already present, the MP_JOIN reply was not containing the backup flag as expected.
That's confusing to have this inconsistent behaviour. On the other hand, the infrastructure to set the backup flag in the SYN + ACK + MP_JOIN was already there, it was just never set before. Now when requesting the local ID from the path-manager, the backup status is also requested.
Note that when the userspace PM is used, the backup flag can be set if the local address was already used before with a backup flag, e.g. if the address was announced with the 'backup' flag, or a subflow was created with the 'backup' flag.
[ Conflicts in pm_userspace.c because the context has changed in commit
1e07938e29c5 ("net: mptcp: rename netlink handlers to mptcp_pm_nl_<blah>_{doit,dumpit}") which is not in this version. This commit is unrelated to this modification.
Conflicts in protocol.h because the context has changed in commit 9ae7846c4b6b ("mptcp: dump addrs in userspace pm list") which is not in this version. This commit is unrelated to this modification. Conflicts in pm.c because the context has changed in commit f40be0db0b76 ("mptcp: unify pm get_flags_and_ifindex_by_id") which is not in this version. This commit is unrelated to this modification. ]
--- net/mptcp/pm.c | 12 ++++++++++++ net/mptcp/pm_netlink.c | 18 ++++++++++++++++++ net/mptcp/pm_userspace.c | 18 ++++++++++++++++++ net/mptcp/protocol.h | 3 +++ net/mptcp/subflow.c | 3 +++ 5 files changed, 54 insertions(+)
net/mptcp/pm.c +12 -0
@@ -416,6 +416,18 @@ int mptcp_pm_get_local_id(struct mptcp_sock *msk, struct sock_common *skc)return mptcp_pm_nl_get_local_id (msk, skc); } +bool mptcp_pm_is_backup (struct mptcp_sock *msk,struct sock_common *skc) +{ +struct mptcp_addr_info skc_local; + +mptcp_local_address ((struct sock_common *)skc, &skc_local); + +if (mptcp_pm_is_userspace (msk)) +return mptcp_userspace_pm_is_backup (msk, &skc_local); + +return mptcp_pm_nl_is_backup (msk, &skc_local); +} +void mptcp_pm_subflow_chk_stale (const struct mptcp_sock *msk,struct sock *ssk) {struct mptcp_subflow_context *subflow =mptcp_subflow_ctx (ssk);
net/mptcp/pm_netlink.c +18 -0
@@ -1110,6 +1110,24 @@ int mptcp_pm_nl_get_local_id(struct mptcp_sock *msk, struct sock_common *skc)return ret; } +bool mptcp_pm_nl_is_backup (struct mptcp_sock *msk,struct mptcp_addr_info *skc) +{ +struct pm_nl_pernet *pernet =pm_nl_get_pernet_from_msk (msk); +struct mptcp_pm_addr_entry *entry; +bool backup = false; + +rcu_read_lock (); +list_for_each_entry_rcu (entry, &pernet->local_addr_list, list) { +if (mptcp_addresses_equal (&entry->addr, skc, entry->addr.port)) { + backup = !!(entry->flags &MPTCP_PM_ADDR_FLAG_BACKUP ); +break ; + } + } +rcu_read_unlock (); + +return backup; +} +#define MPTCP_PM_CMD_GRP_OFFSET 0#define MPTCP_PM_EV_GRP_OFFSET 1
net/mptcp/pm_userspace.c +18 -0
@@ -159,6 +159,24 @@ int mptcp_userspace_pm_get_local_id(struct mptcp_sock *msk,return mptcp_userspace_pm_append_new_local_addr (msk, &new_entry, true); } +bool mptcp_userspace_pm_is_backup (struct mptcp_sock *msk, +struct mptcp_addr_info *skc) +{ +struct mptcp_pm_addr_entry *entry; +bool backup = false; + +spin_lock_bh (&msk->pm.lock); +list_for_each_entry (entry, &msk->pm.userspace_pm_local_addr_list, list) { +if (mptcp_addresses_equal (&entry->addr, skc, false)) { + backup = !!(entry->flags &MPTCP_PM_ADDR_FLAG_BACKUP ); +break ; + } + } +spin_unlock_bh (&msk->pm.lock); + +return backup; +} +int mptcp_nl_cmd_announce (struct sk_buff *skb,struct genl_info *info) {struct nlattr *token = info->attrs[MPTCP_PM_ATTR_TOKEN ];
net/mptcp/protocol.h +3 -0
@@ -913,6 +913,9 @@ bool mptcp_pm_rm_addr_signal(struct mptcp_sock *msk, unsigned int remaining, struct mptcp_rm_list *rm_list);int mptcp_pm_get_local_id (struct mptcp_sock *msk,struct sock_common *skc);int mptcp_userspace_pm_get_local_id (struct mptcp_sock *msk,struct mptcp_addr_info *skc); +bool mptcp_pm_is_backup (struct mptcp_sock *msk,struct sock_common *skc); +bool mptcp_pm_nl_is_backup (struct mptcp_sock *msk,struct mptcp_addr_info *skc); +bool mptcp_userspace_pm_is_backup (struct mptcp_sock *msk,struct mptcp_addr_info *skc);static inline u8 subflow_get_local_id (const struct mptcp_subflow_context *subflow) {
net/mptcp/subflow.c +3 -0
@@ -99,6 +99,7 @@ static struct mptcp_sock *subflow_token_join_request(struct request_sock *req)return NULL ; } subflow_req->local_id = local_id; + subflow_req->request_bkup =mptcp_pm_is_backup (msk, (struct sock_common *)req);return msk; }
@@ -513,6 +514,8 @@ static int subflow_chk_local_id(struct sock *sk)return err;subflow_set_local_id (subflow, err); + subflow->request_bkup =mptcp_pm_is_backup (msk, (struct sock_common *)sk); +return 0 ; }
Signature · 1 line
2.45.2
Patch "mptcp: export local_address" has been added to the 6.1-stable tree
In reply to Matthieu Baerts (NGI0)This is a note to let you know that I've just added the patch titled
mptcp: export local_address
to the 6.1-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
mptcp-export-local_address.patch
and it can be found in the queue-6.1 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
From [email protected] Thu Aug 8 17:36:21 2024
From: "Matthieu Baerts (NGI0)" <[email protected]>
Date: Thu, 8 Aug 2024 17:35:47 +0200
Subject: mptcp: export local_address
To: [email protected], [email protected]
Cc: MPTCP Upstream <[email protected]>, Geliang Tang <[email protected]>, Matthieu Baerts <[email protected]>, Larysa Zaremba <[email protected]>, Jakub Kicinski <[email protected]>, Matthieu Baerts <[email protected]>
Message-ID: <[email protected]>
From: Geliang Tang <[email protected]>
commit dc886bce753cc2cf3c88ec5c7a6880a4e17d65ba upstream.
Rename local_address() with "mptcp_" prefix and export it in protocol.h.
This function will be re-used in the common PM code (pm.c) in the following commit.
Stable-dep-of: 6834097fc38c ("mptcp: pm: fix backup support in signal endpoints")
--- net/mptcp/pm_netlink.c | 17 ++++++++--------- net/mptcp/protocol.h | 1 + 2 files changed, 9 insertions(+), 9 deletions(-)
net/mptcp/pm_netlink.c +8 -9
@@ -86,8 +86,7 @@ bool mptcp_addresses_equal(const structreturn a->port == b->port; } -static void local_address (const struct sock_common *skc, -struct mptcp_addr_info *addr) +void mptcp_local_address (const struct sock_common *skc,struct mptcp_addr_info *addr) { addr->family = skc->skc_family; addr->port =htons (skc->skc_num);
@@ -122,7 +121,7 @@ static bool lookup_subflow_by_saddr(conslist_for_each_entry (subflow, list, node) { skc = (struct sock_common *)mptcp_subflow_tcp_sock (subflow); -local_address (skc, &cur); +mptcp_local_address (skc, &cur);if (mptcp_addresses_equal (&cur, saddr, saddr->port))return true; }
@@ -274,7 +273,7 @@ bool mptcp_pm_sport_in_anno_list(structstruct mptcp_addr_info saddr;bool ret = false; -local_address ((struct sock_common *)sk, &saddr); +mptcp_local_address ((struct sock_common *)sk, &saddr);spin_lock_bh (&msk->pm.lock);list_for_each_entry (entry, &msk->pm.anno_list, list) {
@@ -545,7 +544,7 @@ static void mptcp_pm_create_subflow_or_sstruct mptcp_addr_info mpc_addr;bool backup = false; -local_address ((struct sock_common *)msk->first, &mpc_addr); +mptcp_local_address ((struct sock_common *)msk->first, &mpc_addr);rcu_read_lock (); entry =__lookup_addr (pernet, &mpc_addr, false);if (entry) {
@@ -753,7 +752,7 @@ int mptcp_pm_nl_mp_prio_send_ack(structstruct sock *ssk =mptcp_subflow_tcp_sock (subflow);struct mptcp_addr_info local, remote; -local_address ((struct sock_common *)ssk, &local); +mptcp_local_address ((struct sock_common *)ssk, &local);if (!mptcp_addresses_equal (&local, addr, addr->port))continue ;
@@ -1072,8 +1071,8 @@ int mptcp_pm_nl_get_local_id(struct mptc/* The 0 ID mapping is defined by the first subflow, copied into the msk * addr */ -local_address ((struct sock_common *)msk, &msk_local); -local_address ((struct sock_common *)skc, &skc_local); +mptcp_local_address ((struct sock_common *)msk, &msk_local); +mptcp_local_address ((struct sock_common *)skc, &skc_local);if (mptcp_addresses_equal (&msk_local, &skc_local, false))return 0 ;
@@ -1507,7 +1506,7 @@ static int mptcp_nl_remove_id_zero_addreif (list_empty (&msk->conn_list) ||mptcp_pm_is_userspace (msk)) goto next; -local_address ((struct sock_common *)msk, &msk_local); +mptcp_local_address ((struct sock_common *)msk, &msk_local);if (!mptcp_addresses_equal (&msk_local, addr, addr->port)) goto next;
net/mptcp/protocol.h +1 -0
@@ -618,6 +618,7 @@ void __mptcp_unaccepted_force_close(strubool mptcp_addresses_equal (const struct mptcp_addr_info *a,const struct mptcp_addr_info *b,bool use_port); +void mptcp_local_address (const struct sock_common *skc,struct mptcp_addr_info *addr);/* called with sk socket lock held */ int __mptcp_subflow_connect(struct sock *sk, const struct mptcp_addr_info *loc,
Patches currently in stable-queue which might be from [email protected] are
queue-6.1/mptcp-pm-fix-backup-support-in-signal-endpoints.patch queue-6.1/selftests-mptcp-join-check-backup-support-in-signal-endp.patch queue-6.1/selftests-mptcp-join-validate-backup-in-mpj.patch queue-6.1/mptcp-export-local_address.patch
Patch "mptcp: pm: fix backup support in signal endpoints" has been added to the 6.1-stable tree
In reply to Matthieu Baerts (NGI0)This is a note to let you know that I've just added the patch titled
mptcp: pm: fix backup support in signal endpoints
to the 6.1-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
mptcp-pm-fix-backup-support-in-signal-endpoints.patch
and it can be found in the queue-6.1 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
From [email protected] Thu Aug 8 17:36:21 2024
From: "Matthieu Baerts (NGI0)" <[email protected]>
Date: Thu, 8 Aug 2024 17:35:48 +0200
Subject: mptcp: pm: fix backup support in signal endpoints
To: [email protected], [email protected]
Cc: MPTCP Upstream <[email protected]>, "Matthieu Baerts (NGI0)" <[email protected]>, Mat Martineau <[email protected]>, Paolo Abeni <[email protected]>
Message-ID: <[email protected]>
From: "Matthieu Baerts (NGI0)" <[email protected]>
commit 6834097fc38c5416701c793da94558cea49c0a1f upstream.
There was a support for signal endpoints, but only when the endpoint's flag was changed during a connection. If an endpoint with the signal and backup was already present, the MP_JOIN reply was not containing the backup flag as expected.
That's confusing to have this inconsistent behaviour. On the other hand, the infrastructure to set the backup flag in the SYN + ACK + MP_JOIN was already there, it was just never set before. Now when requesting the local ID from the path-manager, the backup status is also requested.
Note that when the userspace PM is used, the backup flag can be set if the local address was already used before with a backup flag, e.g. if the address was announced with the 'backup' flag, or a subflow was created with the 'backup' flag.
[ Conflicts in pm_userspace.c because the context has changed in commit
1e07938e29c5 ("net: mptcp: rename netlink handlers to mptcp_pm_nl_<blah>_{doit,dumpit}") which is not in this version. This commit is unrelated to this modification.
Conflicts in protocol.h because the context has changed in commit 9ae7846c4b6b ("mptcp: dump addrs in userspace pm list") which is not in this version. This commit is unrelated to this modification. Conflicts in pm.c because the context has changed in commit f40be0db0b76 ("mptcp: unify pm get_flags_and_ifindex_by_id") which is not in this version. This commit is unrelated to this modification. ]
--- net/mptcp/pm.c | 12 ++++++++++++ net/mptcp/pm_netlink.c | 18 ++++++++++++++++++ net/mptcp/pm_userspace.c | 18 ++++++++++++++++++ net/mptcp/protocol.h | 3 +++ net/mptcp/subflow.c | 3 +++ 5 files changed, 54 insertions(+)
net/mptcp/pm.c +12 -0
@@ -416,6 +416,18 @@ int mptcp_pm_get_local_id(struct mptcp_sreturn mptcp_pm_nl_get_local_id (msk, skc); } +bool mptcp_pm_is_backup (struct mptcp_sock *msk,struct sock_common *skc) +{ +struct mptcp_addr_info skc_local; + +mptcp_local_address ((struct sock_common *)skc, &skc_local); + +if (mptcp_pm_is_userspace (msk)) +return mptcp_userspace_pm_is_backup (msk, &skc_local); + +return mptcp_pm_nl_is_backup (msk, &skc_local); +} +void mptcp_pm_subflow_chk_stale (const struct mptcp_sock *msk,struct sock *ssk) {struct mptcp_subflow_context *subflow =mptcp_subflow_ctx (ssk);
net/mptcp/pm_netlink.c +18 -0
@@ -1110,6 +1110,24 @@ int mptcp_pm_nl_get_local_id(struct mptcreturn ret; } +bool mptcp_pm_nl_is_backup (struct mptcp_sock *msk,struct mptcp_addr_info *skc) +{ +struct pm_nl_pernet *pernet =pm_nl_get_pernet_from_msk (msk); +struct mptcp_pm_addr_entry *entry; +bool backup = false; + +rcu_read_lock (); +list_for_each_entry_rcu (entry, &pernet->local_addr_list, list) { +if (mptcp_addresses_equal (&entry->addr, skc, entry->addr.port)) { + backup = !!(entry->flags &MPTCP_PM_ADDR_FLAG_BACKUP ); +break ; + } + } +rcu_read_unlock (); + +return backup; +} +#define MPTCP_PM_CMD_GRP_OFFSET 0#define MPTCP_PM_EV_GRP_OFFSET 1
net/mptcp/pm_userspace.c +18 -0
@@ -159,6 +159,24 @@ int mptcp_userspace_pm_get_local_id(strureturn mptcp_userspace_pm_append_new_local_addr (msk, &new_entry, true); } +bool mptcp_userspace_pm_is_backup (struct mptcp_sock *msk, +struct mptcp_addr_info *skc) +{ +struct mptcp_pm_addr_entry *entry; +bool backup = false; + +spin_lock_bh (&msk->pm.lock); +list_for_each_entry (entry, &msk->pm.userspace_pm_local_addr_list, list) { +if (mptcp_addresses_equal (&entry->addr, skc, false)) { + backup = !!(entry->flags &MPTCP_PM_ADDR_FLAG_BACKUP ); +break ; + } + } +spin_unlock_bh (&msk->pm.lock); + +return backup; +} +int mptcp_nl_cmd_announce (struct sk_buff *skb,struct genl_info *info) {struct nlattr *token = info->attrs[MPTCP_PM_ATTR_TOKEN ];
net/mptcp/protocol.h +3 -0
@@ -913,6 +913,9 @@ bool mptcp_pm_rm_addr_signal(struct mptc struct mptcp_rm_list *rm_list);int mptcp_pm_get_local_id (struct mptcp_sock *msk,struct sock_common *skc);int mptcp_userspace_pm_get_local_id (struct mptcp_sock *msk,struct mptcp_addr_info *skc); +bool mptcp_pm_is_backup (struct mptcp_sock *msk,struct sock_common *skc); +bool mptcp_pm_nl_is_backup (struct mptcp_sock *msk,struct mptcp_addr_info *skc); +bool mptcp_userspace_pm_is_backup (struct mptcp_sock *msk,struct mptcp_addr_info *skc);static inline u8 subflow_get_local_id (const struct mptcp_subflow_context *subflow) {
net/mptcp/subflow.c +3 -0
@@ -99,6 +99,7 @@ static struct mptcp_sock *subflow_token_return NULL ; } subflow_req->local_id = local_id; + subflow_req->request_bkup =mptcp_pm_is_backup (msk, (struct sock_common *)req);return msk; }
@@ -513,6 +514,8 @@ static int subflow_chk_local_id(struct sreturn err;subflow_set_local_id (subflow, err); + subflow->request_bkup =mptcp_pm_is_backup (msk, (struct sock_common *)sk); +return 0 ; }
Patches currently in stable-queue which might be from [email protected] are
queue-6.1/mptcp-pm-fix-backup-support-in-signal-endpoints.patch queue-6.1/selftests-mptcp-join-check-backup-support-in-signal-endp.patch queue-6.1/selftests-mptcp-join-validate-backup-in-mpj.patch queue-6.1/mptcp-export-local_address.patch