bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/4] lwip: Fix bug: Remove unsupported flags when calling send().


From: Joan Lledó
Subject: [PATCH 1/4] lwip: Fix bug: Remove unsupported flags when calling send().
Date: Thu, 2 May 2019 11:54:59 +0200

    Lwip 2.1.2 added a new assertion to ensure that no unsupported flags
    are being sent to lwip_sendmsg(). The send operation must be updated to
    remove this unsupported flags.

    * lwip/socket-ops.c: lwip_S_socket_send(): Remove unsupported flags.
---
 lwip/socket-ops.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/lwip/socket-ops.c b/lwip/socket-ops.c
index 62b36e08..82a2fe30 100644
--- a/lwip/socket-ops.c
+++ b/lwip/socket-ops.c
@@ -347,11 +347,11 @@ lwip_S_socket_send (struct sock_user * user,
   int sent;
   int sockflags;
   struct iovec iov = { data, datalen };
-struct msghdr m = { msg_name:addr ? &addr->address : 0,
-  msg_namelen:addr ? addr->address.sa.sa_len : 0,
-  msg_flags:flags,
-  msg_controllen: 0, msg_iov: &iov, msg_iovlen:1
-  };
+  struct msghdr m = { msg_name:addr ? &addr->address : 0,
+    msg_namelen:addr ? addr->address.sa.sa_len : 0,
+    msg_flags:flags,
+    msg_controllen: 0, msg_iov: &iov, msg_iovlen:1
+    };
 
   if (!user)
     return EOPNOTSUPP;
@@ -361,8 +361,11 @@ struct msghdr m = { msg_name:addr ? &addr->address : 0,
     return EINVAL;
 
   sockflags = lwip_fcntl (user->sock->sockno, F_GETFL, 0);
+  /* Remove unsupported flags */
+  flags &= MSG_DONTWAIT | MSG_MORE;
   if (sockflags & O_NONBLOCK)
     flags |= MSG_DONTWAIT;
+
   sent = lwip_sendmsg (user->sock->sockno, &m, flags);
 
   /* MiG should do this for us, but it doesn't. */
-- 
2.17.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]