From 24e0b252152355750d11cd66963e9199eea1afdc Mon Sep 17 00:00:00 2001 From: kieranm Date: Fri, 30 May 2008 12:21:29 +0000 Subject: [PATCH] Remove redundant "if" statement, and use real rcv_wnd rather than rcv_ann_wnd when deciding if packets are in-window. Contributed by --- CHANGELOG | 4 ++++ src/core/tcp_in.c | 9 +++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 377821dd..87f5d337 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -21,6 +21,10 @@ HISTORY ++ Bugfixes: + 2008-05-30 Kieran Mansley + * tcp_in.c Remove redundant "if" statement, and use real rcv_wnd + rather than rcv_ann_wnd when deciding if packets are in-window. + Contributed by 2008-05-30 Kieran Mansley * mem.h: Fix BUG#23254. Change macro definition of mem_* to allow diff --git a/src/core/tcp_in.c b/src/core/tcp_in.c index cb12040f..498c4e5c 100644 --- a/src/core/tcp_in.c +++ b/src/core/tcp_in.c @@ -511,7 +511,7 @@ tcp_process(struct tcp_pcb *pcb) } } else { if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, - pcb->rcv_nxt+pcb->rcv_ann_wnd)) { + pcb->rcv_nxt+pcb->rcv_wnd)) { acceptable = 1; } } @@ -1038,7 +1038,7 @@ tcp_receive(struct tcp_pcb *pcb) and below rcv_nxt + rcv_wnd) in order to be further processed. */ if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, - pcb->rcv_nxt + pcb->rcv_ann_wnd - 1)){ + pcb->rcv_nxt + pcb->rcv_wnd - 1)){ if (pcb->rcv_nxt == seqno) { accepted_inseq = 1; /* The incoming segment is the next in sequence. We check if @@ -1282,10 +1282,7 @@ tcp_receive(struct tcp_pcb *pcb) } } else { - if(!TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, - pcb->rcv_nxt + pcb->rcv_ann_wnd-1)){ - tcp_ack_now(pcb); - } + tcp_ack_now(pcb); } } else { /* Segments with length 0 is taken care of here. Segments that