Skip to content

Commit

Permalink
mptcp: track accurately the incoming MPC suboption type
Browse files Browse the repository at this point in the history
Currently in the receive path we don't need to discriminate
between MPC SYN, MPC SYN-ACK and MPC ACK, but soon the fastopen
code will need that info to properly track the fully established
status.

Track the exact MPC suboption type into the receive opt bitmap.
No functional change intended.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Paolo Abeni authored and Jakub Kicinski committed Nov 30, 2022
1 parent 1e777f3 commit fe33d38
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions net/mptcp/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ static void mptcp_parse_option(const struct sk_buff *skb,
{
u8 subtype = *ptr >> 4;
int expected_opsize;
u16 subopt;
u8 version;
u8 flags;
u8 i;
Expand All @@ -38,11 +39,15 @@ static void mptcp_parse_option(const struct sk_buff *skb,
expected_opsize = TCPOLEN_MPTCP_MPC_ACK_DATA;
else
expected_opsize = TCPOLEN_MPTCP_MPC_ACK;
subopt = OPTION_MPTCP_MPC_ACK;
} else {
if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_ACK)
if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_ACK) {
expected_opsize = TCPOLEN_MPTCP_MPC_SYNACK;
else
subopt = OPTION_MPTCP_MPC_SYNACK;
} else {
expected_opsize = TCPOLEN_MPTCP_MPC_SYN;
subopt = OPTION_MPTCP_MPC_SYN;
}
}

/* Cfr RFC 8684 Section 3.3.0:
Expand Down Expand Up @@ -85,7 +90,7 @@ static void mptcp_parse_option(const struct sk_buff *skb,

mp_opt->deny_join_id0 = !!(flags & MPTCP_CAP_DENY_JOIN_ID0);

mp_opt->suboptions |= OPTIONS_MPTCP_MPC;
mp_opt->suboptions |= subopt;
if (opsize >= TCPOLEN_MPTCP_MPC_SYNACK) {
mp_opt->sndr_key = get_unaligned_be64(ptr);
ptr += 8;
Expand Down

0 comments on commit fe33d38

Please sign in to comment.