diff --git a/net/mptcp/options.c b/net/mptcp/options.c index 796f5dcad6e5e..092a2d48bfd3e 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -517,7 +517,7 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb, return ret; } - if (subflow->use_64bit_ack) { + if (READ_ONCE(msk->use_64bit_ack)) { ack_size = TCPOLEN_MPTCP_DSS_ACK64; opts->ext_copy.data_ack = READ_ONCE(msk->ack_seq); opts->ext_copy.ack64 = 1; diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index 551cb2afa10d7..fd0417b6c9b6a 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -212,6 +212,7 @@ struct mptcp_sock { bool fully_established; bool rcv_data_fin; bool snd_data_fin_enable; + bool use_64bit_ack; /* Set when we received a 64-bit DSN */ spinlock_t join_list_lock; struct work_struct work; struct sk_buff *ooo_last_skb; @@ -311,7 +312,6 @@ struct mptcp_subflow_context { mpc_map : 1, backup : 1, rx_eof : 1, - use_64bit_ack : 1, /* Set when we received a 64-bit DSN */ can_ack : 1; /* only after processing the remote a key */ enum mptcp_data_avail data_avail; u32 remote_nonce; diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index a69e7ee9d6cb4..ac4a1fe3550bd 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -782,12 +782,11 @@ static enum mapping_status get_mapping_status(struct sock *ssk, if (!mpext->dsn64) { map_seq = expand_seq(subflow->map_seq, subflow->map_data_len, mpext->data_seq); - subflow->use_64bit_ack = 0; pr_debug("expanded seq=%llu", subflow->map_seq); } else { map_seq = mpext->data_seq; - subflow->use_64bit_ack = 1; } + WRITE_ONCE(mptcp_sk(subflow->conn)->use_64bit_ack, !!mpext->dsn64); if (subflow->map_valid) { /* Allow replacing only with an identical map */