Subject: tcp window update patch
To: None <tech-net@netbsd.org>
From: Michael Graff <explorer@flame.org>
List: tech-net
Date: 02/03/1999 21:48:34
The comment and the code in tcp_input.c don't quite match, I believe.
If the comment is right, the code is wrong.  This change makes the
window update only occur when the TH_ACK bit is set in a packet.
The question is, is it right?

Index: sys/netinet/tcp_input.c
===================================================================
RCS file: /cvsroot/src/sys/netinet/tcp_input.c,v
retrieving revision 1.75
diff -u -r1.75 tcp_input.c
--- tcp_input.c	1999/01/24 01:19:28	1.75
+++ tcp_input.c	1999/02/04 03:44:36
@@ -1379,9 +1379,9 @@
 	 * Update window information.
 	 * Don't look at window if no ACK: TAC's send garbage on first SYN.
 	 */
-	if (((tiflags & TH_ACK) && SEQ_LT(tp->snd_wl1, ti->ti_seq)) ||
+	if ((tiflags & TH_ACK) && (SEQ_LT(tp->snd_wl1, ti->ti_seq) ||
 	    (tp->snd_wl1 == ti->ti_seq && SEQ_LT(tp->snd_wl2, ti->ti_ack)) ||
-	    (tp->snd_wl2 == ti->ti_ack && tiwin > tp->snd_wnd)) {
+	    (tp->snd_wl2 == ti->ti_ack && tiwin > tp->snd_wnd))) {
 		/* keep track of pure window updates */
 		if (ti->ti_len == 0 &&
 		    tp->snd_wl2 == ti->ti_ack && tiwin > tp->snd_wnd)