summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_domain.c
diff options
context:
space:
mode:
authoritojun <itojun@openbsd.org>1999-12-08 06:50:14 +0000
committeritojun <itojun@openbsd.org>1999-12-08 06:50:14 +0000
commit287546ea80ee896bda0c88b8a8c85a1dc6ff37f9 (patch)
treecef428e54b6d2bca56fb9b461aa0667c7fb5f6a2 /sys/kern/uipc_domain.c
parentadd GENERIC.v6 (IPv6 test configuration). to be integrated into GENREIC. (diff)
downloadwireguard-openbsd-287546ea80ee896bda0c88b8a8c85a1dc6ff37f9.tar.xz
wireguard-openbsd-287546ea80ee896bda0c88b8a8c85a1dc6ff37f9.zip
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,