Skip to content

Commit 5568e4c

Browse files
committed
Merge branch 'mptcp-misc-fixes'
Matthieu Baerts says: ==================== mptcp: misc. fixes Here are two unrelated fixes, plus an extra patch: - Patch 1: prevent a warning by removing an unneeded and incorrect small optimisation in the path-manager. A fix for v5.10. - Patch 2: reset a subflow when MPTCP opts have been dropped after having correctly added a new path. A fix for v5.19. - Patch 3: add a safety check to prevent issues like the one fixed by the second patch. ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 18912c5 + db75a16 commit 5568e4c

File tree

3 files changed

+3
-19
lines changed

3 files changed

+3
-19
lines changed

net/mptcp/pm_netlink.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,11 +1514,6 @@ static int mptcp_nl_remove_subflow_and_signal_addr(struct net *net,
15141514
if (mptcp_pm_is_userspace(msk))
15151515
goto next;
15161516

1517-
if (list_empty(&msk->conn_list)) {
1518-
mptcp_pm_remove_anno_addr(msk, addr, false);
1519-
goto next;
1520-
}
1521-
15221517
lock_sock(sk);
15231518
remove_subflow = mptcp_lookup_subflow_by_saddr(&msk->conn_list, addr);
15241519
mptcp_pm_remove_anno_addr(msk, addr, remove_subflow &&

net/mptcp/protocol.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,6 +1199,8 @@ static inline void __mptcp_do_fallback(struct mptcp_sock *msk)
11991199
pr_debug("TCP fallback already done (msk=%p)\n", msk);
12001200
return;
12011201
}
1202+
if (WARN_ON_ONCE(!READ_ONCE(msk->allow_infinite_fallback)))
1203+
return;
12021204
set_bit(MPTCP_FALLBACK_DONE, &msk->flags);
12031205
}
12041206

net/mptcp/subflow.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,6 @@ static enum mapping_status get_mapping_status(struct sock *ssk,
11421142
if (data_len == 0) {
11431143
pr_debug("infinite mapping received\n");
11441144
MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_INFINITEMAPRX);
1145-
subflow->map_data_len = 0;
11461145
return MAPPING_INVALID;
11471146
}
11481147

@@ -1286,18 +1285,6 @@ static void subflow_sched_work_if_closed(struct mptcp_sock *msk, struct sock *ss
12861285
mptcp_schedule_work(sk);
12871286
}
12881287

1289-
static bool subflow_can_fallback(struct mptcp_subflow_context *subflow)
1290-
{
1291-
struct mptcp_sock *msk = mptcp_sk(subflow->conn);
1292-
1293-
if (subflow->mp_join)
1294-
return false;
1295-
else if (READ_ONCE(msk->csum_enabled))
1296-
return !subflow->valid_csum_seen;
1297-
else
1298-
return READ_ONCE(msk->allow_infinite_fallback);
1299-
}
1300-
13011288
static void mptcp_subflow_fail(struct mptcp_sock *msk, struct sock *ssk)
13021289
{
13031290
struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(ssk);
@@ -1393,7 +1380,7 @@ static bool subflow_check_data_avail(struct sock *ssk)
13931380
return true;
13941381
}
13951382

1396-
if (!subflow_can_fallback(subflow) && subflow->map_data_len) {
1383+
if (!READ_ONCE(msk->allow_infinite_fallback)) {
13971384
/* fatal protocol error, close the socket.
13981385
* subflow_error_report() will introduce the appropriate barriers
13991386
*/

0 commit comments

Comments
 (0)