Skip to content

Commit d15f476

Browse files
authored
Merge pull request #21709 from elenaf9/gnrc/netif/fix-send
gnrc/netif: don't re-append tx_sync snip if tx is done
2 parents a9d92e1 + bb04bc1 commit d15f476

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

sys/net/gnrc/netif/gnrc_netif.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,8 +1950,9 @@ static void _send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt, bool push_back)
19501950
int res = netif->ops->send(netif, pkt);
19511951

19521952
/* For legacy netdevs (no confirm_send) TX is blocking, thus it is always
1953-
* completed. For new netdevs (with confirm_send), TX is async. It is only
1954-
* done if TX failed right away (res < 0).
1953+
* completed. For new netdevs (with confirm_send), TX is usually async (res == 0).
1954+
* It is only done if TX failed right away (res < 0) or if the driver signaled
1955+
* that the transmission already completed (res > 0).
19551956
*/
19561957
if (gnrc_netif_netdev_legacy_api(netif) || (res != 0)) {
19571958
_tx_done(netif, pkt, tx_sync, res, push_back);
@@ -1961,11 +1962,11 @@ static void _send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt, bool push_back)
19611962
/* new API *and* send() was a success --> block netif and memorize
19621963
* frame to free memory later */
19631964
netif->tx_pkt = pkt;
1964-
}
19651965

1966-
gnrc_pkt_append(pkt, tx_sync);
1967-
if (IS_USED(MODULE_GNRC_NETIF_PKTQ) && push_back) {
1968-
netif->flags |= GNRC_NETIF_FLAGS_TX_FROM_PKTQUEUE;
1966+
gnrc_pkt_append(pkt, tx_sync);
1967+
if (IS_USED(MODULE_GNRC_NETIF_PKTQ) && push_back) {
1968+
netif->flags |= GNRC_NETIF_FLAGS_TX_FROM_PKTQUEUE;
1969+
}
19691970
}
19701971
#endif
19711972
}

0 commit comments

Comments
 (0)