Commit 9e329f08 authored by Geliang Tang's avatar Geliang Tang Committed by Geliang Tang
Browse files

mptcp: use mptcp_check_fallback helper

mainline inclusion
from mainline-v6.7-rc1
commit 83d580ddbe1b3297c346b24070c23fcf6698393c
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I9VYQ9
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=83d580ddbe1b3297c346b24070c23fcf6698393c



--------------------------------

Use __mptcp_check_fallback() helper defined in net/mptcp/protocol.h,
instead of open-coding it in both __mptcp_do_fallback() and
mptcp_diag_fill_info().

Reviewed-by: default avatarMatthieu Baerts <matttbe@kernel.org>
Signed-off-by: default avatarGeliang Tang <geliang.tang@suse.com>
Signed-off-by: default avatarMat Martineau <martineau@kernel.org>
Link: https://lore.kernel.org/r/20231025-send-net-next-20231025-v1-5-db8f25f798eb@kernel.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Reviewed-by: default avatarJackie Liu <liuyun01@kylinos.cn>
Signed-off-by: default avatarGeliang Tang <tanggeliang@kylinos.cn>
parent 7991ac22
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1080,7 +1080,7 @@ static inline bool mptcp_check_fallback(const struct sock *sk)

static inline void __mptcp_do_fallback(struct mptcp_sock *msk)
{
	if (test_bit(MPTCP_FALLBACK_DONE, &msk->flags)) {
	if (__mptcp_check_fallback(msk)) {
		pr_debug("TCP fallback already done (msk=%p)", msk);
		return;
	}
+1 −1
Original line number Diff line number Diff line
@@ -919,7 +919,7 @@ void mptcp_diag_fill_info(struct mptcp_sock *msk, struct mptcp_info *info)
			mptcp_pm_get_local_addr_max(msk);
	}

	if (test_bit(MPTCP_FALLBACK_DONE, &msk->flags))
	if (__mptcp_check_fallback(msk))
		flags |= MPTCP_INFO_FLAG_FALLBACK;
	if (READ_ONCE(msk->can_ack))
		flags |= MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED;