diff options
Diffstat (limited to 'sys/kern/uipc_socket.c')
-rw-r--r-- | sys/kern/uipc_socket.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index f08036d..189a30f 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1310,11 +1310,14 @@ restart: resid = 0; if (flags & MSG_EOR) top->m_flags |= M_EOR; - } else if (resid > 0) { + } else { /* * Copy the data from userland into a mbuf - * chain. If no data is to be copied in, - * a single empty mbuf is returned. + * chain. If resid is 0, which can happen + * only if we have control to send, then + * a single empty mbuf is returned. This + * is a workaround to prevent protocol send + * methods to panic. */ top = m_uiotombuf(uio, M_WAITOK, space, (atomic ? max_hdr : 0), |