From owner-svn-src-head@FreeBSD.ORG Wed Nov 26 12:54:31 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDFB61065672; Wed, 26 Nov 2008 12:54:31 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C1C638FC18; Wed, 26 Nov 2008 12:54:31 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAQCsVdC055944; Wed, 26 Nov 2008 12:54:31 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAQCsVQC055942; Wed, 26 Nov 2008 12:54:31 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200811261254.mAQCsVQC055942@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 26 Nov 2008 12:54:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185333 - in head/sys: netinet netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Nov 2008 12:54:32 -0000 Author: bz Date: Wed Nov 26 12:54:31 2008 New Revision: 185333 URL: http://svn.freebsd.org/changeset/base/185333 Log: 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 Modified: head/sys/netinet/in_pcb.c head/sys/netinet6/in6_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Wed Nov 26 12:24:18 2008 (r185332) +++ head/sys/netinet/in_pcb.c Wed Nov 26 12:54:31 2008 (r185333) @@ -877,7 +877,7 @@ void in_pcbdetach(struct inpcb *inp) { - KASSERT(inp->inp_socket != NULL, ("in_pcbdetach: inp_socket == NULL")); + KASSERT(inp->inp_socket != NULL, ("%s: inp_socket == NULL", __func__)); inp->inp_socket->so_pcb = NULL; inp->inp_socket = NULL; @@ -892,14 +892,14 @@ in_pcbfree(struct inpcb *inp) { struct inpcbinfo *ipi = inp->inp_pcbinfo; - KASSERT(inp->inp_socket == NULL, ("in_pcbfree: inp_socket != NULL")); + KASSERT(inp->inp_socket == NULL, ("%s: inp_socket != NULL", __func__)); INP_INFO_WLOCK_ASSERT(ipi); INP_WLOCK_ASSERT(inp); #ifdef IPSEC ipsec4_delete_pcbpolicy(inp); -#endif /*IPSEC*/ +#endif /* IPSEC */ inp->inp_gencnt = ++ipi->ipi_gencnt; in_pcbremlists(inp); if (inp->inp_options) Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Wed Nov 26 12:24:18 2008 (r185332) +++ head/sys/netinet6/in6_pcb.c Wed Nov 26 12:54:31 2008 (r185333) @@ -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