summaryrefslogtreecommitdiff
path: root/sys/kern/uipc_socket.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2018-06-14 08:46:10 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2018-06-14 08:46:10 +0000
commit203035e0fe6ba35b45b3ad32c913589e5711ad6e (patch)
tree04d84448528ed959e9d449bdba9b61da89811787 /sys/kern/uipc_socket.c
parent9b9edcb073a8f7008c856b2d5f78f49ec328a8b1 (diff)
In soclose() and soaccept() convert the KASSERT(SS_NOFDREF) back
to a panic message. The latter prints socket pointer and type to help debugging. OK mpi@
Diffstat (limited to 'sys/kern/uipc_socket.c')
-rw-r--r--sys/kern/uipc_socket.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 536e1ae55bf..010b18aebea 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket.c,v 1.223 2018/06/06 06:55:22 mpi Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.224 2018/06/14 08:46:09 bluhm Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
@@ -257,7 +257,7 @@ soclose(struct socket *so)
(void) soabort(so2);
}
}
- if (so->so_pcb == 0)
+ if (so->so_pcb == NULL)
goto discard;
if (so->so_state & SS_ISCONNECTED) {
if ((so->so_state & SS_ISDISCONNECTING) == 0) {
@@ -287,7 +287,8 @@ drop:
error = error2;
}
discard:
- KASSERT((so->so_state & SS_NOFDREF) == 0);
+ if (so->so_state & SS_NOFDREF)
+ panic("soclose NOFDREF: so %p, so_type %d", so, so->so_type);
so->so_state |= SS_NOFDREF;
/* sofree() calls sounlock(). */
sofree(so, s);
@@ -310,7 +311,8 @@ soaccept(struct socket *so, struct mbuf *nam)
soassertlocked(so);
- KASSERT((so->so_state & SS_NOFDREF) != 0);
+ if ((so->so_state & SS_NOFDREF) == 0)
+ panic("soaccept !NOFDREF: so %p, so_type %d", so, so->so_type);
so->so_state &= ~SS_NOFDREF;
if ((so->so_state & SS_ISDISCONNECTED) == 0 ||
(so->so_proto->pr_flags & PR_ABRTACPTDIS) == 0)