]> git.baikalelectronics.ru Git - kernel.git/commit
mptcp: fix DATA_FIN generation on early shutdown
authorPaolo Abeni <pabeni@redhat.com>
Fri, 19 Feb 2021 17:35:38 +0000 (18:35 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 23 Feb 2021 02:54:59 +0000 (18:54 -0800)
commitcc45879ec7e5fa36ebb30c1d1cc8423ea18e5ff4
treee5741937bb90702865731a4ed45be7fc08e8b859
parent07f43d9ed054859d1826492c8772493fb027c28a
mptcp: fix DATA_FIN generation on early shutdown

If the msk is closed before sending or receiving any data,
no DATA_FIN is generated, instead an MPC ack packet is
crafted out.

In the above scenario, the MPTCP protocol creates and sends a
pure ack and such packets matches also the criteria for an
MPC ack and the protocol tries first to insert MPC options,
leading to the described error.

This change addresses the issue by avoiding the insertion of an
MPC option for DATA_FIN packets or if the sub-flow is not
established.

To avoid doing multiple times the same test, fetch the data_fin
flag in a bool variable and pass it to both the interested
helpers.

Fixes: 9689c66bea9f ("mptcp: Write MPTCP DSS headers to outgoing data packets")
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/options.c