From c919b1e24b6a95578afc29c47b28869bb5fb6dd6 Mon Sep 17 00:00:00 2001 From: Jeffrey Hsu Date: Fri, 27 Dec 2002 00:24:35 +0000 Subject: [PATCH] Long chain of calls starting with bridge_on(), going through IPv6, and ending up at ifa_ifwithdstaddr() could lead to a recursive lock of the ifnet list mutex. --- sys/net/if_var.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/net/if_var.h b/sys/net/if_var.h index fa4082baaece..ebd3e668579c 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -411,7 +411,8 @@ struct ifmultiaddr { } while (0) extern struct mtx ifnet_lock; -#define IFNET_LOCK_INIT() mtx_init(&ifnet_lock, "ifnet", NULL, MTX_DEF) +#define IFNET_LOCK_INIT() \ + mtx_init(&ifnet_lock, "ifnet", NULL, MTX_DEF | MTX_RECURSE) #define IFNET_WLOCK() mtx_lock(&ifnet_lock) #define IFNET_WUNLOCK() mtx_unlock(&ifnet_lock) #define IFNET_RLOCK() IFNET_WLOCK()