From 53348e3a8cbd07831a4fc4211efd28c38ac191fe Mon Sep 17 00:00:00 2001 From: Jose Alamos Date: Thu, 12 Nov 2020 16:12:22 +0100 Subject: [PATCH 1/2] gnrc_netif: add missing netdev events --- sys/net/gnrc/netif/gnrc_netif.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/net/gnrc/netif/gnrc_netif.c b/sys/net/gnrc/netif/gnrc_netif.c index 2aece9fe1d..a52b86049c 100644 --- a/sys/net/gnrc/netif/gnrc_netif.c +++ b/sys/net/gnrc/netif/gnrc_netif.c @@ -1715,6 +1715,7 @@ static void _event_cb(netdev_t *dev, netdev_event_t event) break; #if IS_USED(MODULE_NETSTATS_L2) || IS_USED(MODULE_GNRC_NETIF_PKTQ) case NETDEV_EVENT_TX_COMPLETE: + case NETDEV_EVENT_TX_COMPLETE_DATA_PENDING: /* send packet previously queued within netif due to the lower * layer being busy. * Further packets will be sent on later TX_COMPLETE or @@ -1729,6 +1730,7 @@ static void _event_cb(netdev_t *dev, netdev_event_t event) #endif /* IS_USED(MODULE_NETSTATS_L2) || IS_USED(MODULE_GNRC_NETIF_PKTQ) */ #if IS_USED(MODULE_NETSTATS_L2) || IS_USED(MODULE_GNRC_NETIF_PKTQ) case NETDEV_EVENT_TX_MEDIUM_BUSY: + case NETDEV_EVENT_TX_NOACK: /* send packet previously queued within netif due to the lower * layer being busy. * Further packets will be sent on later TX_COMPLETE or From dfb214ab9848e4318e52e99c481a85d138f379e1 Mon Sep 17 00:00:00 2001 From: Jose Alamos Date: Thu, 12 Nov 2020 16:12:56 +0100 Subject: [PATCH 2/2] gnrc_netif: add missing pktbuf release --- sys/net/gnrc/netif/gnrc_netif.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/net/gnrc/netif/gnrc_netif.c b/sys/net/gnrc/netif/gnrc_netif.c index a52b86049c..f615f06eea 100644 --- a/sys/net/gnrc/netif/gnrc_netif.c +++ b/sys/net/gnrc/netif/gnrc_netif.c @@ -1521,6 +1521,9 @@ static void _send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt, bool push_back) } else { LOG_ERROR("gnrc_netif: can't queue packet for sending\n"); + /* If we got here, it means the device was busy and the pkt queue + * was full. The packet should be dropped here anyway */ + gnrc_pktbuf_release_error(pkt, ENOMEM); } return; }