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>
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>
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>
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>