Skip to content
Snippets Groups Projects
Commit 3636a4a3 authored by Martine Lenders's avatar Martine Lenders Committed by GitHub
Browse files

Merge pull request #6765 from OlegHahm/lwip_fix_assert

pkg: lwip: do not panic on failing netdev->recv()
parents c72aec26 409183d9
No related branches found
No related tags found
No related merge requests found
...@@ -215,6 +215,10 @@ static struct pbuf *_get_recv_pkt(netdev_t *dev) ...@@ -215,6 +215,10 @@ static struct pbuf *_get_recv_pkt(netdev_t *dev)
{ {
int len = dev->driver->recv(dev, _tmp_buf, sizeof(_tmp_buf), NULL); int len = dev->driver->recv(dev, _tmp_buf, sizeof(_tmp_buf), NULL);
if (len < 0) {
DEBUG("lwip_netdev: an error occurred while reading the packet\n");
return NULL;
}
assert(((unsigned)len) <= UINT16_MAX); assert(((unsigned)len) <= UINT16_MAX);
struct pbuf *p = pbuf_alloc(PBUF_RAW, (u16_t)len, PBUF_POOL); struct pbuf *p = pbuf_alloc(PBUF_RAW, (u16_t)len, PBUF_POOL);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment