From 2df0dfae2558afc5978e0b98cba4bc00c3847707 Mon Sep 17 00:00:00 2001 From: bz Date: Wed, 26 Nov 2008 12:54:31 +0000 Subject: Unify the v4 and v6 versions of pcbdetach and pcbfree as good as possible so that they are easily diffable. No functional changes. Reviewed by: rwatson MFC after: 6 weeks --- sys/netinet6/in6_pcb.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'sys/netinet6/in6_pcb.c') diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index b816fea..d16852e 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -414,7 +414,8 @@ void in6_pcbdetach(struct inpcb *inp) { - KASSERT(inp->inp_socket != NULL, ("in6_pcbdetach: inp_socket == NULL")); + KASSERT(inp->inp_socket != NULL, ("%s: inp_socket == NULL", __func__)); + inp->inp_socket->so_pcb = NULL; inp->inp_socket = NULL; } @@ -424,8 +425,9 @@ in6_pcbfree(struct inpcb *inp) { struct inpcbinfo *ipi = inp->inp_pcbinfo; - KASSERT(inp->inp_socket == NULL, ("in6_pcbfree: inp_socket != NULL")); - INP_INFO_WLOCK_ASSERT(inp->inp_pcbinfo); + KASSERT(inp->inp_socket == NULL, ("%s: inp_socket != NULL", __func__)); + + INP_INFO_WLOCK_ASSERT(ipi); INP_WLOCK_ASSERT(inp); #ifdef IPSEC @@ -443,6 +445,7 @@ in6_pcbfree(struct inpcb *inp) inp_freemoptions(inp->inp_moptions); inp->inp_vflag = 0; crfree(inp->inp_cred); + #ifdef MAC mac_inpcb_destroy(inp); #endif -- cgit v1.1