Re: [PATCH] can: add protocol counter for AF_CAN sockets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 17.03.25 10:20, Marc Kleine-Budde wrote:
On 16.03.2025 13:39:16, Oliver Hartkopp wrote:


On 14.03.25 13:31, Marc Kleine-Budde wrote:
On 14.03.2025 12:39:49, Davide Caratti wrote:
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@xxxxxxxxxx>

Applied to linux-can-next.


Maybe too fast? E.g. J1939 is not handled.

https://lore.kernel.org/linux-can/78951192-82b1-45bc-9903-d314c94cd182@xxxxxxxxxxxx/T/#m87afc41fef8ec9099344c753e32b06f302cc0e39

Can IMHO  be added in a later patch.

Sure?

can_create() creates all CAN sockets, right?

With this patch the sock_prot_inuse_add() increases the counter by one for every CAN socket.

But only RAW/BCM/ISOTP are decrementing the prot-in-use counter when removing the socket.

IMO this patch introduces a bug.

Best regards,
Oliver





[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux