+ struct ip6protosw *pr;
+ int i;
+
+ VERIFY(!(dp->dom_flags & DOM_INITIALIZED));
+ VERIFY(inet6domain == NULL);
+
+ inet6domain = dp;
+
+ _CASSERT(sizeof (struct protosw) == sizeof (struct ip6protosw));
+ _CASSERT(offsetof(struct ip6protosw, pr_entry) ==
+ offsetof(struct protosw, pr_entry));
+ _CASSERT(offsetof(struct ip6protosw, pr_domain) ==
+ offsetof(struct protosw, pr_domain));
+ _CASSERT(offsetof(struct ip6protosw, pr_protosw) ==
+ offsetof(struct protosw, pr_protosw));
+ _CASSERT(offsetof(struct ip6protosw, pr_type) ==
+ offsetof(struct protosw, pr_type));
+ _CASSERT(offsetof(struct ip6protosw, pr_protocol) ==
+ offsetof(struct protosw, pr_protocol));
+ _CASSERT(offsetof(struct ip6protosw, pr_flags) ==
+ offsetof(struct protosw, pr_flags));
+ _CASSERT(offsetof(struct ip6protosw, pr_input) ==
+ offsetof(struct protosw, pr_input));
+ _CASSERT(offsetof(struct ip6protosw, pr_output) ==
+ offsetof(struct protosw, pr_output));
+ _CASSERT(offsetof(struct ip6protosw, pr_ctlinput) ==
+ offsetof(struct protosw, pr_ctlinput));
+ _CASSERT(offsetof(struct ip6protosw, pr_ctloutput) ==
+ offsetof(struct protosw, pr_ctloutput));
+ _CASSERT(offsetof(struct ip6protosw, pr_usrreqs) ==
+ offsetof(struct protosw, pr_usrreqs));
+ _CASSERT(offsetof(struct ip6protosw, pr_init) ==
+ offsetof(struct protosw, pr_init));
+ _CASSERT(offsetof(struct ip6protosw, pr_drain) ==
+ offsetof(struct protosw, pr_drain));
+ _CASSERT(offsetof(struct ip6protosw, pr_sysctl) ==
+ offsetof(struct protosw, pr_sysctl));
+ _CASSERT(offsetof(struct ip6protosw, pr_lock) ==
+ offsetof(struct protosw, pr_lock));
+ _CASSERT(offsetof(struct ip6protosw, pr_unlock) ==
+ offsetof(struct protosw, pr_unlock));
+ _CASSERT(offsetof(struct ip6protosw, pr_getlock) ==
+ offsetof(struct protosw, pr_getlock));
+ _CASSERT(offsetof(struct ip6protosw, pr_filter_head) ==
+ offsetof(struct protosw, pr_filter_head));
+ _CASSERT(offsetof(struct ip6protosw, pr_old) ==
+ offsetof(struct protosw, pr_old));
+
+ /*
+ * Attach first, then initialize. ip6_init() needs raw IP6 handler.
+ */
+ for (i = 0, pr = &inet6sw[0]; i < in6_proto_count; i++, pr++)
+ net_add_proto((struct protosw *)pr, dp, 0);
+ for (i = 0, pr = &inet6sw[0]; i < in6_proto_count; i++, pr++)
+ net_init_proto((struct protosw *)pr, dp);
+
+ inet6_domain_mutex = dp->dom_mtx;