Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Aug 2009 10:03:41 +0000 (UTC)
From:      Marko Zec <zec@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r196501 - head/sys/kern
Message-ID:  <200908241003.n7OA3fi2089055@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: zec
Date: Mon Aug 24 10:03:41 2009
New Revision: 196501
URL: http://svn.freebsd.org/changeset/base/196501

Log:
  When registering a protocol to an existing protocol domain via
  pf_proto_register(), iterate over all existing vnets to call protosw_init()
  and thus the appropriate .pr_init() handler in the context of each vnet.
  NB in the future we probably want to separate pr_init() handlers into
  two, i.e. per-vnet and global, functions.
  
  This change has no impact on nooptions VIMAGE builds.
  
  Approved by:	re (rwatson), julian (mentor)
  MFC after:	3 days

Modified:
  head/sys/kern/uipc_domain.c

Modified: head/sys/kern/uipc_domain.c
==============================================================================
--- head/sys/kern/uipc_domain.c	Mon Aug 24 09:17:01 2009	(r196500)
+++ head/sys/kern/uipc_domain.c	Mon Aug 24 10:03:41 2009	(r196501)
@@ -336,6 +336,7 @@ found:
 int
 pf_proto_register(int family, struct protosw *npr)
 {
+	VNET_ITERATOR_DECL(vnet_iter);
 	struct domain *dp;
 	struct protosw *pr, *fpr;
 
@@ -391,7 +392,13 @@ found:
 	mtx_unlock(&dom_mtx);
 
 	/* Initialize and activate the protocol. */
-	protosw_init(fpr);
+	VNET_LIST_RLOCK();
+	VNET_FOREACH(vnet_iter) {
+		CURVNET_SET_QUIET(vnet_iter);
+		protosw_init(fpr);
+		CURVNET_RESTORE();
+	}
+	VNET_LIST_RUNLOCK();
 
 	return (0);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908241003.n7OA3fi2089055>