Skip to content

Commit bae016a

Browse files
committed
sys/net/gnrc/netif: fix tx_sync by holding after split
1 parent d62f073 commit bae016a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

sys/net/gnrc/netif/gnrc_netif.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1922,11 +1922,6 @@ static void _send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt, bool push_back)
19221922
/* try to send anyway */
19231923
}
19241924
}
1925-
/* hold in case device was busy to not having to rewrite *all* the link
1926-
* layer implementations in case `gnrc_netif_pktq` is included */
1927-
if (gnrc_netif_netdev_legacy_api(netif)) {
1928-
gnrc_pktbuf_hold(pkt, 1);
1929-
}
19301925
#endif /* IS_USED(MODULE_GNRC_NETIF_PKTQ) */
19311926

19321927
/* Record send in neighbor statistics if destination is unicast */
@@ -1947,6 +1942,13 @@ static void _send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt, bool push_back)
19471942
/* Split off the TX sync snip */
19481943
gnrc_pktsnip_t *tx_sync = IS_USED(MODULE_GNRC_TX_SYNC)
19491944
? gnrc_tx_sync_split(pkt) : NULL;
1945+
#if IS_USED(MODULE_GNRC_NETIF_PKTQ)
1946+
/* hold in case device was busy to not having to rewrite *all* the link
1947+
* layer implementations in case `gnrc_netif_pktq` is included */
1948+
if (gnrc_netif_netdev_legacy_api(netif)) {
1949+
gnrc_pktbuf_hold(pkt, 1);
1950+
}
1951+
#endif /* IS_USED(MODULE_GNRC_NETIF_PKTQ) */
19501952
int res = netif->ops->send(netif, pkt);
19511953

19521954
/* For legacy netdevs (no confirm_send) TX is blocking, thus it is always

0 commit comments

Comments
 (0)