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
@ -313,10 +313,17 @@ static int _recv(netdev_t *netdev, void *buf, size_t len, void* info)
|
|||||||
|
|
||||||
return (int)len;
|
return (int)len;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if (len) {
|
||||||
|
int dropsize = dev->last_framesize;
|
||||||
|
dev->last_framesize = 0;
|
||||||
|
return tsrb_drop(&dev->inbuf, dropsize);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
return dev->last_framesize;
|
return dev->last_framesize;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int _get(netdev_t *dev, netopt_t opt, void *value, size_t max_len)
|
static int _get(netdev_t *dev, netopt_t opt, void *value, size_t max_len)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user