diff options
-rw-r--r-- | sys/netinet/tcp_input.c | 16 | ||||
-rw-r--r-- | sys/netinet/tcp_reass.c | 16 |
2 files changed, 30 insertions, 2 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 6175a81a9392..32567ca96c73 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1027,7 +1027,11 @@ after_listen: 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 */ @@ -1067,6 +1071,16 @@ after_listen: */ ++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 */ diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index 6175a81a9392..32567ca96c73 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -1027,7 +1027,11 @@ after_listen: 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 */ @@ -1067,6 +1071,16 @@ after_listen: */ ++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 */ |