PERFORCE change 167259 for review

Marko Zec zec at FreeBSD.org
Wed Aug 12 20:52:40 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=167259

Change 167259 by zec at zec_tpx32 on 2009/08/12 20:51:39

	When registering new sub-domain "protocol" (i.e. defined by
	its struct protosw) via pf_proto_register(), iterate over
	all existing vnets to call that protocol's pr_init() routine.
	Calling pr_init() only in the current vnet was a bug.

Affected files ...

.. //depot/projects/vimage-commit2/src/sys/kern/uipc_domain.c#12 edit

Differences ...

==== //depot/projects/vimage-commit2/src/sys/kern/uipc_domain.c#12 (text+ko) ====

@@ -336,6 +336,7 @@
 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 @@
 	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);
 }


More information about the p4-projects mailing list