summaryrefslogtreecommitdiff
path: root/sys/kern/uipc_domain.c
diff options
context:
space:
mode:
authorMarko Zec <zec@FreeBSD.org>2009-06-08 17:15:40 +0000
committerMarko Zec <zec@FreeBSD.org>2009-06-08 17:15:40 +0000
commitbc29160df3d0b3a65d9b85a63a4589f1f9652e6b (patch)
tree7c00057a3f90cc6cfd121e2a6594d254fc72cba3 /sys/kern/uipc_domain.c
parent389cff511328e788e1a71dbb78154dd7d21b5fcc (diff)
downloadsrc-test2-bc29160df3d0b3a65d9b85a63a4589f1f9652e6b.tar.gz
src-test2-bc29160df3d0b3a65d9b85a63a4589f1f9652e6b.zip
Notes
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 df35bcbce5c7..9ee6047dd2ea 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.