From bc0c49120545212dcc8b185d81971a000bf866d1 Mon Sep 17 00:00:00 2001 From: rwatson Date: Wed, 4 Aug 2004 18:27:55 +0000 Subject: [PATCH] Now that IPv6 performs basic in6pcb and inpcb locking, enable inpcb lock assertions even if IPv6 is compiled into the kernel. Previously, inclusion of IPv6 and locking assertions would result in a rapid assertion failure as IPv6 was not properly locking inpcbs. --- sys/netinet/in_pcb.h | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index ec380453ef14..d6dfe4dd0172 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -243,16 +243,10 @@ struct inpcbinfo { /* XXX documentation, prefixes */ #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) do { \ mtx_assert(&(inp)->inp_mtx, MA_OWNED); \ NET_ASSERT_GIANT(); \ } while (0) -#else -#define INP_LOCK_ASSERT(inp) do { \ - NET_ASSERT_GIANT(); \ -} while (0) -#endif #define INP_INFO_LOCK_INIT(ipi, d) \ mtx_init(&(ipi)->ipi_mtx, (d), NULL, MTX_DEF | MTX_RECURSE) @@ -260,7 +254,6 @@ struct inpcbinfo { /* XXX documentation, prefixes */ #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) do { \ mtx_assert(&(ipi)->ipi_mtx, MA_OWNED); \ NET_ASSERT_GIANT(); \ @@ -269,14 +262,6 @@ struct inpcbinfo { /* XXX documentation, prefixes */ mtx_assert(&(ipi)->ipi_mtx, MA_OWNED); \ NET_ASSERT_GIANT(); \ } while (0) -#else -#define INP_INFO_RLOCK_ASSERT(ipi) do { \ - NET_ASSERT_GIANT(); \ -} while (0) -#define INP_INFO_WLOCK_ASSERT(ipi) do { \ - NET_ASSERT_GIANT(); \ -} while (0) -#endif #define INP_PCBHASH(faddr, lport, fport, mask) \ (((faddr) ^ ((faddr) >> 16) ^ ntohs((lport) ^ (fport))) & (mask))