diff --git a/sys/net/gnrc/netif/gnrc_netif_raw.c b/sys/net/gnrc/netif/gnrc_netif_raw.c index 0ba358fd17..f8a475be00 100644 --- a/sys/net/gnrc/netif/gnrc_netif_raw.c +++ b/sys/net/gnrc/netif/gnrc_netif_raw.c @@ -104,13 +104,24 @@ static gnrc_pktsnip_t *_recv(gnrc_netif_t *netif) return pkt; } +static gnrc_pktsnip_t *_skip_pkt_head(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt) +{ + if (gnrc_netif_netdev_legacy_api(netif)) { + /* we don't need the netif snip: remove it */ + return gnrc_pktbuf_remove_snip(pkt, pkt); + } + else { + /* _tx_done() will free the entire list */ + return pkt->next; + } +} + static int _send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt) { int res = -ENOBUFS; if (pkt->type == GNRC_NETTYPE_NETIF) { - /* we don't need the netif snip: remove it */ - pkt = gnrc_pktbuf_remove_snip(pkt, pkt); + pkt = _skip_pkt_head(netif, pkt); } netdev_t *dev = netif->dev;