mirror of
https://github.com/linux-can/can-utils.git
synced 2026-08-05 06:20:00 +02:00
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>
This commit is contained in:
committed by
Marc Kleine-Budde
parent
b8a2fa319a
commit
7192b0b9d7
@@ -228,6 +228,14 @@ static int open_socket(const char *device, uint64_t name)
|
||||
if (ret < 0)
|
||||
error(1, errno, "setsockopt receive own msgs");
|
||||
|
||||
value = 1;
|
||||
if (s.verbose)
|
||||
fprintf(stderr, "- setsockopt(, SOL_SOCKET, SO_BROADCAST, %d, %zd);\n", value, sizeof(value));
|
||||
ret = setsockopt(sock, SOL_SOCKET, SO_BROADCAST,
|
||||
&value, sizeof(value));
|
||||
if (ret < 0)
|
||||
error(1, errno, "setsockopt set broadcast");
|
||||
|
||||
if (s.verbose)
|
||||
fprintf(stderr, "- bind(, %s, %zi);\n", libj1939_addr2str(&saddr), sizeof(saddr));
|
||||
ret = bind(sock, (void *)&saddr, sizeof(saddr));
|
||||
|
||||
Reference in New Issue
Block a user