Commit Graph

4 Commits (4a1818aa55fdebc861137d82ceda869585d3210c)

Author SHA1 Message Date
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