summaryrefslogtreecommitdiffstats
path: root/sys/net/if_var.h
diff options
context:
space:
mode:
authorhsu <hsu@FreeBSD.org>2002-12-27 00:24:35 +0000
committerhsu <hsu@FreeBSD.org>2002-12-27 00:24:35 +0000
commitda4baeac50574ca93ca24b64d5a9978e22c7c7d0 (patch)
tree3eda98e95509c3f1493f087fe279aef4b367fe6d /sys/net/if_var.h
parent516da34ba853095036b78392ecdb96c408955bd6 (diff)
downloadFreeBSD-src-da4baeac50574ca93ca24b64d5a9978e22c7c7d0.zip
FreeBSD-src-da4baeac50574ca93ca24b64d5a9978e22c7c7d0.tar.gz
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.
Diffstat (limited to 'sys/net/if_var.h')
-rw-r--r--sys/net/if_var.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index fa4082b..ebd3e66 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()
OpenPOWER on IntegriCloud