From ea0fd1c0832b6eab6bd5fefdb7bdf0ecc2a8cbfc Mon Sep 17 00:00:00 2001 From: mlaier Date: Tue, 30 Nov 2004 22:28:50 +0000 Subject: Move ng_socket and ng_btsocket initialization to SI_SUB_PROTO_DOMAIN as they call net_add_domain(). Calling this function too early (or late) breaks assertations about the global domains list. Actually it should be forbidden to call net_add_domain() outside of SI_SUB_PROTO_DOMAIN completely as there are many places where we traverse the domains list unprotected, but for now we allow late calls (mostly to support netgraph). In order to really fix this we have to lock the domains list in all places or find another way to ensure that we can safely walk the list while another thread might be adding a new domain. Spotted by: se Reviewed by: julian, glebius PR: kern/73321 (partly) --- sys/netgraph/bluetooth/socket/ng_btsocket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/netgraph/bluetooth/socket') diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket.c b/sys/netgraph/bluetooth/socket/ng_btsocket.c index e956315..21ae63c 100644 --- a/sys/netgraph/bluetooth/socket/ng_btsocket.c +++ b/sys/netgraph/bluetooth/socket/ng_btsocket.c @@ -234,7 +234,8 @@ static moduledata_t ng_btsocket_mod = { NULL }; -DECLARE_MODULE(ng_btsocket, ng_btsocket_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); +DECLARE_MODULE(ng_btsocket, ng_btsocket_mod, SI_SUB_PROTO_DOMAIN, + SI_ORDER_ANY); MODULE_VERSION(ng_btsocket, NG_BLUETOOTH_VERSION); MODULE_DEPEND(ng_btsocket, ng_bluetooth, NG_BLUETOOTH_VERSION, NG_BLUETOOTH_VERSION, NG_BLUETOOTH_VERSION); -- cgit v1.1