From owner-p4-projects@FreeBSD.ORG Wed Nov 5 13:17:07 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D567A16A4D0; Wed, 5 Nov 2003 13:17:06 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A8BE416A4CF for ; Wed, 5 Nov 2003 13:17:06 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B4F4643FE3 for ; Wed, 5 Nov 2003 13:17:05 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id hA5LH5XJ043473 for ; Wed, 5 Nov 2003 13:17:05 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id hA5LH5Qf043470 for perforce@freebsd.org; Wed, 5 Nov 2003 13:17:05 -0800 (PST) (envelope-from sam@freebsd.org) Date: Wed, 5 Nov 2003 13:17:05 -0800 (PST) Message-Id: <200311052117.hA5LH5Qf043470@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 41476 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2003 21:17:07 -0000 http://perforce.freebsd.org/chv.cgi?CH=41476 Change 41476 by sam@sam_ebb on 2003/11/05 13:16:57 Until IPv6 is locked we cannot make assertions about the inpcb's. Rather than scatter #ifdef INET6's around the code; do it at the source of the ASSERT macros. Affected files ... .. //depot/projects/netperf/sys/netinet/in_pcb.h#12 edit Differences ... ==== //depot/projects/netperf/sys/netinet/in_pcb.h#12 (text+ko) ==== @@ -246,12 +246,21 @@ struct mtx ipi_mtx; }; +/* + * NB: We cannot enable assertions when IPv6 is configured as + * this code is shared by both IPv4 and IPv6 and IPv6 is + * not properly locked. + */ #define INP_LOCK_INIT(inp, d) \ mtx_init(&(inp)->inp_mtx, (d), NULL, MTX_DEF | MTX_RECURSE | MTX_DUPOK) #define INP_LOCK_DESTROY(inp) mtx_destroy(&(inp)->inp_mtx) #define INP_LOCK(inp) mtx_lock(&(inp)->inp_mtx) #define INP_UNLOCK(inp) mtx_unlock(&(inp)->inp_mtx) +#ifndef INET6 #define INP_LOCK_ASSERT(inp) mtx_assert(&(inp)->inp_mtx, MA_OWNED) +#else +#define INP_LOCK_ASSERT(inp) +#endif #define INP_INFO_LOCK_INIT(ipi, d) \ mtx_init(&(ipi)->ipi_mtx, (d), NULL, MTX_DEF | MTX_RECURSE) @@ -259,8 +268,13 @@ #define INP_INFO_WLOCK(ipi) mtx_lock(&(ipi)->ipi_mtx) #define INP_INFO_RUNLOCK(ipi) mtx_unlock(&(ipi)->ipi_mtx) #define INP_INFO_WUNLOCK(ipi) mtx_unlock(&(ipi)->ipi_mtx) +#ifndef INET6 #define INP_INFO_RLOCK_ASSERT(ipi) mtx_assert(&(ipi)->ipi_mtx, MA_OWNED) #define INP_INFO_WLOCK_ASSERT(ipi) mtx_assert(&(ipi)->ipi_mtx, MA_OWNED) +#else +#define INP_INFO_RLOCK_ASSERT(ipi) +#define INP_INFO_WLOCK_ASSERT(ipi) +#endif #define INP_PCBHASH(faddr, lport, fport, mask) \ (((faddr) ^ ((faddr) >> 16) ^ ntohs((lport) ^ (fport))) & (mask))