aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2021-11-10 19:35:50 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2021-11-13 16:33:32 +0000
commitef396441ceb8bce4e5d7382ff7c76928721297a3 (patch)
treee614a67a7e2762dbde7857b0fb5941263cab5969 /sys/netinet
parent9a06a82455487991e6a71e5ce8e96c5bf3b8df3c (diff)
downloadsrc-ef396441ceb8bce4e5d7382ff7c76928721297a3.tar.gz
src-ef396441ceb8bce4e5d7382ff7c76928721297a3.zip
tcp_usr_detach: revert debugging piece from f5cf1e5f5a500.
The code was probably useful during the problem being chased down, but for brevity makes sense just to return to the original KASSERT. Reviewed by: rrs Differential revision: https://reviews.freebsd.org/D32968
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/tcp_usrreq.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 968e102248d7..198852cc8fac 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$");
#include <sys/protosw.h>
#include <sys/proc.h>
#include <sys/jail.h>
-#include <sys/syslog.h>
#include <sys/stats.h>
#ifdef DDB
@@ -262,26 +261,10 @@ tcp_usr_detach(struct socket *so)
* In all three cases the tcptw should not be freed here.
*/
if (inp->inp_flags & INP_DROPPED) {
+ KASSERT(tp == NULL, ("tcp_detach: INP_TIMEWAIT && "
+ "INP_DROPPED && tp != NULL"));
in_pcbdetach(inp);
- if (__predict_true(tp == NULL)) {
- in_pcbfree(inp);
- } else {
- /*
- * This case should not happen as in TIMEWAIT
- * state the inp should not be destroyed before
- * its tcptw. If INVARIANTS is defined, panic.
- */
-#ifdef INVARIANTS
- panic("%s: Panic before an inp double-free: "
- "INP_TIMEWAIT && INP_DROPPED && tp != NULL"
- , __func__);
-#else
- log(LOG_ERR, "%s: Avoid an inp double-free: "
- "INP_TIMEWAIT && INP_DROPPED && tp != NULL"
- , __func__);
-#endif
- INP_WUNLOCK(inp);
- }
+ in_pcbfree(inp);
} else {
in_pcbdetach(inp);
INP_WUNLOCK(inp);