can: bcm: add recvmsg flags for own, local and remote traffic
authorNicolas Maier <nicolas.maier.dev@gmail.com>
Sat, 20 Jan 2024 08:10:18 +0000 (09:10 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 12 Feb 2024 15:55:17 +0000 (16:55 +0100)
commitfec846fa7eddf7bb651bf88bd78c7db1410ae3b1
tree4e8d090eb94914f01777cd65420040a14f69d6ae
parent970cb1ceda170a3e583a5f26afdbebdfe5bf5a80
can: bcm: add recvmsg flags for own, local and remote traffic

CAN RAW sockets allow userspace to tell if a received CAN frame comes
from the same socket, another socket on the same host, or another host.
See commit 1e55659ce6dd ("can-raw: add msg_flags to distinguish local
traffic"). However, this feature is missing in CAN BCM sockets.

Add the same feature to CAN BCM sockets. When reading a received frame
(opcode RX_CHANGED) using recvmsg, two flags in msg->msg_flags may be
set following the previous convention (from CAN RAW), to distinguish
between 'own', 'local' and 'remote' CAN traffic.

Update the documentation to reflect this change.

Signed-off-by: Nicolas Maier <nicolas.maier.dev@gmail.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://lore.kernel.org/all/20240120081018.2319-1-socketcan@hartkopp.net
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Documentation/networking/can.rst
net/can/bcm.c