mptcp: ADD_ADDRs with echo bit are smaller
The MPTCP ADD_ADDR suboption with echo-flag=1 has no HMAC, the size is
smaller than the one initially sent without echo-flag=1. We then need to
use the correct size everywhere when we need this echo bit.
Before this patch, the wrong size was reserved but the correct amount of
bytes were written (and read): the remaining bytes contained garbage.
Fixes: 6a6c05a8b0 ("mptcp: send out ADD_ADDR with echo flag")
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/95
Reported-and-tested-by: Davide Caratti <dcaratti@redhat.com>
Acked-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
3a56268ef6
commit
456afe01b1
@@ -183,11 +183,12 @@ bool mptcp_pm_add_addr_signal(struct mptcp_sock *msk, unsigned int remaining,
|
||||
if (!mptcp_pm_should_add_signal(msk))
|
||||
goto out_unlock;
|
||||
|
||||
if (remaining < mptcp_add_addr_len(msk->pm.local.family))
|
||||
*echo = READ_ONCE(msk->pm.add_addr_echo);
|
||||
|
||||
if (remaining < mptcp_add_addr_len(msk->pm.local.family, *echo))
|
||||
goto out_unlock;
|
||||
|
||||
*saddr = msk->pm.local;
|
||||
*echo = READ_ONCE(msk->pm.add_addr_echo);
|
||||
WRITE_ONCE(msk->pm.add_addr_signal, false);
|
||||
ret = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user