aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/socket.h1
-rw-r--r--net/socket.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 7b3aae2052a6..354cc5617f8b 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -255,6 +255,7 @@ struct ucred {
255#define MSG_ERRQUEUE 0x2000 /* Fetch message from error queue */ 255#define MSG_ERRQUEUE 0x2000 /* Fetch message from error queue */
256#define MSG_NOSIGNAL 0x4000 /* Do not generate SIGPIPE */ 256#define MSG_NOSIGNAL 0x4000 /* Do not generate SIGPIPE */
257#define MSG_MORE 0x8000 /* Sender will send more */ 257#define MSG_MORE 0x8000 /* Sender will send more */
258#define MSG_WAITFORONE 0x10000 /* recvmmsg(): block until 1+ packets avail */
258 259
259#define MSG_EOF MSG_FIN 260#define MSG_EOF MSG_FIN
260 261
diff --git a/net/socket.c b/net/socket.c
index 769c386bd428..f55ffe9f8c87 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -2135,6 +2135,10 @@ int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen,
2135 break; 2135 break;
2136 ++datagrams; 2136 ++datagrams;
2137 2137
2138 /* MSG_WAITFORONE turns on MSG_DONTWAIT after one packet */
2139 if (flags & MSG_WAITFORONE)
2140 flags |= MSG_DONTWAIT;
2141
2138 if (timeout) { 2142 if (timeout) {
2139 ktime_get_ts(timeout); 2143 ktime_get_ts(timeout);
2140 *timeout = timespec_sub(end_time, *timeout); 2144 *timeout = timespec_sub(end_time, *timeout);