ethos: Add drop frame case to recv function
The ethos driver does not drop the received frame if the recv function is called with NULL buffer and with a length. This commit fixes that.
This commit is contained in:
parent
b518f3c73e
commit
761987ef0d
@ -314,7 +314,14 @@ static int _recv(netdev_t *netdev, void *buf, size_t len, void* info)
|
|||||||
return (int)len;
|
return (int)len;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return dev->last_framesize;
|
if (len) {
|
||||||
|
int dropsize = dev->last_framesize;
|
||||||
|
dev->last_framesize = 0;
|
||||||
|
return tsrb_drop(&dev->inbuf, dropsize);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return dev->last_framesize;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user