This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: RedBoot sends continuous ACKS in TIME_WAIT state.


On Tue, Mar 27, 2001 at 08:03:22AM -0600, Grant Edwards wrote:
> 
> Based on comparisons to the same sequence of events when an
> eCos server-app does an active close, the problem appears to be
> that the sequence number in the ACKs sent by RedBoot in frames
> 11, 13, 15 should be 12 instead of 11.  One of the states in
> the active close sequence isn't advancing the local sequence
> number when it receives an ACK. I'm not sure which one should
> be doing it.

RedBoot wasn't incrementing the sequence number for the FIN
that it sends when doing an active close.  (SYN and FIN both
use up a sequence number.) I've attached a patch for tcp.c to
fix the problem (only seen when RedBoot does an active close).

-- 
Grant Edwards
grante@visi.com


2000-03-27  Grant Edwards <grante@visi.com>

        * src/net/tcp.c: Fixed sequence number bug seen when
        doing an active close.
Index: tcp.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/redboot/current/src/net/tcp.c,v
retrieving revision 1.2
diff -U9 -r1.2 tcp.c
--- tcp.c	2000/12/08 03:30:09	1.2
+++ tcp.c	2001/03/27 17:40:28
@@ -498,18 +498,19 @@
 		    }
 		}
 		break;
 
 	      case _FIN_WAIT_1:
 		if (tcp->flags & TCP_FLAG_ACK) {
 		    handle_ack(s, pkt);
 		    if (ntohl(tcp->acknum) == (s->seq + 1)) {
 			/* got ACK for FIN packet */
+			s->seq++;
 			if (tcp->flags & TCP_FLAG_FIN) {
 			    BSPLOG(bsp_log("_FIN_WAIT_1 --> _TIME_WAIT\n"));
 			    s->ack++;
 			    s->state = _TIME_WAIT;
 			    tcp_send(s, TCP_FLAG_ACK, 0);
 			} else {
 			    s->state = _FIN_WAIT_2;
 			    BSPLOG(bsp_log("_FIN_WAIT_1 --> _FIN_WAIT_2\n"));
 			}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]