summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorhsu <hsu@FreeBSD.org>2004-02-25 08:53:17 +0000
committerhsu <hsu@FreeBSD.org>2004-02-25 08:53:17 +0000
commitbb0d02704457643cac3ef88b9261a091409e65d2 (patch)
tree8de579d9f8bf86551fe38fac860bb12a05605d71 /sys/netinet
parent228209ee676aa00909c58f90e8b7d699f6ad040d (diff)
downloadFreeBSD-src-bb0d02704457643cac3ef88b9261a091409e65d2.zip
FreeBSD-src-bb0d02704457643cac3ef88b9261a091409e65d2.tar.gz
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 <silby@silby.com>.
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/tcp_input.c7
-rw-r--r--sys/netinet/tcp_reass.c7
2 files changed, 10 insertions, 4 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 151e083..2b4c564 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1917,6 +1917,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"));
@@ -1929,8 +1930,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)
diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c
index 151e083..2b4c564 100644
--- a/sys/netinet/tcp_reass.c
+++ b/sys/netinet/tcp_reass.c
@@ -1917,6 +1917,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"));
@@ -1929,8 +1930,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)
OpenPOWER on IntegriCloud