* [PATCH 5.10.y 1/2] mptcp: export local_address [not found] <2024080729-unclaimed-shopping-6751@gregkh> @ 2024-08-09 10:55 ` Matthieu Baerts (NGI0) 2024-08-09 10:55 ` [PATCH 5.10.y 2/2] mptcp: pm: fix backup support in signal endpoints Matthieu Baerts (NGI0) ` (2 more replies) 0 siblings, 3 replies; 5+ messages in thread From: Matthieu Baerts (NGI0) @ 2024-08-09 10:55 UTC (permalink / raw) To: stable, gregkh Cc: MPTCP Upstream, Geliang Tang, Matthieu Baerts, Larysa Zaremba, Jakub Kicinski, Matthieu Baerts From: Geliang Tang <geliang.tang@suse.com> 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. Signed-off-by: Geliang Tang <geliang.tang@suse.com> Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> Reviewed-by: Larysa Zaremba <larysa.zaremba@intel.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Stable-dep-of: 6834097fc38c ("mptcp: pm: fix backup support in signal endpoints") [ Conflicts in pm_netlink.c and protocol.h, because the context has changed in commit 4638de5aefe5 ("mptcp: handle local addrs announced by userspace PMs") which is not in this version. This commit is unrelated to this modification. Also some parts using 'local_address' are not in this version, that's OK, we don't need to do anything with them. ] Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> --- net/mptcp/pm_netlink.c | 9 ++++----- net/mptcp/protocol.h | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 7f4d84f5189b..6a0079d42dc4 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -84,8 +84,7 @@ static bool address_zero(const struct mptcp_addr_info *addr) return addresses_equal(addr, &zero, false); } -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->port = 0; addr->family = skc->skc_family; @@ -120,7 +119,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 (addresses_equal(&cur, saddr, false)) return true; } @@ -533,8 +532,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 (addresses_equal(&msk_local, &skc_local, false)) return 0; diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index b5978bb4022f..ddfc7bde8c90 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -372,6 +372,7 @@ void __mptcp_close_ssk(struct sock *sk, struct sock *ssk, struct mptcp_subflow_context *subflow, long timeout); void mptcp_subflow_reset(struct sock *ssk); +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, -- 2.45.2 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 5.10.y 2/2] mptcp: pm: fix backup support in signal endpoints 2024-08-09 10:55 ` [PATCH 5.10.y 1/2] mptcp: export local_address Matthieu Baerts (NGI0) @ 2024-08-09 10:55 ` Matthieu Baerts (NGI0) 2024-08-12 12:44 ` Patch "mptcp: pm: fix backup support in signal endpoints" has been added to the 5.10-stable tree gregkh 2024-08-12 12:38 ` [PATCH 5.10.y 1/2] mptcp: export local_address Greg KH 2024-08-12 12:44 ` Patch "mptcp: export local_address" has been added to the 5.10-stable tree gregkh 2 siblings, 1 reply; 5+ messages in thread From: Matthieu Baerts (NGI0) @ 2024-08-09 10:55 UTC (permalink / raw) To: stable, gregkh Cc: MPTCP Upstream, Matthieu Baerts (NGI0), Mat Martineau, Paolo Abeni 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. Fixes: 4596a2c1b7f5 ("mptcp: allow creating non-backup subflows") Cc: stable@vger.kernel.org Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/507 Reviewed-by: Mat Martineau <martineau@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com> [ 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") and commit 71b7dec27f34 ("mptcp: less aggressive retransmission strategy") which are not in this version. These commits are unrelated to this modification. Conflicts in subflow.c, because the commit 4cf86ae84c71 ("mptcp: strict local address ID selection") is not in this version. It is then not needed to modify the subflow_chk_local_id() helper, which is not in this version. Also, in this version, there is no pm_userspace.c, because this PM has been added in v5.19, which also causes conflicts in protocol.h, and pm_netlink.c. Plus the code in pm.c can be simplified, as there is no userspace PM. And the code in pm_netlink.c needs to use addresses_equal() instead of mptcp_addresses_equal(), see commit 4638de5aefe5 ("mptcp: handle local addrs announced by userspace PMs"). The code in pm_netlink.c also needs to be adapted because the pm_nl_get_pernet_from_msk() helper is not in this version, introduced later in commit c682bf536cf4 ("mptcp: add pm_nl_pernet helpers"), and also because the 'flags' are in mptcp_addr_info structure, see commit daa83ab03954 ("mptcp: move flags and ifindex out of mptcp_addr_info"). ] Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> --- net/mptcp/pm.c | 9 +++++++++ net/mptcp/pm_netlink.c | 20 ++++++++++++++++++++ net/mptcp/protocol.h | 2 ++ net/mptcp/subflow.c | 1 + 4 files changed, 32 insertions(+) diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index e19e1525ecbb..1f310abbf1ed 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -225,6 +225,15 @@ 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); + + return mptcp_pm_nl_is_backup(msk, &skc_local); +} + void mptcp_pm_data_init(struct mptcp_sock *msk) { msk->pm.add_addr_signaled = 0; diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 6a0079d42dc4..ca57d856d5df 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -568,6 +568,26 @@ 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 mptcp_pm_addr_entry *entry; + struct pm_nl_pernet *pernet; + bool backup = false; + + pernet = net_generic(sock_net((struct sock *)msk), pm_nl_pernet_id); + + rcu_read_lock(); + list_for_each_entry_rcu(entry, &pernet->local_addr_list, list) { + if (addresses_equal(&entry->addr, skc, entry->addr.port)) { + backup = !!(entry->addr.flags & MPTCP_PM_ADDR_FLAG_BACKUP); + break; + } + } + rcu_read_unlock(); + + return backup; +} + void mptcp_pm_nl_data_init(struct mptcp_sock *msk) { struct mptcp_pm_data *pm = &msk->pm; diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index ddfc7bde8c90..4348bccb982f 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -481,6 +481,7 @@ bool mptcp_pm_add_addr_signal(struct mptcp_sock *msk, unsigned int remaining, bool mptcp_pm_rm_addr_signal(struct mptcp_sock *msk, unsigned int remaining, u8 *rm_id); int mptcp_pm_get_local_id(struct mptcp_sock *msk, struct sock_common *skc); +bool mptcp_pm_is_backup(struct mptcp_sock *msk, struct sock_common *skc); void __init mptcp_pm_nl_init(void); void mptcp_pm_nl_data_init(struct mptcp_sock *msk); @@ -490,6 +491,7 @@ void mptcp_pm_nl_add_addr_received(struct mptcp_sock *msk); void mptcp_pm_nl_rm_addr_received(struct mptcp_sock *msk); void mptcp_pm_nl_rm_subflow_received(struct mptcp_sock *msk, u8 rm_id); int mptcp_pm_nl_get_local_id(struct mptcp_sock *msk, struct sock_common *skc); +bool mptcp_pm_nl_is_backup(struct mptcp_sock *msk, struct mptcp_addr_info *skc); static inline struct mptcp_ext *mptcp_get_ext(struct sk_buff *skb) { diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index f4067484727e..ba86cb06d6d8 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -80,6 +80,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); get_random_bytes(&subflow_req->local_nonce, sizeof(u32)); -- 2.45.2 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Patch "mptcp: pm: fix backup support in signal endpoints" has been added to the 5.10-stable tree 2024-08-09 10:55 ` [PATCH 5.10.y 2/2] mptcp: pm: fix backup support in signal endpoints Matthieu Baerts (NGI0) @ 2024-08-12 12:44 ` gregkh 0 siblings, 0 replies; 5+ messages in thread From: gregkh @ 2024-08-12 12:44 UTC (permalink / raw) To: gregkh, martineau, matttbe, mptcp, pabeni; +Cc: stable-commits 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 5.10-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-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@vger.kernel.org> know about it. From stable+bounces-66255-greg=kroah.com@vger.kernel.org Fri Aug 9 12:55:57 2024 From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org> Date: Fri, 9 Aug 2024 12:55:40 +0200 Subject: mptcp: pm: fix backup support in signal endpoints To: stable@vger.kernel.org, gregkh@linuxfoundation.org Cc: MPTCP Upstream <mptcp@lists.linux.dev>, "Matthieu Baerts (NGI0)" <matttbe@kernel.org>, Mat Martineau <martineau@kernel.org>, Paolo Abeni <pabeni@redhat.com> Message-ID: <20240809105538.2903162-4-matttbe@kernel.org> From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org> 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. Fixes: 4596a2c1b7f5 ("mptcp: allow creating non-backup subflows") Cc: stable@vger.kernel.org Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/507 Reviewed-by: Mat Martineau <martineau@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com> [ 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") and commit 71b7dec27f34 ("mptcp: less aggressive retransmission strategy") which are not in this version. These commits are unrelated to this modification. Conflicts in subflow.c, because the commit 4cf86ae84c71 ("mptcp: strict local address ID selection") is not in this version. It is then not needed to modify the subflow_chk_local_id() helper, which is not in this version. Also, in this version, there is no pm_userspace.c, because this PM has been added in v5.19, which also causes conflicts in protocol.h, and pm_netlink.c. Plus the code in pm.c can be simplified, as there is no userspace PM. And the code in pm_netlink.c needs to use addresses_equal() instead of mptcp_addresses_equal(), see commit 4638de5aefe5 ("mptcp: handle local addrs announced by userspace PMs"). The code in pm_netlink.c also needs to be adapted because the pm_nl_get_pernet_from_msk() helper is not in this version, introduced later in commit c682bf536cf4 ("mptcp: add pm_nl_pernet helpers"), and also because the 'flags' are in mptcp_addr_info structure, see commit daa83ab03954 ("mptcp: move flags and ifindex out of mptcp_addr_info"). ] Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- net/mptcp/pm.c | 9 +++++++++ net/mptcp/pm_netlink.c | 20 ++++++++++++++++++++ net/mptcp/protocol.h | 2 ++ net/mptcp/subflow.c | 1 + 4 files changed, 32 insertions(+) --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -225,6 +225,15 @@ int mptcp_pm_get_local_id(struct mptcp_s 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); + + return mptcp_pm_nl_is_backup(msk, &skc_local); +} + void mptcp_pm_data_init(struct mptcp_sock *msk) { msk->pm.add_addr_signaled = 0; --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -568,6 +568,26 @@ int mptcp_pm_nl_get_local_id(struct mptc return ret; } +bool mptcp_pm_nl_is_backup(struct mptcp_sock *msk, struct mptcp_addr_info *skc) +{ + struct mptcp_pm_addr_entry *entry; + struct pm_nl_pernet *pernet; + bool backup = false; + + pernet = net_generic(sock_net((struct sock *)msk), pm_nl_pernet_id); + + rcu_read_lock(); + list_for_each_entry_rcu(entry, &pernet->local_addr_list, list) { + if (addresses_equal(&entry->addr, skc, entry->addr.port)) { + backup = !!(entry->addr.flags & MPTCP_PM_ADDR_FLAG_BACKUP); + break; + } + } + rcu_read_unlock(); + + return backup; +} + void mptcp_pm_nl_data_init(struct mptcp_sock *msk) { struct mptcp_pm_data *pm = &msk->pm; --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -481,6 +481,7 @@ bool mptcp_pm_add_addr_signal(struct mpt bool mptcp_pm_rm_addr_signal(struct mptcp_sock *msk, unsigned int remaining, u8 *rm_id); int mptcp_pm_get_local_id(struct mptcp_sock *msk, struct sock_common *skc); +bool mptcp_pm_is_backup(struct mptcp_sock *msk, struct sock_common *skc); void __init mptcp_pm_nl_init(void); void mptcp_pm_nl_data_init(struct mptcp_sock *msk); @@ -490,6 +491,7 @@ void mptcp_pm_nl_add_addr_received(struc void mptcp_pm_nl_rm_addr_received(struct mptcp_sock *msk); void mptcp_pm_nl_rm_subflow_received(struct mptcp_sock *msk, u8 rm_id); int mptcp_pm_nl_get_local_id(struct mptcp_sock *msk, struct sock_common *skc); +bool mptcp_pm_nl_is_backup(struct mptcp_sock *msk, struct mptcp_addr_info *skc); static inline struct mptcp_ext *mptcp_get_ext(struct sk_buff *skb) { --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -80,6 +80,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); get_random_bytes(&subflow_req->local_nonce, sizeof(u32)); Patches currently in stable-queue which might be from kroah.com@vger.kernel.org are queue-5.10/mptcp-fix-nl-pm-announced-address-accounting.patch queue-5.10/mptcp-distinguish-rcv-vs-sent-backup-flag-in-requests.patch queue-5.10/mptcp-pm-fix-backup-support-in-signal-endpoints.patch queue-5.10/mptcp-mib-count-mpj-with-backup-flag.patch queue-5.10/mptcp-sched-check-both-directions-for-backup.patch queue-5.10/mptcp-export-local_address.patch ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 5.10.y 1/2] mptcp: export local_address 2024-08-09 10:55 ` [PATCH 5.10.y 1/2] mptcp: export local_address Matthieu Baerts (NGI0) 2024-08-09 10:55 ` [PATCH 5.10.y 2/2] mptcp: pm: fix backup support in signal endpoints Matthieu Baerts (NGI0) @ 2024-08-12 12:38 ` Greg KH 2024-08-12 12:44 ` Patch "mptcp: export local_address" has been added to the 5.10-stable tree gregkh 2 siblings, 0 replies; 5+ messages in thread From: Greg KH @ 2024-08-12 12:38 UTC (permalink / raw) To: Matthieu Baerts (NGI0) Cc: stable, MPTCP Upstream, Geliang Tang, Matthieu Baerts, Larysa Zaremba, Jakub Kicinski On Fri, Aug 09, 2024 at 12:55:39PM +0200, Matthieu Baerts (NGI0) wrote: > From: Geliang Tang <geliang.tang@suse.com> > > 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. > > Signed-off-by: Geliang Tang <geliang.tang@suse.com> > Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net> > Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> > Reviewed-by: Larysa Zaremba <larysa.zaremba@intel.com> > Signed-off-by: Jakub Kicinski <kuba@kernel.org> > Stable-dep-of: 6834097fc38c ("mptcp: pm: fix backup support in signal endpoints") > [ Conflicts in pm_netlink.c and protocol.h, because the context has > changed in commit 4638de5aefe5 ("mptcp: handle local addrs announced > by userspace PMs") which is not in this version. This commit is > unrelated to this modification. Also some parts using 'local_address' > are not in this version, that's OK, we don't need to do anything with > them. ] > Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> All backports now queued up, thanks! greg k-h ^ permalink raw reply [flat|nested] 5+ messages in thread
* Patch "mptcp: export local_address" has been added to the 5.10-stable tree 2024-08-09 10:55 ` [PATCH 5.10.y 1/2] mptcp: export local_address Matthieu Baerts (NGI0) 2024-08-09 10:55 ` [PATCH 5.10.y 2/2] mptcp: pm: fix backup support in signal endpoints Matthieu Baerts (NGI0) 2024-08-12 12:38 ` [PATCH 5.10.y 1/2] mptcp: export local_address Greg KH @ 2024-08-12 12:44 ` gregkh 2 siblings, 0 replies; 5+ messages in thread From: gregkh @ 2024-08-12 12:44 UTC (permalink / raw) To: geliang.tang, gregkh, kuba, larysa.zaremba, matthieu.baerts, matttbe, mptcp Cc: stable-commits This is a note to let you know that I've just added the patch titled mptcp: export local_address to the 5.10-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-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@vger.kernel.org> know about it. From stable+bounces-66254-greg=kroah.com@vger.kernel.org Fri Aug 9 12:55:55 2024 From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org> Date: Fri, 9 Aug 2024 12:55:39 +0200 Subject: mptcp: export local_address To: stable@vger.kernel.org, gregkh@linuxfoundation.org Cc: MPTCP Upstream <mptcp@lists.linux.dev>, Geliang Tang <geliang.tang@suse.com>, Matthieu Baerts <matthieu.baerts@tessares.net>, Larysa Zaremba <larysa.zaremba@intel.com>, Jakub Kicinski <kuba@kernel.org>, Matthieu Baerts <matttbe@kernel.org> Message-ID: <20240809105538.2903162-3-matttbe@kernel.org> From: Geliang Tang <geliang.tang@suse.com> 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. Signed-off-by: Geliang Tang <geliang.tang@suse.com> Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> Reviewed-by: Larysa Zaremba <larysa.zaremba@intel.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Stable-dep-of: 6834097fc38c ("mptcp: pm: fix backup support in signal endpoints") [ Conflicts in pm_netlink.c and protocol.h, because the context has changed in commit 4638de5aefe5 ("mptcp: handle local addrs announced by userspace PMs") which is not in this version. This commit is unrelated to this modification. Also some parts using 'local_address' are not in this version, that's OK, we don't need to do anything with them. ] Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- net/mptcp/pm_netlink.c | 9 ++++----- net/mptcp/protocol.h | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -84,8 +84,7 @@ static bool address_zero(const struct mp return addresses_equal(addr, &zero, false); } -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->port = 0; addr->family = skc->skc_family; @@ -120,7 +119,7 @@ static bool lookup_subflow_by_saddr(cons 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 (addresses_equal(&cur, saddr, false)) return true; } @@ -533,8 +532,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 (addresses_equal(&msk_local, &skc_local, false)) return 0; --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -372,6 +372,7 @@ void __mptcp_close_ssk(struct sock *sk, struct mptcp_subflow_context *subflow, long timeout); void mptcp_subflow_reset(struct sock *ssk); +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 kroah.com@vger.kernel.org are queue-5.10/mptcp-fix-nl-pm-announced-address-accounting.patch queue-5.10/mptcp-distinguish-rcv-vs-sent-backup-flag-in-requests.patch queue-5.10/mptcp-pm-fix-backup-support-in-signal-endpoints.patch queue-5.10/mptcp-mib-count-mpj-with-backup-flag.patch queue-5.10/mptcp-sched-check-both-directions-for-backup.patch queue-5.10/mptcp-export-local_address.patch ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-08-12 12:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <2024080729-unclaimed-shopping-6751@gregkh>
2024-08-09 10:55 ` [PATCH 5.10.y 1/2] mptcp: export local_address Matthieu Baerts (NGI0)
2024-08-09 10:55 ` [PATCH 5.10.y 2/2] mptcp: pm: fix backup support in signal endpoints Matthieu Baerts (NGI0)
2024-08-12 12:44 ` Patch "mptcp: pm: fix backup support in signal endpoints" has been added to the 5.10-stable tree gregkh
2024-08-12 12:38 ` [PATCH 5.10.y 1/2] mptcp: export local_address Greg KH
2024-08-12 12:44 ` Patch "mptcp: export local_address" has been added to the 5.10-stable tree gregkh
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox