On 29/11/2024 17:10, Sabrina Dubroca wrote:
Related to that topic, I'm not sure what's keeping a reference on the peer to guarantee it doesn't get freed before we're done with peer->tcp.tx_work at the end of ovpn_tcp_socket_detach. Maybe all this tcp stuff should move from the peer to ovpn_socket?
Actually, with the new approach of "keeping the reference to the peer until the socket is gone" we can simply ensure the reference is dropped at the very end of the detach, after cancel_work_sync() is done.
This way we know for sure that every activity is done and can release the peer.
Regards,