You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "xucheng5 (via GitHub)" <gi...@apache.org> on 2023/08/18 11:32:56 UTC

[GitHub] [nuttx] xucheng5 commented on a diff in pull request #10279: socketcan : fixed CAN ID cast error

xucheng5 commented on code in PR #10279:
URL: https://github.com/apache/nuttx/pull/10279#discussion_r1298346971


##########
net/can/can_recvmsg.c:
##########
@@ -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;

Review Comment:
   > Maybe we can reconstruct can-id by shit and or operations instead of memcpy?
   
   like this : 
   canid_t can_id = dev->d_appdata[0] << 24  |  
                              dev->d_appdata[1] << 16  | 
                              dev->d_appdata[2] << 8    | 
                              dev->d_appdata[2] 
   ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org