diff options
author | wollman <wollman@FreeBSD.org> | 1995-09-13 17:36:31 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1995-09-13 17:36:31 +0000 |
commit | 9cd7fc13766a2f6a9722fbc9bf79a464cab4ee3a (patch) | |
tree | e6bf5d8ea8516760fd45e3321cc88b12eb803e7a /sys/netinet | |
parent | a0abe974dcbe8baf67801350e0a6f72eb7f85c05 (diff) | |
download | FreeBSD-src-9cd7fc13766a2f6a9722fbc9bf79a464cab4ee3a.zip FreeBSD-src-9cd7fc13766a2f6a9722fbc9bf79a464cab4ee3a.tar.gz |
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 <olah@freebsd.org>
Obtained from: Lite-2
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/tcp_output.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 33a6b83..6c7ccd1 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 <sys/param.h> @@ -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 /* |