From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
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>
Subject: [PATCH 5.10.y 1/2] mptcp: export local_address
Date: Fri, 9 Aug 2024 12:55:39 +0200 [thread overview]
Message-ID: <20240809105538.2903162-3-matttbe@kernel.org> (raw)
In-Reply-To: <2024080729-unclaimed-shopping-6751@gregkh>
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
next prev parent reply other threads:[~2024-08-09 10:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-07 14:15 FAILED: patch "[PATCH] mptcp: pm: fix backup support in signal endpoints" failed to apply to 5.10-stable tree gregkh
2024-08-09 10:55 ` Matthieu Baerts (NGI0) [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240809105538.2903162-3-matttbe@kernel.org \
--to=matttbe@kernel.org \
--cc=geliang.tang@suse.com \
--cc=gregkh@linuxfoundation.org \
--cc=kuba@kernel.org \
--cc=larysa.zaremba@intel.com \
--cc=matthieu.baerts@tessares.net \
--cc=mptcp@lists.linux.dev \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox