Skip to content

Commit 37198e9

Browse files
dcarattikuba-moo
authored andcommitted
net: mptcp: make DACK4/DACK8 usage consistent among all subflows
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>
1 parent 0da1ccb commit 37198e9

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

‎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
@@ -202,6 +202,7 @@ struct mptcp_sock {
202202
bool fully_established;
203203
bool rcv_data_fin;
204204
bool snd_data_fin_enable;
205+
bool use_64bit_ack; /* Set when we received a 64-bit DSN */
205206
spinlock_t join_list_lock;
206207
struct work_struct work;
207208
struct list_head conn_list;
@@ -294,7 +295,6 @@ struct mptcp_subflow_context {
294295
backup : 1,
295296
data_avail : 1,
296297
rx_eof : 1,
297-
use_64bit_ack : 1, /* Set when we received a 64-bit DSN */
298298
can_ack : 1; /* only after processing the remote a key */
299299
u32 remote_nonce;
300300
u64 thmac;

‎net/mptcp/subflow.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,12 +769,11 @@ static enum mapping_status get_mapping_status(struct sock *ssk,
769769
if (!mpext->dsn64) {
770770
map_seq = expand_seq(subflow->map_seq, subflow->map_data_len,
771771
mpext->data_seq);
772-
subflow->use_64bit_ack = 0;
773772
pr_debug("expanded seq=%llu", subflow->map_seq);
774773
} else {
775774
map_seq = mpext->data_seq;
776-
subflow->use_64bit_ack = 1;
777775
}
776+
WRITE_ONCE(mptcp_sk(subflow->conn)->use_64bit_ack, !!mpext->dsn64);
778777

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

0 commit comments

Comments
 (0)