Skip to content

Commit efd340b

Browse files
matttbePaolo Abeni
authored andcommitted
mptcp: distinguish rcv vs sent backup flag in requests
When sending an MP_JOIN + SYN + ACK, it is possible to mark the subflow as 'backup' by setting the flag with the same name. Before this patch, the backup was set if the other peer set it in its MP_JOIN + SYN request. It is not correct: the backup flag should be set in the MPJ+SYN+ACK only if the host asks for it, and not mirroring what was done by the other peer. It is then required to have a dedicated bit for each direction, similar to what is done in the subflow context. Fixes: f296234 ("mptcp: Add handling of incoming MP_JOIN requests") Cc: stable@vger.kernel.org Reviewed-by: Mat Martineau <martineau@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent b6a66e5 commit efd340b

3 files changed

Lines changed: 3 additions & 1 deletion

File tree

net/mptcp/options.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ bool mptcp_synack_options(const struct request_sock *req, unsigned int *size,
909909
return true;
910910
} else if (subflow_req->mp_join) {
911911
opts->suboptions = OPTION_MPTCP_MPJ_SYNACK;
912-
opts->backup = subflow_req->backup;
912+
opts->backup = subflow_req->request_bkup;
913913
opts->join_id = subflow_req->local_id;
914914
opts->thmac = subflow_req->thmac;
915915
opts->nonce = subflow_req->local_nonce;

net/mptcp/protocol.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ struct mptcp_subflow_request_sock {
448448
u16 mp_capable : 1,
449449
mp_join : 1,
450450
backup : 1,
451+
request_bkup : 1,
451452
csum_reqd : 1,
452453
allow_join_id0 : 1;
453454
u8 local_id;

net/mptcp/subflow.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,6 +2005,7 @@ static void subflow_ulp_clone(const struct request_sock *req,
20052005
new_ctx->fully_established = 1;
20062006
new_ctx->remote_key_valid = 1;
20072007
new_ctx->backup = subflow_req->backup;
2008+
new_ctx->request_bkup = subflow_req->request_bkup;
20082009
WRITE_ONCE(new_ctx->remote_id, subflow_req->remote_id);
20092010
new_ctx->token = subflow_req->token;
20102011
new_ctx->thmac = subflow_req->thmac;

0 commit comments

Comments
 (0)