Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jul 2008 14:51:08 GMT
From:      Rui Paulo <rpaulo@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 146321 for review
Message-ID:  <200807311451.m6VEp8DX095086@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=146321

Change 146321 by rpaulo@rpaulo_epsilon on 2008/07/31 14:50:40

	Implement the last bits of basic SEQ/ACK processing.

Affected files ...

.. //depot/projects/soc2008/rpaulo-tcpad/verify.c#7 edit

Differences ...

==== //depot/projects/soc2008/rpaulo-tcpad/verify.c#7 (text+ko) ====

@@ -23,7 +23,7 @@
  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- * $P4: //depot/projects/soc2008/rpaulo-tcpad/verify.c#6 $
+ * $P4: //depot/projects/soc2008/rpaulo-tcpad/verify.c#7 $
  */
 
 #include <stdio.h>
@@ -195,12 +195,15 @@
 
 		switch (tp->t_state) {
 		case TCPS_ESTABLISHED:
+			tp->snd_nxt += tlen;
+#if 0
 			if (th->th_seq != tp->snd_nxt)
 				printf("wrong seq %u %u\n", th->th_seq,
 				    tp->snd_nxt);
 			if (th->th_ack != tp->rcv_nxt)
 				printf("wrong ack %u %u\n", th->th_ack,
 				    tp->rcv_nxt);
+#endif
 			break;
 		}
 	}
@@ -320,7 +323,8 @@
 				free(cp);
 				return (NULL);
 			} else {
-                                dumper_error(cp, "RST: ACK < snd_nxt");
+                                dumper_error(cp, "SEG.ACK < SND.UNA or "
+				    "SEG.ACK > SND.NXT");
                                 dumper_free(cp);
                                 LIST_REMOVE(cp, entries);
 				free(cp);
@@ -368,8 +372,8 @@
 				DPRINTF(DEBUG_FSM, "FSM transition: %p "
 				    "SYN_RECEIVED -> ESTABLISHED\n", tp);
 			} else {
-				dumper_error(cp, "ACK < SND.UNA or "
-				    "ACK > SND.NXT");
+				dumper_error(cp, "SEG.ACK < SND.UNA or "
+				    "SEG.ACK > SND.NXT");
 				dumper_free(cp);
 				LIST_REMOVE(cp, entries);
 				free(cp);
@@ -432,6 +436,8 @@
 					    SEQ_GEQ(th->th_seq + tlen,
 						tp->rcv_nxt + tp->rcv_wnd))
 						printf("strange seq\n");
+					else
+						tp->rcv_nxt += tlen;
 
 
 				}
@@ -441,7 +447,6 @@
 			if (SEQ_GEQ(th->th_ack, tp->snd_una) &&
 			    SEQ_LEQ(th->th_ack, tp->snd_nxt)) {
 				tp->snd_una = th->th_ack;
-				tp->rcv_nxt = tp->snd_una + 1;
 				/* update send window */
 				if (SEQ_LT(tp->snd_wl1, th->th_seq) ||
 				    (tp->snd_wl1 == th->th_seq &&



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200807311451.m6VEp8DX095086>