corrected example to accurately reflect sockaddr_can structure

example code incorrectly accesses the `tp` field and will not build.
This commit is contained in:
BryceKarlins 2024-09-13 17:51:54 -05:00 committed by GitHub
parent b7718454f9
commit f41166226d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -369,8 +369,8 @@ to their default.
addr.can_family = AF_CAN;
addr.can_ifindex = if_nametoindex("can0");
addr.tp.tx_id = 0x18DA42F1 | CAN_EFF_FLAG;
addr.tp.rx_id = 0x18DAF142 | CAN_EFF_FLAG;
addr.can_addr.tp.tx_id = 0x18DA42F1 | CAN_EFF_FLAG;
addr.can_addr.tp.rx_id = 0x18DAF142 | CAN_EFF_FLAG;
ret = bind(s, (struct sockaddr *)&addr, sizeof(addr));
if (ret < 0)