Skip to content

Commit b198f77

Browse files
Paolo Abenigregkh
authored andcommitted
mptcp: always parse mptcp options for MPC reqsk
[ Upstream commit 06f9a43 ] In subflow_syn_recv_sock() we currently skip options parsing for OoO packet, given that such packets may not carry the relevant MPC option. If the peer generates an MPC+data TSO packet and some of the early segments are lost or get reorder, we server will ignore the peer key, causing transient, unexpected fallback to TCP. The solution is always parsing the incoming MPTCP options, and do the fallback only for in-order packets. This actually cleans the existing code a bit. Fixes: d22f498 ("mptcp: process MP_CAPABLE data option") Reported-by: Matthieu Baerts <matthieu.baerts@tessares.net> Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent be0d850 commit b198f77

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

‎net/mptcp/subflow.c‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -527,21 +527,20 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,
527527

528528
/* if the sk is MP_CAPABLE, we try to fetch the client key */
529529
if (subflow_req->mp_capable) {
530-
if (TCP_SKB_CB(skb)->seq != subflow_req->ssn_offset + 1) {
531-
/* here we can receive and accept an in-window,
532-
* out-of-order pkt, which will not carry the MP_CAPABLE
533-
* opt even on mptcp enabled paths
534-
*/
535-
goto create_msk;
536-
}
537-
530+
/* we can receive and accept an in-window, out-of-order pkt,
531+
* which may not carry the MP_CAPABLE opt even on mptcp enabled
532+
* paths: always try to extract the peer key, and fallback
533+
* for packets missing it.
534+
* Even OoO DSS packets coming legitly after dropped or
535+
* reordered MPC will cause fallback, but we don't have other
536+
* options.
537+
*/
538538
mptcp_get_options(skb, &mp_opt);
539539
if (!mp_opt.mp_capable) {
540540
fallback = true;
541541
goto create_child;
542542
}
543543

544-
create_msk:
545544
new_msk = mptcp_sk_clone(listener->conn, &mp_opt, req);
546545
if (!new_msk)
547546
fallback = true;

0 commit comments

Comments
 (0)