linux/net/mptcp
Jason Xing 9633e9377e mptcp: count CLOSE-WAIT sockets for MPTCP_MIB_CURRESTAB
Like previous patch does in TCP, we need to adhere to RFC 1213:

  "tcpCurrEstab OBJECT-TYPE
   ...
   The number of TCP connections for which the current state
   is either ESTABLISHED or CLOSE- WAIT."

So let's consider CLOSE-WAIT sockets.

The logic of counting
When we increment the counter?
a) Only if we change the state to ESTABLISHED.

When we decrement the counter?
a) if the socket leaves ESTABLISHED and will never go into CLOSE-WAIT,
say, on the client side, changing from ESTABLISHED to FIN-WAIT-1.
b) if the socket leaves CLOSE-WAIT, say, on the server side, changing
from CLOSE-WAIT to LAST-ACK.

Fixes: d9cd27b8cd ("mptcp: add CurrEstab MIB counter support")
Signed-off-by: Jason Xing <kernelxing@tencent.com>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-06-05 12:32:47 +01:00
..
bpf.c bpf: Add update_socket_protocol hook 2023-08-16 10:22:16 -07:00
crypto_test.c mptcp: fill in missing MODULE_DESCRIPTION() 2023-12-17 20:54:22 +00:00
crypto.c kunit: mptcp: adhere to KUNIT formatting standard 2021-04-16 17:10:40 -07:00
ctrl.c mptcp: prefer strscpy over strcpy 2024-05-13 18:29:23 -07:00
diag.c mptcp: drop duplicate header inclusions 2024-03-06 20:24:10 -08:00
fastopen.c mptcp: corner case locking for rx path fields initialization 2024-02-12 10:08:13 +00:00
Kconfig kunit: mptcp: adhere to KUNIT formatting standard 2021-04-16 17:10:40 -07:00
Makefile net: mptcp: use policy generated by YAML spec 2023-10-24 13:00:32 -07:00
mib.c mptcp: add CurrEstab MIB counter support 2024-01-02 13:32:45 +00:00
mib.h mptcp: include inet_common in mib.h 2024-05-13 18:29:23 -07:00
mptcp_diag.c mptcp: drop duplicate header inclusions 2024-03-06 20:24:10 -08:00
mptcp_pm_gen.c mptcp: add token for get-addr in yaml 2024-03-04 13:07:45 +00:00
mptcp_pm_gen.h mptcp: add token for get-addr in yaml 2024-03-04 13:07:45 +00:00
options.c mptcp: add last time fields in mptcp_info 2024-04-11 08:19:54 -07:00
pm_netlink.c mptcp: move mptcp_pm_gen.h's include 2024-05-13 18:29:23 -07:00
pm_userspace.c mptcp: move mptcp_pm_gen.h's include 2024-05-13 18:29:23 -07:00
pm.c mptcp: update set_flags interfaces 2024-03-06 20:24:10 -08:00
protocol.c mptcp: count CLOSE-WAIT sockets for MPTCP_MIB_CURRESTAB 2024-06-05 12:32:47 +01:00
protocol.h mptcp: move mptcp_pm_gen.h's include 2024-05-13 18:29:23 -07:00
sched.c mptcp: add net.mptcp.available_schedulers 2024-05-13 18:29:23 -07:00
sockopt.c mptcp: prefer strscpy over strcpy 2024-05-13 18:29:23 -07:00
subflow.c mptcp: remove unnecessary else statements 2024-05-13 18:29:23 -07:00
syncookies.c mptcp: don't return sockets in foreign netns 2021-09-24 10:51:36 +01:00
token_test.c mptcp: token kunit: set protocol 2024-02-26 18:42:12 -08:00
token.c mptcp: add statistics for mptcp socket in use 2023-01-09 07:30:50 +00:00