diff options
author | zec <zec@FreeBSD.org> | 2009-08-24 10:03:41 +0000 |
---|---|---|
committer | zec <zec@FreeBSD.org> | 2009-08-24 10:03:41 +0000 |
commit | 7b5545dea038063a9bf4669788c65aec9feddb25 (patch) | |
tree | 5e9c5b3131a572dbed5d5d48a8c6dfcee63a0894 | |
parent | a995cd062d6283935c9ebc9991e10ebde7c7cb59 (diff) | |
download | FreeBSD-src-7b5545dea038063a9bf4669788c65aec9feddb25.zip FreeBSD-src-7b5545dea038063a9bf4669788c65aec9feddb25.tar.gz |
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
-rw-r--r-- | sys/kern/uipc_domain.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c index 257e9fa..0d5043e 100644 --- a/sys/kern/uipc_domain.c +++ b/sys/kern/uipc_domain.c @@ -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); } |