Skip to contentSkip to conversation

can: add a note that RECV_OWN_MSGS frames are subject to filtering

PATCH In review Erik Flodin 2 participants 2 messages Apr 20, 2021 – Apr 21, 2021

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 can: add a note that RECV_OWN_MSGS frames are subject to filtering

Some parts of the documentation may lead the reader to think that the socket's own frames are always received when CAN_RAW_RECV_OWN_MSGS is enabled, but all frames are subject to filtering.

As explained by Marc Kleine-Budde:

On TX complete of a CAN frame it's pushed into the RX path of the networking stack, along with the information of the originating socket.

Then the CAN frame is delivered into AF_CAN, where it is passed on to all registered receivers depending on filters. One receiver is the sending socket in CAN_RAW. Then in CAN_RAW the it is checked if the sending socket has RECV_OWN_MSGS enabled.

---
 Documentation/networking/can.rst | 2 ++
 1 file changed, 2 insertions(+)
Documentation/networking/can.rst +2 -0
index f8dae662e454..f34cb0e4460e 100644
@@ -608,6 +608,8 @@ demand:
     setsockopt(s, SOL_CAN_RAW, CAN_RAW_RECV_OWN_MSGS,
                &recv_own_msgs, sizeof(recv_own_msgs));
 
+Note that reception of a socket's own CAN frames are subject to the same
+filtering as other CAN frames (see :ref:`socketcan-rawfilter`).
 
 .. _socketcan-rawfd:
 
Signature · 1 line
2.31.0
#1 lore raw
Quoted 9 lines · Erik Flodin

Some parts of the documentation may lead the reader to think that the socket's own frames are always received when CAN_RAW_RECV_OWN_MSGS is enabled, but all frames are subject to filtering.

As explained by Marc Kleine-Budde:

On TX complete of a CAN frame it's pushed into the RX path of the networking stack, along with the information of the originating socket.

Quoted 6 lines

Then the CAN frame is delivered into AF_CAN, where it is passed on to all registered receivers depending on filters. One receiver is the sending socket in CAN_RAW. Then in CAN_RAW the it is checked if the sending socket has RECV_OWN_MSGS enabled.

Applied to linux-can-next/testing

Thanks,
Marc

Signature · 4 lines
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |