Commit 390b95a5 authored by Geliang Tang's avatar Geliang Tang Committed by David S. Miller

mptcp: receive checksum for DSS

In mptcp_parse_option, adjust the expected_opsize, and always parse the
data checksum value from the receiving DSS regardless of csum presence.
Then save it in mp_opt->csum.
Co-developed-by: default avatarPaolo Abeni <pabeni@redhat.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
Signed-off-by: default avatarGeliang Tang <geliangtang@gmail.com>
Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 208e8f66
...@@ -182,10 +182,8 @@ static void mptcp_parse_option(const struct sk_buff *skb, ...@@ -182,10 +182,8 @@ static void mptcp_parse_option(const struct sk_buff *skb,
expected_opsize += TCPOLEN_MPTCP_DSS_MAP32; expected_opsize += TCPOLEN_MPTCP_DSS_MAP32;
} }
/* RFC 6824, Section 3.3: /* Always parse any csum presence combination, we will enforce
* If a checksum is present, but its use had * RFC 8684 Section 3.3.0 checks later in subflow_data_ready
* not been negotiated in the MP_CAPABLE handshake,
* the checksum field MUST be ignored.
*/ */
if (opsize != expected_opsize && if (opsize != expected_opsize &&
opsize != expected_opsize + TCPOLEN_MPTCP_DSS_CHECKSUM) opsize != expected_opsize + TCPOLEN_MPTCP_DSS_CHECKSUM)
...@@ -220,9 +218,15 @@ static void mptcp_parse_option(const struct sk_buff *skb, ...@@ -220,9 +218,15 @@ static void mptcp_parse_option(const struct sk_buff *skb,
mp_opt->data_len = get_unaligned_be16(ptr); mp_opt->data_len = get_unaligned_be16(ptr);
ptr += 2; ptr += 2;
pr_debug("data_seq=%llu subflow_seq=%u data_len=%u", if (opsize == expected_opsize + TCPOLEN_MPTCP_DSS_CHECKSUM) {
mp_opt->csum_reqd = 1;
mp_opt->csum = (__force __sum16)get_unaligned_be16(ptr);
ptr += 2;
}
pr_debug("data_seq=%llu subflow_seq=%u data_len=%u csum=%d:%u",
mp_opt->data_seq, mp_opt->subflow_seq, mp_opt->data_seq, mp_opt->subflow_seq,
mp_opt->data_len); mp_opt->data_len, mp_opt->csum_reqd, mp_opt->csum);
} }
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment