summaryrefslogtreecommitdiff
path: root/sys/kern/uipc_domain.c
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>1999-12-08 06:50:25 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>1999-12-08 06:50:25 +0000
commitd9c080e0265d3557ac6fe2d2723cf4823eaa909f (patch)
tree422a747ed77f091d33ae234312450cc5cb2aa789 /sys/kern/uipc_domain.c
parentbfa115c3a1f89cedeb913741469312347a52f8ee (diff)
bring in KAME IPv6 code, dated 19991208.
replaces NRL IPv6 layer. reuses NRL pcb layer. no IPsec-on-v6 support. see sys/netinet6/{TODO,IMPLEMENTATION} for more details. GENERIC configuration should work fine as before. GENERIC.v6 works fine as well, but you'll need KAME userland tools to play with IPv6 (will be bringed into soon).
Diffstat (limited to 'sys/kern/uipc_domain.c')
-rw-r--r--sys/kern/uipc_domain.c41
1 files changed, 34 insertions, 7 deletions
diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c
index 9d5a23865f8..3695d21f72d 100644
--- a/sys/kern/uipc_domain.c
+++ b/sys/kern/uipc_domain.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_domain.c,v 1.8 1999/03/30 00:19:05 niklas Exp $ */
+/* $OpenBSD: uipc_domain.c,v 1.9 1999/12/08 06:50:17 itojun Exp $ */
/* $NetBSD: uipc_domain.c,v 1.14 1996/02/09 19:00:44 christos Exp $ */
/*
@@ -67,9 +67,12 @@ domaininit()
register struct protosw *pr;
#undef unix
+ /*
+ * KAME NOTE: ADDDOMAIN(route) is moved to the last part so that
+ * it will be initialized as the *first* element. confusing!
+ */
#ifndef lint
ADDDOMAIN(unix);
- ADDDOMAIN(route);
#ifdef INET
ADDDOMAIN(inet);
#endif
@@ -100,6 +103,12 @@ domaininit()
ADDDOMAIN(imp);
#endif
#endif
+#ifdef IPSEC
+#ifdef __KAME__
+ ADDDOMAIN(key);
+#endif
+#endif
+ ADDDOMAIN(route);
#endif
for (dp = domains; dp; dp = dp->dom_next) {
@@ -177,14 +186,15 @@ net_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
int family, protocol;
/*
- * All sysctl names at this level are nonterminal;
- * next two components are protocol family and protocol number,
- * then at least one addition component.
+ * All sysctl names at this level are nonterminal.
+ * PF_KEY: next component is protocol family, and then at least one
+ * additional component.
+ * usually: next two components are protocol family and protocol
+ * number, then at least one addition component.
*/
- if (namelen < 3)
+ if (namelen < 2)
return (EISDIR); /* overloaded */
family = name[0];
- protocol = name[1];
if (family == 0)
return (0);
@@ -193,6 +203,23 @@ net_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
goto found;
return (ENOPROTOOPT);
found:
+ switch (family) {
+#ifdef IPSEC
+#ifdef __KAME__
+ case PF_KEY:
+ pr = dp->dom_protosw;
+ if (pr->pr_sysctl)
+ return ((*pr->pr_sysctl)(name + 1, namelen - 1,
+ oldp, oldlenp, newp, newlen));
+ return (ENOPROTOOPT);
+#endif
+#endif
+ default:
+ break;
+ }
+ if (namelen < 3)
+ return (EISDIR); /* overloaded */
+ protocol = name[1];
for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
if (pr->pr_protocol == protocol && pr->pr_sysctl)
return ((*pr->pr_sysctl)(name + 2, namelen - 2,