summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/tcp_input.c3
-rw-r--r--sys/netinet/tcp_timewait.c8
2 files changed, 4 insertions, 7 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index e9ff355..db373cd 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1795,9 +1795,6 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so,
win = sbspace(&so->so_rcv);
if (win < 0)
win = 0;
- KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt),
- ("tcp_input negative window: tp %p rcv_nxt %u rcv_adv %u", tp,
- tp->rcv_nxt, tp->rcv_adv));
tp->rcv_wnd = imax(win, (int)(tp->rcv_adv - tp->rcv_nxt));
/* Reset receive buffer auto scaling when not in bulk receive mode. */
diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c
index fbcd601..31aa35c 100644
--- a/sys/netinet/tcp_timewait.c
+++ b/sys/netinet/tcp_timewait.c
@@ -242,10 +242,10 @@ tcp_twstart(struct tcpcb *tp)
/*
* Recover last window size sent.
*/
- KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt),
- ("tcp_twstart negative window: tp %p rcv_nxt %u rcv_adv %u", tp,
- tp->rcv_nxt, tp->rcv_adv));
- tw->last_win = (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale;
+ if (SEQ_GE(tp->rcv_adv, tp->rcv_nxt))
+ tw->last_win = (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale;
+ else
+ tw->last_win = 0;
/*
* Set t_recent if timestamps are used on the connection.
OpenPOWER on IntegriCloud