Commit efd72940 authored by Ralf Lici's avatar Ralf Lici Committed by Paolo Abeni
Browse files

ovpn: use datagram_poll_queue for socket readiness in TCP



openvpn TCP encapsulation uses a custom queue to deliver packets to
userspace. Currently it relies on datagram_poll, which checks
sk_receive_queue, leading to false readiness signals when that queue
contains non-userspace packets.

Switch ovpn_tcp_poll to use datagram_poll_queue with the peer's
user_queue, ensuring poll only signals readiness when userspace data is
actually available. Also refactor ovpn_tcp_poll in order to enforce the
assumption we can make on the lifetime of ovpn_sock and peer.

Fixes: 11851cbd ("ovpn: implement TCP transport")
Signed-off-by: default avatarAntonio Quartulli <antonio@openvpn.net>
Signed-off-by: default avatarRalf Lici <ralf@mandelbit.com>
Reviewed-by: default avatarSabrina Dubroca <sd@queasysnail.net>
Link: https://patch.msgid.link/20251021100942.195010-4-ralf@mandelbit.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 0fc3e32c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment