Skip to content

Commit 255cc75

Browse files
dcarattigregkh
authored andcommitted
net: mptcp: make DACK4/DACK8 usage consistent among all subflows
[ Upstream commit 37198e9 ] using packetdrill it's possible to observe the same MPTCP DSN being acked by different subflows with DACK4 and DACK8. This is in contrast with what specified in RFC8684 §3.3.2: if an MPTCP endpoint transmits a 64-bit wide DSN, it MUST be acknowledged with a 64-bit wide DACK. Fix 'use_64bit_ack' variable to make it a property of MPTCP sockets, not TCP subflows. Fixes: a0c1d0e ("mptcp: Use 32-bit DATA_ACK when possible") Acked-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Davide Caratti <dcaratti@redhat.com> Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 35fe974 commit 255cc75

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

net/mptcp/options.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb,
516516
return ret;
517517
}
518518

519-
if (subflow->use_64bit_ack) {
519+
if (READ_ONCE(msk->use_64bit_ack)) {
520520
ack_size = TCPOLEN_MPTCP_DSS_ACK64;
521521
opts->ext_copy.data_ack = READ_ONCE(msk->ack_seq);
522522
opts->ext_copy.ack64 = 1;

net/mptcp/protocol.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ struct mptcp_sock {
203203
bool fully_established;
204204
bool rcv_data_fin;
205205
bool snd_data_fin_enable;
206+
bool use_64bit_ack; /* Set when we received a 64-bit DSN */
206207
spinlock_t join_list_lock;
207208
struct work_struct work;
208209
struct list_head conn_list;
@@ -295,7 +296,6 @@ struct mptcp_subflow_context {
295296
backup : 1,
296297
data_avail : 1,
297298
rx_eof : 1,
298-
use_64bit_ack : 1, /* Set when we received a 64-bit DSN */
299299
can_ack : 1; /* only after processing the remote a key */
300300
u32 remote_nonce;
301301
u64 thmac;

net/mptcp/subflow.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -781,12 +781,11 @@ static enum mapping_status get_mapping_status(struct sock *ssk,
781781
if (!mpext->dsn64) {
782782
map_seq = expand_seq(subflow->map_seq, subflow->map_data_len,
783783
mpext->data_seq);
784-
subflow->use_64bit_ack = 0;
785784
pr_debug("expanded seq=%llu", subflow->map_seq);
786785
} else {
787786
map_seq = mpext->data_seq;
788-
subflow->use_64bit_ack = 1;
789787
}
788+
WRITE_ONCE(mptcp_sk(subflow->conn)->use_64bit_ack, !!mpext->dsn64);
790789

791790
if (subflow->map_valid) {
792791
/* Allow replacing only with an identical map */

0 commit comments

Comments
 (0)