mirror of
https://github.com/Dasharo/zephyr.git
synced 2026-03-06 14:57:20 -08:00
Usage of k_work object from within net_pkt results in undefined behavior in case when net_pkt is deallocated (by net_pkt_unref()) before work has been finished. Use per socket k_work object (sock->send_work) to submit send work and put net_pkt objects onto k_fifo (sock->tx_fifo). Add a helper function esp_socket_queue_tx() for that, which will make sure that packets are enqueued only when send work handler will be successfully submitted (so that all packets are consumed/dereferenced). Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>