prevent can from parsing partial frames
This commit is contained in:
parent
4dbf6d4d3d
commit
d44ecffb41
@ -120,6 +120,8 @@ void read_can(Tel *t, int soc) {
|
|||||||
|
|
||||||
if (nbytes < 0) return; // -1 EAGAIN means empty
|
if (nbytes < 0) return; // -1 EAGAIN means empty
|
||||||
|
|
||||||
|
if (nbytes != sizeof(struct can_frame)) return;
|
||||||
|
|
||||||
if (nbytes > 0) {
|
if (nbytes > 0) {
|
||||||
|
|
||||||
switch (frame.can_id) {
|
switch (frame.can_id) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user