summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_reass.c
diff options
context:
space:
mode:
authorolah <olah@FreeBSD.org>1995-04-05 10:32:14 +0000
committerolah <olah@FreeBSD.org>1995-04-05 10:32:14 +0000
commitccccd069f4ff70a758caf7c0e749a3bc36534b0b (patch)
tree0838e7aee51a61f16a80205e5949b1bf73ecda38 /sys/netinet/tcp_reass.c
parent5e05f2708f5eac34b4fab51d0a5f1bf5c2f52707 (diff)
downloadFreeBSD-src-ccccd069f4ff70a758caf7c0e749a3bc36534b0b.zip
FreeBSD-src-ccccd069f4ff70a758caf7c0e749a3bc36534b0b.tar.gz
Fix a bug in tcp_input reported by Rick Jones <raj@hpisrdq.cup.hp.com>.
If a goto findpcb occurred during the processing of a segment, the TCP and IP headers were dropped twice from the mbuf which resulted in data acked by TCP but not delivered to the user. Reviewed by: davidg
Diffstat (limited to 'sys/netinet/tcp_reass.c')
-rw-r--r--sys/netinet/tcp_reass.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c
index c35f038..d9f287d 100644
--- a/sys/netinet/tcp_reass.c
+++ b/sys/netinet/tcp_reass.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* From: @(#)tcp_input.c 8.5 (Berkeley) 4/10/94
- * $Id: tcp_input.c,v 1.16 1995/03/16 18:15:04 bde Exp $
+ * $Id: tcp_input.c,v 1.17 1995/03/27 07:12:24 davidg Exp $
*/
#ifndef TUBA_INCLUDE
@@ -324,6 +324,12 @@ tcp_input(m, iphlen)
NTOHS(ti->ti_urp);
/*
+ * Drop TCP, IP headers and TCP options.
+ */
+ m->m_data += sizeof(struct tcpiphdr)+off-sizeof(struct tcphdr);
+ m->m_len -= sizeof(struct tcpiphdr)+off-sizeof(struct tcphdr);
+
+ /*
* Locate pcb for segment.
*/
findpcb:
@@ -515,11 +521,8 @@ findpcb:
tcpstat.tcps_rcvpack++;
tcpstat.tcps_rcvbyte += ti->ti_len;
/*
- * Drop TCP, IP headers and TCP options then add data
- * to socket buffer.
+ * Add data to socket buffer.
*/
- m->m_data += sizeof(struct tcpiphdr)+off-sizeof(struct tcphdr);
- m->m_len -= sizeof(struct tcpiphdr)+off-sizeof(struct tcphdr);
sbappend(&so->so_rcv, m);
sorwakeup(so);
/*
@@ -538,12 +541,6 @@ findpcb:
}
/*
- * Drop TCP, IP headers and TCP options.
- */
- m->m_data += sizeof(struct tcpiphdr)+off-sizeof(struct tcphdr);
- m->m_len -= sizeof(struct tcpiphdr)+off-sizeof(struct tcphdr);
-
- /*
* Calculate amount of space in receive window,
* and then do TCP input processing.
* Receive window is amount of space in rcv queue,
OpenPOWER on IntegriCloud