don't wait for a free mbuf cluster in sosend() and enter the existing
authorreyk <reyk@openbsd.org>
Thu, 7 Aug 2008 17:43:37 +0000 (17:43 +0000)
committerreyk <reyk@openbsd.org>
Thu, 7 Aug 2008 17:43:37 +0000 (17:43 +0000)
error handler that was never used before.  this fixes a bug that a
userland process might hang if the system ran out of mbuf clusters or
even other unexpected behaviour in the network drivers.

this bug is very old - it is also found in rev 1.1/stevens v2/44lite2/...

discussed with many
ok markus@ thib@ dlg@

sys/kern/uipc_socket.c

index 7dffd74..281987c 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: uipc_socket.c,v 1.71 2008/06/14 10:55:21 mk Exp $     */
+/*     $OpenBSD: uipc_socket.c,v 1.72 2008/08/07 17:43:37 reyk Exp $   */
 /*     $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $        */
 
 /*
@@ -459,7 +459,7 @@ restart:
                                        mlen = MLEN;
                                }
                                if (resid >= MINCLSIZE && space >= MCLBYTES) {
-                                       MCLGET(m, M_WAIT);
+                                       MCLGET(m, M_NOWAIT);
                                        if ((m->m_flags & M_EXT) == 0)
                                                goto nopages;
                                        mlen = MCLBYTES;