Commit Graph

9 Commits (d66295ee75c42a42119bb741676b5c77dbb4af6f)

Author SHA1 Message Date
Oleksij Rempel 7337cb12de j1939: drop SO_J1939_RECV_OWN support
SO_J1939_RECV_OWN is no longer supported by the kernel. So, sync the
headers and rework jacd.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
2019-08-26 11:03:36 +02:00
Yegor Yefremov 7b7331976a Add SPDX identifiers
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2019-06-19 12:24:24 +02:00
Oleksij Rempel 7192b0b9d7 jacd: set SO_BROADCAST
with latest UAPI version we should set this flag to be allowed to send
broadcast frames with broadcast destination address. Even if on CAN
every thing is a broadcast...

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-04-04 10:37:52 +02:00
Oleksij Rempel b8a2fa319a jacd: use sendto instead of send
Accordint to the new UAPI version, bind() with PGN set, should not be used
for destination PGN.

This change should work with new and old version of UAPI.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-04-04 10:37:49 +02:00
Oleksij Rempel 314f8a92ae j1939: use defines instead of magic values
for now cover most of PGN values.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2019-04-04 10:37:39 +02:00
Yegor Yefremov 1ce4dc7b39 Add missing return value checks
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2018-09-18 13:43:29 +02:00
Bastian Stender cf039f14fb jacd: provide interface index while opening socket and address claiming
This is a direct consequence of not allowing bind to any device
("3cb6a1204598 j1939: socket: bind() cleanups"), i.e. can_ifindex == 0.
This means before this change jacd would receive from any interface that
was opened by another program.

Without this patch jacd fails with:

  acd: bind(): No such device

A more verbose call shows the missing interface:

$ jacd -v 1122334455667788
jacd: ready for can0:1122334455667788
- socket(PF_CAN, SOCK_DGRAM, CAN_J1939);
- setsockopt(, SOL_SOCKET, SO_BINDTODEVICE, can0, 4);
- setsockopt(, SOL_CAN_J1939, SO_J1939_FILTER, <filter>, 84);
- setsockopt(, SOL_CAN_J1939, SO_J1939_RECV_OWN, 1, 4);
- bind(, :fe,0ee00,1122334455667788, 24);
jacd: bind(): No such device

Signed-off-by: Bastian Stender <bst@pengutronix.de>
2018-01-22 14:12:44 +01:00
Bastian Stender 6133ac94f0 jacd: print relevant API calls on verbose
The output is now comparable to testj1939's -v output.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
2018-01-22 14:12:44 +01:00
Kurt Van Dijck 58c44ea3c4 can-j1939: add jacd address claim daemon
The can-j1939 kernel part only follows & validates inbound & outbound
address claim packets. Jacd implements the part that chooses an address
and emits the address claim packet.

Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2018-01-18 13:13:31 +01:00