mptcp: Only send DATA_FIN with final mapping
authorMat Martineau <mathew.j.martineau@linux.intel.com>
Fri, 28 Feb 2020 23:47:41 +0000 (15:47 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Mar 2020 01:01:43 +0000 (17:01 -0800)
commit6d37a0b857c34e63764b127728b58444ac9e3f25
tree65ee8ebdaaab8b8de5e14e8212ecf0a34c235990
parent76c42a29c0eb15ea3fdc9867a0a52e53fb4fbd76
mptcp: Only send DATA_FIN with final mapping

When a DATA_FIN is sent in a MPTCP DSS option that contains a data
mapping, the DATA_FIN consumes one byte of space in the mapping. In this
case, the DATA_FIN should only be included in the DSS option if its
sequence number aligns with the end of the mapped data. Otherwise the
subflow can send an incorrect implicit sequence number for the DATA_FIN,
and the DATA_ACK for that sequence number would not close the
MPTCP-level connection correctly.

Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mptcp/options.c