5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Geliang Tang <geliang.tang@xxxxxxxx> 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@xxxxxxxx> Reviewed-by: Matthieu Baerts <matthieu.baerts@xxxxxxxxxxxx> Signed-off-by: Matthieu Baerts <matthieu.baerts@xxxxxxxxxxxx> Reviewed-by: Larysa Zaremba <larysa.zaremba@xxxxxxxxx> Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx> 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@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- 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,