Skip to content

Commit

Permalink
Squash-to: "mptcp: move drop_other_suboptions check under pm lock"
Browse files Browse the repository at this point in the history
MPJ ACK is a pure TCP ack on an established TCP connection, so is
eligble to carry MPTCP ADD_ADDR option. If that happens, the MPJ
subopt will be stripped and the MPJ handshake will be broken.

Avoid adding ADD_ADDR subopt if the current packet is MPJ ACK (or
MPC ACK, just to be safe: the added check it's cheap).

This fixes issues/221

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
  • Loading branch information
Paolo Abeni authored and matttbe committed Aug 12, 2021
1 parent c108c47 commit 32c3e4d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions net/mptcp/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,11 @@ static bool mptcp_established_options_add_addr(struct sock *sk, struct sk_buff *
bool port;
int len;

/* add addr will strip the existing options, be sure to avoid breaking
* MPC/MPJ handshakes
*/
if (!mptcp_pm_should_add_signal(msk) ||
(opts->suboptions & (OPTION_MPTCP_MPJ_ACK | OPTION_MPTCP_MPC_ACK)) ||
!mptcp_pm_add_addr_signal(msk, skb, opt_size, remaining, &opts->addr,
&echo, &port, &drop_other_suboptions))
return false;
Expand Down

0 comments on commit 32c3e4d

Please sign in to comment.