From 91a7a76366ea34404f7cab1594fb64bf833853f5 Mon Sep 17 00:00:00 2001 From: tholo Date: Thu, 14 Mar 1996 08:06:57 +0000 Subject: [PATCH] Fix from Lite2 --- sys/netinet/tcp_output.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index b98f5a7d9dd..600f6bad8d5 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_output.c,v 1.2 1996/03/03 22:30:46 niklas Exp $ */ +/* $OpenBSD: tcp_output.c,v 1.3 1996/03/14 08:06:57 tholo Exp $ */ /* $NetBSD: tcp_output.c,v 1.14 1996/02/13 23:43:53 christos Exp $ */ /* @@ -329,10 +329,10 @@ send: * Adjust data length if insertion of options will * bump the packet length beyond the t_maxseg length. */ - if (len > tp->t_maxseg - optlen) { + if (len > tp->t_maxseg - optlen) { len = tp->t_maxseg - optlen; - flags &= ~TH_FIN; sendalot = 1; + flags &= ~TH_FIN; } #ifdef DIAGNOSTIC @@ -380,8 +380,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) { + (void) m_free(m); + error = ENOBUFS; + goto out; + } } #endif /* -- 2.20.1