Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Aug 2009 20:52:38 GMT
From:      Marko Zec <zec@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 167259 for review
Message-ID:  <200908122052.n7CKqcZG056080@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=167259

Change 167259 by zec@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);
 }



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