Re: [PATCH net-next v11 09/23] ovpn: implement basic RX path (UDP)

From: Antonio Quartulli
Date: Sun Dec 01 2024 - 22:53:24 EST


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,

--
Antonio Quartulli
OpenVPN Inc.