From ca94b4a65f95242e8e6e0754007ae680540924c5 Mon Sep 17 00:00:00 2001 From: Jeffrey Hsu Date: Wed, 25 Feb 2004 08:46:28 +0000 Subject: [PATCH] Relax a KASSERT condition to allow for a valid corner case where the FIN on the last segment consumes an extra sequence number. Spurious panic reported by Mike Silbersack . --- sys/netinet/tcp_input.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 3985693314..d8260b2b46 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -33,7 +33,7 @@ * * @(#)tcp_input.c 8.12 (Berkeley) 5/24/95 * $FreeBSD: src/sys/netinet/tcp_input.c,v 1.107.2.38 2003/05/21 04:46:41 cjc Exp $ - * $DragonFly: src/sys/netinet/tcp_input.c,v 1.13 2004/02/14 21:12:39 dillon Exp $ + * $DragonFly: src/sys/netinet/tcp_input.c,v 1.14 2004/02/25 08:46:28 hsu Exp $ */ #include "opt_ipfw.h" /* for ipfw_fwd */ @@ -1728,6 +1728,7 @@ trimthenstep6: u_long oldcwnd = tp->snd_cwnd; tcp_seq oldsndmax = tp->snd_max; u_int sent; + KASSERT(tp->t_dupacks == 1 || tp->t_dupacks == 2, ("dupacks not 1 or 2")); @@ -1740,8 +1741,10 @@ trimthenstep6: (void) tcp_output(tp); sent = tp->snd_max - oldsndmax; if (sent > tp->t_maxseg) { - KASSERT(tp->snd_limited == 0 && - tp->t_dupacks == 2, + KASSERT((tp->t_dupacks == 2 && + tp->snd_limited == 0) || + (sent == tp->t_maxseg + 1 && + tp->t_flags & TF_SENTFIN), ("sent too much")); tp->snd_limited = 2; } else if (sent > 0) -- 2.41.0