drivers: ethos: don't error if recv buffer is larger than needed
This commit is contained in:
parent
b1c06be9e4
commit
a833d838b9
@ -297,11 +297,12 @@ static int _recv(netdev2_t *netdev, char* buf, int len, void* info)
|
|||||||
ethos_t * dev = (ethos_t *) netdev;
|
ethos_t * dev = (ethos_t *) netdev;
|
||||||
|
|
||||||
if (buf) {
|
if (buf) {
|
||||||
if (len != dev->last_framesize) {
|
if (len < dev->last_framesize) {
|
||||||
DEBUG("ethos _recv(): unmatched receive buffer size.");
|
DEBUG("ethos _recv(): receive buffer too small.");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
len = dev->last_framesize;
|
||||||
dev->last_framesize = 0;
|
dev->last_framesize = 0;
|
||||||
|
|
||||||
if ((tsrb_get(&dev->inbuf, buf, len) != len)) {
|
if ((tsrb_get(&dev->inbuf, buf, len) != len)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user