aboutsummaryrefslogtreecommitdiffstats
path: root/net/mptcp/options.c
diff options
context:
space:
mode:
authorMatthieu Baerts <[email protected]>2020-10-03 15:36:56 +0000
committerDavid S. Miller <[email protected]>2020-10-04 00:36:37 +0000
commit456afe01b10085518406022c69cfd2b718d6eaf8 (patch)
tree0dedcb7f27912743dbbeb007bc07f10ce32c9198 /net/mptcp/options.c
parentdt-bindings: net: dsa: b53: Fix full duplex in example (diff)
downloadkernel-456afe01b10085518406022c69cfd2b718d6eaf8.tar.gz
kernel-456afe01b10085518406022c69cfd2b718d6eaf8.zip
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: 6a6c05a8b016 ("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 <[email protected]> Acked-by: Geliang Tang <[email protected]> Signed-off-by: Matthieu Baerts <[email protected]> Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/mptcp/options.c')
-rw-r--r--net/mptcp/options.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 411fd4a41796..03794f89efeb 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -587,7 +587,7 @@ static bool mptcp_established_options_add_addr(struct sock *sk,
!(mptcp_pm_add_addr_signal(msk, remaining, &saddr, &echo)))
return false;
- len = mptcp_add_addr_len(saddr.family);
+ len = mptcp_add_addr_len(saddr.family, echo);
if (remaining < len)
return false;