mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +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.
|
* when is valid then complete the read action.
|
||||||
*/
|
*/
|
||||||
#ifdef CONFIG_NET_CANPROTO_OPTIONS
|
#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;
|
flags &= ~CAN_NEWDATA;
|
||||||
return flags;
|
return flags;
|
||||||
|
|||||||
Reference in New Issue
Block a user