From 51823c3a93f2d353bf308cf0f3a594922d75826c Mon Sep 17 00:00:00 2001 From: Garrett Wollman Date: Wed, 13 Sep 1995 17:36:31 +0000 Subject: [PATCH] If tcp_output() is unable to allocate space for a copy of the data waiting to be sent, just clean up and return ENOBUFS rather than silently proceeding without sending any of the data. This makes it consistent with the `#ifdef notyet' case immediately above. Reviewed by: Andras Olah Obtained from: Lite-2 --- sys/netinet/tcp_output.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 33a6b83717b4..6c7ccd18eb21 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_output.c 8.3 (Berkeley) 12/30/93 - * $Id: tcp_output.c,v 1.10 1995/05/09 13:35:47 davidg Exp $ + * $Id: tcp_output.c,v 1.11 1995/05/30 08:09:56 rgrimes Exp $ */ #include @@ -486,8 +486,11 @@ send: m->m_len += len; } else { m->m_next = m_copy(so->so_snd.sb_mb, off, (int) len); - if (m->m_next == 0) - len = 0; + if (m->m_next == 0) { + m_free(m); + error = ENOBUFS; + goto out; + } } #endif /*