mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
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;
|
||||
}
|
||||
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…
Reference in New Issue
Block a user