diff options
author | Davide Caratti <dcaratti@redhat.com> | 2025-03-14 12:39:49 +0100 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2025-03-14 13:27:33 +0100 |
commit | 6bffe88452dbe284747442f10a7ac8249d6495d7 (patch) | |
tree | b5f16442957fe1ae7a3048cbfa3cf06f087c28c6 /net/can/isotp.c | |
parent | 958ee3d715773d88e5d85c36311ef458d6b352a2 (diff) |
can: add protocol counter for AF_CAN sockets
The third column in the output of the following command:
| # grep CAN /proc/net/protocols
is systematically '0': use sock_prot_inuse_add() to account for the number
of sockets for each protocol on top of AF_CAN family.
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Link: https://patch.msgid.link/9db5d0e6c11b232ad895885616f1258882a32f61.1741952160.git.dcaratti@redhat.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'net/can/isotp.c')
-rw-r--r-- | net/can/isotp.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/can/isotp.c b/net/can/isotp.c index 16046931542a..789583c62f98 100644 --- a/net/can/isotp.c +++ b/net/can/isotp.c @@ -1239,6 +1239,7 @@ static int isotp_release(struct socket *sock) sock->sk = NULL; release_sock(sk); + sock_prot_inuse_add(net, sk->sk_prot, -1); sock_put(sk); return 0; |