Skip to content

Commit 861a05e

Browse files
committed
gnrc/netif: don't re-append tx_sync snip if tx is done
If sending is blocking or sending failed, the pkt is freed in the call to `_tx_done`. Thus, the previously split of `tx_sync` snip shouldn't be re-appended to the already freed pkt. Similarily, the `GNRC_NETIF_FLAGS_TX_FROM_PKTQUEUE` shouldn't be set in that case.
1 parent 8c12a06 commit 861a05e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sys/net/gnrc/netif/gnrc_netif.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1961,11 +1961,11 @@ static void _send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt, bool push_back)
19611961
/* new API *and* send() was a success --> block netif and memorize
19621962
* frame to free memory later */
19631963
netif->tx_pkt = pkt;
1964-
}
19651964

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;
1965+
gnrc_pkt_append(pkt, tx_sync);
1966+
if (IS_USED(MODULE_GNRC_NETIF_PKTQ) && push_back) {
1967+
netif->flags |= GNRC_NETIF_FLAGS_TX_FROM_PKTQUEUE;
1968+
}
19691969
}
19701970
#endif
19711971
}

0 commit comments

Comments
 (0)