From 1b7c1ca5392f3b950afa28cb07d6703d5497fd93 Mon Sep 17 00:00:00 2001 From: Joan Lledó Date: Sat, 4 May 2019 10:19:59 +0200 Subject: lwip: Fix bug: Clear MSG_NOSIGNAL flag when calling send(). Lwip 2.1.2 added a new assertion to ensure that no unsupported flags are being sent to lwip_sendmsg(). MSG_NOSIGNAL is one of these flags and name resolving stopped working. * lwip/socket-ops.c: lwip_S_socket_send(): Clear MSG_NOSIGNAL to ensure is not sent to lwip_sendmsg(). Message-Id: <20190504081959.6463-2-jlledom@member.fsf.org> --- lwip/socket-ops.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lwip/socket-ops.c') diff --git a/lwip/socket-ops.c b/lwip/socket-ops.c index 62b36e08..9030e477 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); + /* XXX: missing !MSG_NOSIGNAL support, i.e. generate SIGPIPE */ + flags &= ~MSG_NOSIGNAL; 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. */ -- cgit v1.2.3