From 73eb03214edc4d64a7faf9f8b92238d852a0fb76 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Wed, 22 Nov 2023 11:40:02 -0500 Subject: [PATCH] net/ProtocolUtilities: Return EOPNOTSUPP when unhandled flags are specified. Same as has already been done for UNIX domain sockets and TCP (this is used in the implementation of UDP.) --- headers/private/net/ProtocolUtilities.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/headers/private/net/ProtocolUtilities.h b/headers/private/net/ProtocolUtilities.h index bc6ec6faac..6f797fe296 100644 --- a/headers/private/net/ProtocolUtilities.h +++ b/headers/private/net/ProtocolUtilities.h @@ -213,6 +213,9 @@ DECL_DATAGRAM_SOCKET(inline status_t)::EnqueueClone(net_buffer* _buffer) DECL_DATAGRAM_SOCKET(inline status_t)::Dequeue(uint32 flags, net_buffer** _buffer) { + if ((flags & ~(MSG_DONTWAIT | MSG_PEEK)) != 0) + return EOPNOTSUPP; + return BlockingDequeue((flags & MSG_PEEK) != 0, _SocketTimeout(flags), _buffer); }