From: tholo Date: Thu, 14 Mar 1996 08:06:57 +0000 (+0000) Subject: Fix from Lite2 X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=91a7a76366ea34404f7cab1594fb64bf833853f5;p=openbsd Fix from Lite2 --- 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 /*