From 5891ebd6cddd2a22772bfb9ce6f90282cc83ea5b Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Sat, 14 May 2011 14:41:40 +0000 Subject: [PATCH] Oops, fix order of sequence numbers in KASSERT()'s to catch negative receive windows to match the labels in the panic message. Submitted by: trociny --- sys/netinet/tcp_input.c | 2 +- sys/netinet/tcp_timewait.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 6abf8db2b9e8..1a94d0ab08b5 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1833,7 +1833,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, 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_adv, tp->rcv_nxt)); + 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 4427e1c005cf..fbcd601c4044 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -244,7 +244,7 @@ tcp_twstart(struct tcpcb *tp) */ KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt), ("tcp_twstart negative window: tp %p rcv_nxt %u rcv_adv %u", tp, - tp->rcv_adv, tp->rcv_nxt)); + tp->rcv_nxt, tp->rcv_adv)); tw->last_win = (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale; /*