mptcp: Handle incoming 32-bit DATA_FIN values
The peer may send a DATA_FIN mapping with either a 32-bit or 64-bit
sequence number. When a 32-bit sequence number is received for the
DATA_FIN, it must be expanded to 64 bits before comparing it to the
last acked sequence number. This expansion was missing.
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/93
Fixes: 3721b9b646
("mptcp: Track received DATA_FIN sequence number and add related helpers")
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
917944da3b
commit
1a49b2c2a5
@@ -731,7 +731,8 @@ static enum mapping_status get_mapping_status(struct sock *ssk,
|
||||
|
||||
if (mpext->data_fin == 1) {
|
||||
if (data_len == 1) {
|
||||
bool updated = mptcp_update_rcv_data_fin(msk, mpext->data_seq);
|
||||
bool updated = mptcp_update_rcv_data_fin(msk, mpext->data_seq,
|
||||
mpext->dsn64);
|
||||
pr_debug("DATA_FIN with no payload seq=%llu", mpext->data_seq);
|
||||
if (subflow->map_valid) {
|
||||
/* A DATA_FIN might arrive in a DSS
|
||||
@@ -748,8 +749,17 @@ static enum mapping_status get_mapping_status(struct sock *ssk,
|
||||
return MAPPING_DATA_FIN;
|
||||
}
|
||||
} else {
|
||||
mptcp_update_rcv_data_fin(msk, mpext->data_seq + data_len);
|
||||
pr_debug("DATA_FIN with mapping seq=%llu", mpext->data_seq + data_len);
|
||||
u64 data_fin_seq = mpext->data_seq + data_len;
|
||||
|
||||
/* If mpext->data_seq is a 32-bit value, data_fin_seq
|
||||
* must also be limited to 32 bits.
|
||||
*/
|
||||
if (!mpext->dsn64)
|
||||
data_fin_seq &= GENMASK_ULL(31, 0);
|
||||
|
||||
mptcp_update_rcv_data_fin(msk, data_fin_seq, mpext->dsn64);
|
||||
pr_debug("DATA_FIN with mapping seq=%llu dsn64=%d",
|
||||
data_fin_seq, mpext->dsn64);
|
||||
}
|
||||
|
||||
/* Adjust for DATA_FIN using 1 byte of sequence space */
|
||||
|
Reference in New Issue
Block a user