From: Paolo Abeni pabeni@redhat.com
commit 0c1f78a49af721490a5ad70b73e8b4d382465dae upstream.
The current accounting for MP_FAIL and FASTCLOSE is not very accurate: both can be increased even when the related option is not really sent. Move the accounting into the correct place.
Fixes: eb7f33654dc1 ("mptcp: add the mibs for MP_FAIL") Fixes: 1e75629cb964 ("mptcp: add the mibs for MP_FASTCLOSE") Signed-off-by: Paolo Abeni pabeni@redhat.com Signed-off-by: Mat Martineau mathew.j.martineau@linux.intel.com Signed-off-by: Jakub Kicinski kuba@kernel.org [ Conflicts, because commit f284c0c77321 ("mptcp: implement fastclose xmit path") is not in this version. That's OK, the new helper added by this commit doesn't need to be modified. ] Signed-off-by: Matthieu Baerts (NGI0) matttbe@kernel.org --- net/mptcp/options.c | 1 + net/mptcp/subflow.c | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/mptcp/options.c b/net/mptcp/options.c index d1443c5732c8..501c818bf7dc 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -793,6 +793,7 @@ static bool mptcp_established_options_mp_fail(struct sock *sk, opts->fail_seq = subflow->map_seq;
pr_debug("MP_FAIL fail_seq=%llu\n", opts->fail_seq); + MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_MPFAILTX);
return true; } diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index 2bf7f65b0afe..6a7c48397e3d 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -963,10 +963,8 @@ static enum mapping_status validate_data_csum(struct sock *ssk, struct sk_buff * subflow->map_data_csum); if (unlikely(csum)) { MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_DATACSUMERR); - if (subflow->mp_join || subflow->valid_csum_seen) { + if (subflow->mp_join || subflow->valid_csum_seen) subflow->send_mp_fail = 1; - MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_MPFAILTX); - } return subflow->mp_join ? MAPPING_INVALID : MAPPING_DUMMY; }