From cbf2d0603dacc0cc72d94ba1edbc0d55d3cd7388 Mon Sep 17 00:00:00 2001 From: YonglongLi Date: Thu, 23 May 2024 15:56:34 +0800 Subject: [PATCH] mptcp: make RMADDR MIB counter clearly it should inc RMADDR MIB counter when received RMADDR but didn't find any subflow related, Fixes: 7a7e52e38a40 ("mptcp: add RM_ADDR related mibs") Signed-off-by: YonglongLi --- net/mptcp/pm_netlink.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 7f53e022e27ece..766a8409fa6779 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -814,10 +814,13 @@ static void mptcp_pm_nl_rm_addr_or_subflow(struct mptcp_sock *msk, spin_lock_bh(&msk->pm.lock); removed = true; - __MPTCP_INC_STATS(sock_net(sk), rm_type); + if (rm_type == MPTCP_MIB_RMSUBFLOW) + __MPTCP_INC_STATS(sock_net(sk), rm_type); } if (rm_type == MPTCP_MIB_RMSUBFLOW) __set_bit(rm_id ? rm_id : msk->mpc_endpoint_id, msk->pm.id_avail_bitmap); + else if (rm_type == MPTCP_MIB_RMADDR) + __MPTCP_INC_STATS(sock_net(sk), rm_type); if (!removed) continue;