This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: RedBoot sends continuous ACKS in TIME_WAIT state.
Grant Edwards <grante@visi.com> writes:
> 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).
Thank you! I shall be sure to apply this when I've finished my current
little job - which I'm sure is unrelated.
- Huge
> Index: ChangeLog
> ===================================================================
> 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"));
> }
>