Skip to content

Commit

Permalink
- Consistently update snd_wl1, snd_wl2, and rcv_up in the header
Browse files Browse the repository at this point in the history
   prediction code.  Previously, 2GB worth of header predicted data
   could leave these variables too far out of sequence which would cause
   problems after receiving a packet that did not match the header
   prediction.

Submitted by:	Bill Baumann <bbaumann@isilon.com>
Sponsored by:	Isilon Systems, Inc.
Reviewed by:	hsu, pete@isilon.com, neal@isilon.com, aaronp@isilon.com
  • Loading branch information
jeff authored and jeff committed Oct 31, 2002
1 parent d93f844 commit b6176d9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
16 changes: 15 additions & 1 deletion sys/netinet/tcp_input.c
Expand Up @@ -1027,7 +1027,11 @@ tcp_input(m, off0)
tcpstat.tcps_rcvackpack++;
tcpstat.tcps_rcvackbyte += acked;
sbdrop(&so->so_snd, acked);
tp->snd_una = th->th_ack;
/*
* pull snd_wl2 up to prevent seq wrap relative
* to th_ack.
*/
tp->snd_wl2 = tp->snd_una = th->th_ack;
tp->t_dupacks = 0;
m_freem(m);
ND6_HINT(tp); /* some progress has been done */
Expand Down Expand Up @@ -1067,6 +1071,16 @@ tcp_input(m, off0)
*/
++tcpstat.tcps_preddat;
tp->rcv_nxt += tlen;
/*
* Pull snd_wl1 up to prevent seq wrap relative to
* th_seq.
*/
tp->snd_wl1 = th->th_seq;
/*
* Pull rcv_up up to prevent seq wrap relative to
* rcv_nxt.
*/
tp->rcv_up = tp->rcv_nxt;
tcpstat.tcps_rcvpack++;
tcpstat.tcps_rcvbyte += tlen;
ND6_HINT(tp); /* some progress has been done */
Expand Down
16 changes: 15 additions & 1 deletion sys/netinet/tcp_reass.c
Expand Up @@ -1027,7 +1027,11 @@ tcp_input(m, off0)
tcpstat.tcps_rcvackpack++;
tcpstat.tcps_rcvackbyte += acked;
sbdrop(&so->so_snd, acked);
tp->snd_una = th->th_ack;
/*
* pull snd_wl2 up to prevent seq wrap relative
* to th_ack.
*/
tp->snd_wl2 = tp->snd_una = th->th_ack;
tp->t_dupacks = 0;
m_freem(m);
ND6_HINT(tp); /* some progress has been done */
Expand Down Expand Up @@ -1067,6 +1071,16 @@ tcp_input(m, off0)
*/
++tcpstat.tcps_preddat;
tp->rcv_nxt += tlen;
/*
* Pull snd_wl1 up to prevent seq wrap relative to
* th_seq.
*/
tp->snd_wl1 = th->th_seq;
/*
* Pull rcv_up up to prevent seq wrap relative to
* rcv_nxt.
*/
tp->rcv_up = tp->rcv_nxt;
tcpstat.tcps_rcvpack++;
tcpstat.tcps_rcvbyte += tlen;
ND6_HINT(tp); /* some progress has been done */
Expand Down

0 comments on commit b6176d9

Please sign in to comment.