Skip to content

Commit 0fc3e32

Browse files
ralfliciPaolo Abeni
authored andcommitted
espintcp: use datagram_poll_queue for socket readiness
espintcp uses a custom queue (ike_queue) to deliver packets to userspace. The polling logic relies on datagram_poll, which checks sk_receive_queue, which can lead to false readiness signals when that queue contains non-userspace packets. Switch espintcp_poll to use datagram_poll_queue with ike_queue, ensuring poll only signals readiness when userspace data is actually available. Fixes: e27cca9 ("xfrm: add espintcp (RFC 8229)") Signed-off-by: Ralf Lici <ralf@mandelbit.com> Reviewed-by: Sabrina Dubroca <sd@queasysnail.net> Link: https://patch.msgid.link/20251021100942.195010-3-ralf@mandelbit.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent f6ceec6 commit 0fc3e32

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

net/xfrm/espintcp.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -555,14 +555,10 @@ static void espintcp_close(struct sock *sk, long timeout)
555555
static __poll_t espintcp_poll(struct file *file, struct socket *sock,
556556
poll_table *wait)
557557
{
558-
__poll_t mask = datagram_poll(file, sock, wait);
559558
struct sock *sk = sock->sk;
560559
struct espintcp_ctx *ctx = espintcp_getctx(sk);
561560

562-
if (!skb_queue_empty(&ctx->ike_queue))
563-
mask |= EPOLLIN | EPOLLRDNORM;
564-
565-
return mask;
561+
return datagram_poll_queue(file, sock, wait, &ctx->ike_queue);
566562
}
567563

568564
static void build_protos(struct proto *espintcp_prot,

0 commit comments

Comments
 (0)