aboutsummaryrefslogtreecommitdiff
path: root/net/mptcp/protocol.c
diff options
context:
space:
mode:
authorGravatar Paolo Abeni <pabeni@redhat.com> 2021-08-26 17:44:52 -0700
committerGravatar David S. Miller <davem@davemloft.net> 2021-08-27 09:45:07 +0100
commit74c7dfbee3e185b3c3a03f194e25689ed037fa3c (patch)
treedc45f79abe722e5809c9e6299b2da18dc3081e2b /net/mptcp/protocol.c
parentmptcp: better binary layout for mptcp_options_received (diff)
downloadlinux-74c7dfbee3e185b3c3a03f194e25689ed037fa3c.tar.gz
linux-74c7dfbee3e185b3c3a03f194e25689ed037fa3c.tar.bz2
linux-74c7dfbee3e185b3c3a03f194e25689ed037fa3c.zip
mptcp: consolidate in_opt sub-options fields in a bitmask
This makes input options processing more consistent with output ones and will simplify the next patch. Also avoid clearing the suboption field after processing it, since it's not needed. Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mptcp/protocol.c')
-rw-r--r--net/mptcp/protocol.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 22214a58d892..1a408395e78f 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -2832,7 +2832,7 @@ struct sock *mptcp_sk_clone(const struct sock *sk,
msk->token = subflow_req->token;
msk->subflow = NULL;
WRITE_ONCE(msk->fully_established, false);
- if (mp_opt->csum_reqd)
+ if (mp_opt->suboptions & OPTION_MPTCP_CSUMREQD)
WRITE_ONCE(msk->csum_enabled, true);
msk->write_seq = subflow_req->idsn + 1;
@@ -2841,7 +2841,7 @@ struct sock *mptcp_sk_clone(const struct sock *sk,
msk->wnd_end = msk->snd_nxt + req->rsk_rcv_wnd;
msk->setsockopt_seq = mptcp_sk(sk)->setsockopt_seq;
- if (mp_opt->mp_capable) {
+ if (mp_opt->suboptions & OPTIONS_MPTCP_MPC) {
msk->can_ack = true;
msk->remote_key = mp_opt->sndr_key;
mptcp_crypto_key_sha(msk->remote_key, NULL, &ack_seq);