Skip to content

Commit fe33d38

Browse files
Paolo Abenikuba-moo
authored andcommitted
mptcp: track accurately the incoming MPC suboption type
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>
1 parent 1e777f3 commit fe33d38

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

net/mptcp/options.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ static void mptcp_parse_option(const struct sk_buff *skb,
2626
{
2727
u8 subtype = *ptr >> 4;
2828
int expected_opsize;
29+
u16 subopt;
2930
u8 version;
3031
u8 flags;
3132
u8 i;
@@ -38,11 +39,15 @@ static void mptcp_parse_option(const struct sk_buff *skb,
3839
expected_opsize = TCPOLEN_MPTCP_MPC_ACK_DATA;
3940
else
4041
expected_opsize = TCPOLEN_MPTCP_MPC_ACK;
42+
subopt = OPTION_MPTCP_MPC_ACK;
4143
} else {
42-
if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_ACK)
44+
if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_ACK) {
4345
expected_opsize = TCPOLEN_MPTCP_MPC_SYNACK;
44-
else
46+
subopt = OPTION_MPTCP_MPC_SYNACK;
47+
} else {
4548
expected_opsize = TCPOLEN_MPTCP_MPC_SYN;
49+
subopt = OPTION_MPTCP_MPC_SYN;
50+
}
4651
}
4752

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

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

88-
mp_opt->suboptions |= OPTIONS_MPTCP_MPC;
93+
mp_opt->suboptions |= subopt;
8994
if (opsize >= TCPOLEN_MPTCP_MPC_SYNACK) {
9095
mp_opt->sndr_key = get_unaligned_be64(ptr);
9196
ptr += 8;

0 commit comments

Comments
 (0)