can: gw: give feedback on missing CGW_FLAGS_CAN_IIF_TX_OK flag
Subsystems (2)
Oliver Hartkopp
maintainerPATCH 1/1 can: gw: give feedback on missing CGW_FLAGS_CAN_IIF_TX_OK flag
To send CAN traffic back to the incoming interface a special flag has to be set. When creating a routing job for identical interfaces without this flag the rule is created but has no effect.
This patch adds an error return value in the case that the CAN interfaces are identical but the CGW_FLAGS_CAN_IIF_TX_OK flag was not set.
--- net/can/gw.c | 7 +++++++ 1 file changed, 7 insertions(+)
net/can/gw.c +7 -0
@@ -1137,10 +1137,17 @@ static int cgw_create_job(struct sk_buff *skb, struct nlmsghdr *nlh, goto out;if (gwj->dst.dev->type !=ARPHRD_CAN ) goto out; +/* is sending the skb back to the incoming interface intended? */ +if (gwj->src.dev == gwj->dst.dev && + !(gwj->flags &CGW_FLAGS_CAN_IIF_TX_OK )) { + err = -EINVAL ; + goto out; + } +ASSERT_RTNL (); err =cgw_register_filter (net, gwj);if (!err)hlist_add_head_rcu (&gwj->list, &net->can.cgw_list);
Signature · 1 line
2.30.2
Quoted 9 lines · Oliver Hartkopp
To send CAN traffic back to the incoming interface a special flag has to be set. When creating a routing job for identical interfaces without this flag the rule is created but has no effect.
This patch adds an error return value in the case that the CAN interfaces are identical but the
CGW_FLAGS_CAN_IIF_TX_OKflag was not set.Reported-by Jannik Hartung <[email protected]>Signed-off-by Oliver Hartkopp <[email protected]>
Applied to can-next.
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 |