fix bug that scrogged buffer offsets
authorBill Joy <root@ucbvax.Berkeley.EDU>
Thu, 11 Mar 1982 03:22:45 +0000 (19:22 -0800)
committerBill Joy <root@ucbvax.Berkeley.EDU>
Thu, 11 Mar 1982 03:22:45 +0000 (19:22 -0800)
SCCS-vsn: sys/netinet/tcp_input.c 1.58

usr/src/sys/netinet/tcp_input.c

index cf745bc..67a7cfe 100644 (file)
@@ -1,4 +1,4 @@
-/*     tcp_input.c     1.57    82/03/09        */
+/*     tcp_input.c     1.58    82/03/10        */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -112,6 +112,13 @@ COUNT(TCP_INPUT);
        }
        tiflags = ti->ti_flags;
 
        }
        tiflags = ti->ti_flags;
 
+       /*
+        * drop IP header
+        */
+       off += sizeof (struct ip);
+       m->m_off += off;
+       m->m_len -= off;
+
 #if vax
        /*
         * Convert TCP protocol specific fields to host format.
 #if vax
        /*
         * Convert TCP protocol specific fields to host format.
@@ -601,8 +608,6 @@ step6:
         */
        if ((ti->ti_len || (tiflags&TH_FIN)) &&
            TCPS_HAVERCVDFIN(tp->t_state) == 0) {
         */
        if ((ti->ti_len || (tiflags&TH_FIN)) &&
            TCPS_HAVERCVDFIN(tp->t_state) == 0) {
-               off += sizeof (struct ip);              /* drop IP header */
-               m_drop(m, off);
                tiflags = tcp_reass(tp, ti);
                if (tcpnodelack == 0)
                        tp->t_flags |= TF_DELACK;
                tiflags = tcp_reass(tp, ti);
                if (tcpnodelack == 0)
                        tp->t_flags |= TF_DELACK;