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

gnrc_netif_ieee802154: drop frame on buffer error

This adds a netdev recv call to indicate that the received frame should be
dropped when there is no buffer space available to store the frame.
parent 2df6da25
No related branches found
No related tags found
No related merge requests found
...@@ -88,6 +88,8 @@ static gnrc_pktsnip_t *_recv(gnrc_netif_t *netif) ...@@ -88,6 +88,8 @@ static gnrc_pktsnip_t *_recv(gnrc_netif_t *netif)
pkt = gnrc_pktbuf_add(NULL, NULL, bytes_expected, GNRC_NETTYPE_UNDEF); pkt = gnrc_pktbuf_add(NULL, NULL, bytes_expected, GNRC_NETTYPE_UNDEF);
if (pkt == NULL) { if (pkt == NULL) {
DEBUG("_recv_ieee802154: cannot allocate pktsnip.\n"); DEBUG("_recv_ieee802154: cannot allocate pktsnip.\n");
/* Discard packet on netdev device */
dev->driver->recv(dev, NULL, bytes_expected, NULL);
return NULL; return NULL;
} }
nread = dev->driver->recv(dev, pkt->data, bytes_expected, &rx_info); nread = dev->driver->recv(dev, pkt->data, bytes_expected, &rx_info);
......
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