Instead of re-inventing the wheel, use the flag we already
track to easily check if fallback is allowed.
Note that we could not check conn_list in a reliable way,
as the call side is not under the msk socket lock.
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
net/mptcp/protocol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index ba5f4f44f4b3..fd1c2e866e8e 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -622,7 +622,7 @@ static bool mptcp_check_data_fin(struct sock *sk)
static void mptcp_dss_corruption(struct mptcp_sock *msk, struct sock *ssk)
{
- if (list_is_singular(&msk->conn_list) && msk->first == ssk) {
+ if (READ_ONCE(msk->allow_infinite_fallback)) {
MPTCP_INC_STATS(sock_net(ssk),
MPTCP_MIB_DSSCORRUPTIONFALLBACK);
mptcp_do_fallback(ssk);
--
2.45.2