Skip to content

Commit

Permalink
net: mptcp: make DACK4/DACK8 usage consistent among all subflows
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Davide Caratti <[email protected]>
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
dcaratti authored and kuba-moo committed Oct 9, 2020
1 parent 0da1ccb commit 37198e9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion net/mptcp/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,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;
Expand Down
2 changes: 1 addition & 1 deletion net/mptcp/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,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 list_head conn_list;
Expand Down Expand Up @@ -294,7 +295,6 @@ struct mptcp_subflow_context {
backup : 1,
data_avail : 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 */
u32 remote_nonce;
u64 thmac;
Expand Down
3 changes: 1 addition & 2 deletions net/mptcp/subflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,12 +769,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 */
Expand Down

0 comments on commit 37198e9

Please sign in to comment.