1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sys/net/gnrc/netif: don't release snip with netdev_new_api

This commit is contained in:
Benjamin Valentin 2024-11-13 15:40:36 +01:00
parent b9b8c4a68f
commit 8eef1c1170

View File

@ -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;