summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_domain.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/uipc_domain.c')
-rw-r--r--sys/kern/uipc_domain.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c
index df35bcb..9ee6047 100644
--- a/sys/kern/uipc_domain.c
+++ b/sys/kern/uipc_domain.c
@@ -66,6 +66,9 @@ SYSINIT(domainfin, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_FIRST, domainfinalize,
NULL);
static vnet_attach_fn net_init_domain;
+#ifdef VIMAGE
+static vnet_detach_fn net_detach_domain;
+#endif
static struct callout pffast_callout;
static struct callout pfslow_callout;
@@ -107,7 +110,10 @@ struct pr_usrreqs nousrreqs = {
vnet_modinfo_t vnet_domain_modinfo = {
.vmi_id = VNET_MOD_DOMAIN,
.vmi_name = "domain",
- .vmi_iattach = net_init_domain
+ .vmi_iattach = net_init_domain,
+#ifdef VIMAGE
+ .vmi_idetach = net_detach_domain,
+#endif
};
#endif
@@ -190,6 +196,26 @@ net_init_domain(const void *arg)
return (0);
}
+#ifdef VIMAGE
+/*
+ * Detach / free a domain instance.
+ */
+static int
+net_detach_domain(const void *arg)
+{
+ const struct domain *dp = arg;
+ struct protosw *pr;
+
+ for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
+ if (pr->pr_destroy)
+ (*pr->pr_destroy)();
+ if (dp->dom_destroy)
+ (*dp->dom_destroy)();
+
+ return (0);
+}
+#endif
+
/*
* Add a new protocol domain to the list of supported domains
* Note: you cant unload it again because a socket may be using it.
OpenPOWER on IntegriCloud