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:
parent
b9b8c4a68f
commit
8eef1c1170
@ -104,13 +104,24 @@ static gnrc_pktsnip_t *_recv(gnrc_netif_t *netif)
|
|||||||
return pkt;
|
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)
|
static int _send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt)
|
||||||
{
|
{
|
||||||
int res = -ENOBUFS;
|
int res = -ENOBUFS;
|
||||||
|
|
||||||
if (pkt->type == GNRC_NETTYPE_NETIF) {
|
if (pkt->type == GNRC_NETTYPE_NETIF) {
|
||||||
/* we don't need the netif snip: remove it */
|
pkt = _skip_pkt_head(netif, pkt);
|
||||||
pkt = gnrc_pktbuf_remove_snip(pkt, pkt);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
netdev_t *dev = netif->dev;
|
netdev_t *dev = netif->dev;
|
||||||
|
Loading…
Reference in New Issue
Block a user