Skip to content
Snippets Groups Projects
Unverified Commit 761987ef authored by Koen Zandberg's avatar Koen Zandberg
Browse files

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.
parent b518f3c7
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment