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
This commit is contained in:
parent
a995cd062d
commit
7b5545dea0
@ -336,6 +336,7 @@ pffindproto(int family, int protocol, int type)
|
||||
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 @@ pf_proto_register(int family, struct protosw *npr)
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user