From 8f07765d4d7f455359d1a4d131b4b9ad3973b224 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Sat, 3 Aug 2019 19:31:42 +0000 Subject: [PATCH] Clear the oobmark when we read oob data. Candidate fix for spurious POLLPRI/POLLRDBAND availability after recv(MSG_OOB) just consumed it. --- sys/kern/uipc_socket.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index c89dc0f4d576..f19d86321a21 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1179,6 +1179,9 @@ soreceive(struct socket *so, struct mbuf **paddr, struct uio *uio, MIN(uio->uio_resid, m->m_len), uio); m = m_free(m); } while (uio->uio_resid > 0 && error == 0 && m); + /* We consumed the oob data, no more oobmark. */ + so->so_oobmark = 0; + so->so_state &= ~SS_RCVATMARK; bad: if (m != NULL) m_freem(m);