Skip to content

Commit 83d580d

Browse files
geliangtangkuba-moo
authored andcommitted
mptcp: use mptcp_check_fallback helper
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: Matthieu Baerts <matttbe@kernel.org> Signed-off-by: Geliang Tang <geliang.tang@suse.com> Signed-off-by: Mat Martineau <martineau@kernel.org> Link: https://lore.kernel.org/r/20231025-send-net-next-20231025-v1-5-db8f25f798eb@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 74cbb0c commit 83d580d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

net/mptcp/protocol.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,7 @@ static inline bool mptcp_check_fallback(const struct sock *sk)
10651065

10661066
static inline void __mptcp_do_fallback(struct mptcp_sock *msk)
10671067
{
1068-
if (test_bit(MPTCP_FALLBACK_DONE, &msk->flags)) {
1068+
if (__mptcp_check_fallback(msk)) {
10691069
pr_debug("TCP fallback already done (msk=%p)", msk);
10701070
return;
10711071
}

net/mptcp/sockopt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ void mptcp_diag_fill_info(struct mptcp_sock *msk, struct mptcp_info *info)
916916
mptcp_pm_get_local_addr_max(msk);
917917
}
918918

919-
if (test_bit(MPTCP_FALLBACK_DONE, &msk->flags))
919+
if (__mptcp_check_fallback(msk))
920920
flags |= MPTCP_INFO_FLAG_FALLBACK;
921921
if (READ_ONCE(msk->can_ack))
922922
flags |= MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED;

0 commit comments

Comments
 (0)