mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 21:34:07 +08:00
net/can/can_callback.c: Take the timestamp size into account in "buflen"
In case CONFIG_NET_TIMESTAMP is enabled, subtract the timestamp size from the buflen Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
This commit is contained in:
@@ -68,6 +68,10 @@ can_data_event(FAR struct net_driver_s *dev, FAR struct can_conn_s *conn,
|
||||
uint16_t recvlen;
|
||||
uint16_t ret;
|
||||
|
||||
#ifdef CONFIG_NET_TIMESTAMP
|
||||
buflen -= sizeof(struct timeval);
|
||||
#endif
|
||||
|
||||
ret = (flags & ~CAN_NEWDATA);
|
||||
|
||||
/* Save as the packet data as in the read-ahead buffer. NOTE that
|
||||
|
||||
Reference in New Issue
Block a user