Kieran Mansley - kjm25@cam.ac.uk - 24th Nov 2004

* Increase pcb->snd_buf by 1 when an ACK is received in SYN_SENT state to ensure correct operation
This commit is contained in:
kieranm 2004-11-24 17:05:41 +00:00
parent 4e309b7992
commit bb87d19e84

View File

@ -503,7 +503,7 @@ tcp_process(struct tcp_pcb *pcb)
/* First, determine if the reset is acceptable. */ /* First, determine if the reset is acceptable. */
if (pcb->state == SYN_SENT) { if (pcb->state == SYN_SENT) {
if (ackno == pcb->snd_nxt) { if (ackno == pcb->snd_nxt) {
acceptable = 1; acceptable = 1;
} }
} else { } else {
/*if (TCP_SEQ_GEQ(seqno, pcb->rcv_nxt) && /*if (TCP_SEQ_GEQ(seqno, pcb->rcv_nxt) &&
@ -540,6 +540,7 @@ tcp_process(struct tcp_pcb *pcb)
pcb->snd_nxt, ntohl(pcb->unacked->tcphdr->seqno))); pcb->snd_nxt, ntohl(pcb->unacked->tcphdr->seqno)));
if ((flags & TCP_ACK) && (flags & TCP_SYN) if ((flags & TCP_ACK) && (flags & TCP_SYN)
&& ackno == ntohl(pcb->unacked->tcphdr->seqno) + 1) { && ackno == ntohl(pcb->unacked->tcphdr->seqno) + 1) {
pcb->snd_buf ++;
pcb->rcv_nxt = seqno + 1; pcb->rcv_nxt = seqno + 1;
pcb->lastack = ackno; pcb->lastack = ackno;
pcb->snd_wnd = tcphdr->wnd; pcb->snd_wnd = tcphdr->wnd;