mirror of
https://github.com/apache/nuttx.git
synced 2026-05-18 08:54:05 +08:00
socketcan : fixed CAN ID cast error
args can_id for recv_filter doesn't work properly Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
This commit is contained in:
@@ -344,7 +344,10 @@ static uint16_t can_recvfrom_eventhandler(FAR struct net_driver_s *dev,
|
||||
* when is valid then complete the read action.
|
||||
*/
|
||||
#ifdef CONFIG_NET_CANPROTO_OPTIONS
|
||||
if (can_recv_filter(conn, (canid_t) *dev->d_appdata) == 0)
|
||||
canid_t can_id;
|
||||
memcpy(&can_id, dev->d_appdata, sizeof(canid_t));
|
||||
|
||||
if (can_recv_filter(conn, can_id) == 0)
|
||||
{
|
||||
flags &= ~CAN_NEWDATA;
|
||||
return flags;
|
||||
|
||||
Reference in New Issue
Block a user