mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-05 22:29:49 +00:00
Added check on entire sequence number of received packet being less than the rcv_nxt variable.
(see http://www.sics.se/mailing-lists/lwip.html/msg01409.html)
This commit is contained in:
parent
aa69784495
commit
8b5fcad039
@ -825,8 +825,8 @@ tcp_receive(struct tcp_pcb *pcb)
|
|||||||
this if the sequence number of the incoming segment is less
|
this if the sequence number of the incoming segment is less
|
||||||
than rcv_nxt, and the sequence number plus the length of the
|
than rcv_nxt, and the sequence number plus the length of the
|
||||||
segment is larger than rcv_nxt. */
|
segment is larger than rcv_nxt. */
|
||||||
if(TCP_SEQ_LT(seqno, pcb->rcv_nxt) &&
|
if(TCP_SEQ_LT(seqno, pcb->rcv_nxt)){
|
||||||
TCP_SEQ_LT(pcb->rcv_nxt, seqno + tcplen)) {
|
if(TCP_SEQ_LT(pcb->rcv_nxt, seqno + tcplen)) {
|
||||||
/* Trimming the first edge is done by pushing the payload
|
/* Trimming the first edge is done by pushing the payload
|
||||||
pointer in the pbuf downwards. This is somewhat tricky since
|
pointer in the pbuf downwards. This is somewhat tricky since
|
||||||
we do not want to discard the full contents of the pbuf up to
|
we do not want to discard the full contents of the pbuf up to
|
||||||
@ -863,6 +863,13 @@ tcp_receive(struct tcp_pcb *pcb)
|
|||||||
inseg.len -= pcb->rcv_nxt - seqno;
|
inseg.len -= pcb->rcv_nxt - seqno;
|
||||||
inseg.tcphdr->seqno = seqno = pcb->rcv_nxt;
|
inseg.tcphdr->seqno = seqno = pcb->rcv_nxt;
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
/* the whole segment is < rcv_nxt */
|
||||||
|
/* must be a duplicate of a packet that has already been correctly handled */
|
||||||
|
|
||||||
|
DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: duplicate seqno %ld\n", seqno));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* The sequence number must be within the window (above rcv_nxt
|
/* The sequence number must be within the window (above rcv_nxt
|
||||||
and below rcv_nxt + rcv_wnd) in order to be further
|
and below rcv_nxt + rcv_wnd) in order to be further
|
||||||
|
Loading…
Reference in New Issue
Block a user