mptcp: fix opt size when sending DSS + MP_FAIL
authorMatthieu Baerts <matthieu.baerts@tessares.net>
Thu, 6 Jan 2022 22:06:36 +0000 (14:06 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:03:59 +0000 (11:03 +0100)
commit72aba03ba836c7b72b29cbec1c8ddc61b57edada
tree27f0d5b74928e70284ff606605096555794c3ed3
parentc310df0eabe5667028c2979d93a31a52cf33d0f2
mptcp: fix opt size when sending DSS + MP_FAIL

[ Upstream commit 04fac2cae9422a3401c172571afbcfdd58fa5c7e ]

When these two options had to be sent -- which is not common -- the DSS
size was not being taken into account in the remaining size.

Additionally in this situation, the reported size was only the one of
the MP_FAIL which can cause issue if at the end, we need to write more
in the TCP options than previously said.

Here we use a dedicated variable for MP_FAIL size to keep the
WARN_ON_ONCE() just after.

Fixes: c25aeb4e0953 ("mptcp: MP_FAIL suboption sending")
Acked-and-tested-by: Geliang Tang <geliang.tang@suse.com>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/mptcp/options.c