summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_socket.c
diff options
context:
space:
mode:
authormlaier <mlaier@FreeBSD.org>2004-11-30 22:28:50 +0000
committermlaier <mlaier@FreeBSD.org>2004-11-30 22:28:50 +0000
commitea0fd1c0832b6eab6bd5fefdb7bdf0ecc2a8cbfc (patch)
tree6e2b676b526d669f63da6f72fd588dff176a3ccf /sys/netgraph/ng_socket.c
parentc701aac0d68d8ed97ee0b295d672716d1e7c3dc2 (diff)
downloadFreeBSD-src-ea0fd1c0832b6eab6bd5fefdb7bdf0ecc2a8cbfc.zip
FreeBSD-src-ea0fd1c0832b6eab6bd5fefdb7bdf0ecc2a8cbfc.tar.gz
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)
Diffstat (limited to 'sys/netgraph/ng_socket.c')
-rw-r--r--sys/netgraph/ng_socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netgraph/ng_socket.c b/sys/netgraph/ng_socket.c
index 8f2ea53..cd8a7ff 100644
--- a/sys/netgraph/ng_socket.c
+++ b/sys/netgraph/ng_socket.c
@@ -143,7 +143,7 @@ static struct ng_type typestruct = {
.rcvdata = ngs_rcvdata,
.disconnect = ngs_disconnect,
};
-NETGRAPH_INIT(socket, &typestruct);
+NETGRAPH_INIT_ORDERED(socket, &typestruct, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY);
/* Buffer space */
static u_long ngpdg_sendspace = 20 * 1024; /* really max datagram size */
OpenPOWER on IntegriCloud