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:
haitomatic
2024-03-12 11:13:19 +02:00
committed by Xiang Xiao
parent e2b1d186d7
commit 8fc2ad20a7
+4
View File
@@ -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