From 3f1d3f2c20bf3cbe073b6186ee30d68ba5e5bb71 Mon Sep 17 00:00:00 2001 From: reyk Date: Thu, 7 Aug 2008 17:43:37 +0000 Subject: [PATCH] don't wait for a free mbuf cluster in sosend() and enter the existing 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 7dffd74c857..281987c12c2 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -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; -- 2.20.1