summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2010-09-23 04:45:16 +0000
committerYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2010-09-23 04:45:16 +0000
commitc7968146c8a68c46d389c2093c34be7f7ec8a3e1 (patch)
tree16b570f74f73fbe01a1ebeb26982f7ad02dbda8c
parent94ea592b142bfc79f7c619f24981de85993897dc (diff)
add a new IP level socket option IP_PIPEX. This option is used for L2TP
support by pipex. OK henning@, "Carry on" blambert@
-rw-r--r--sys/netinet/in.h3
-rw-r--r--sys/netinet/in_pcb.h3
-rw-r--r--sys/netinet/ip_output.c14
-rw-r--r--sys/netinet6/in6.h3
-rw-r--r--sys/netinet6/ip6_output.c13
5 files changed, 31 insertions, 5 deletions
diff --git a/sys/netinet/in.h b/sys/netinet/in.h
index 42ca8ab8a2e..f2161ccd4f4 100644
--- a/sys/netinet/in.h
+++ b/sys/netinet/in.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: in.h,v 1.84 2010/06/07 13:26:35 henning Exp $ */
+/* $OpenBSD: in.h,v 1.85 2010/09/23 04:45:15 yasuoka Exp $ */
/* $NetBSD: in.h,v 1.20 1996/02/13 23:41:47 christos Exp $ */
/*
@@ -280,6 +280,7 @@ struct ip_opts {
#define IP_RECVTTL 31 /* bool; receive IP TTL w/dgram */
#define IP_MINTTL 32 /* minimum TTL for packet or drop */
#define IP_RECVDSTPORT 33 /* bool; receive IP dst port w/dgram */
+#define IP_PIPEX 34 /* bool; using PIPEX */
/*
* Security levels - IPsec, not IPSO
diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h
index ac17a6d6a81..b631ec3d4f2 100644
--- a/sys/netinet/in_pcb.h
+++ b/sys/netinet/in_pcb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: in_pcb.h,v 1.69 2010/07/03 04:44:51 guenther Exp $ */
+/* $OpenBSD: in_pcb.h,v 1.70 2010/09/23 04:45:15 yasuoka Exp $ */
/* $NetBSD: in_pcb.h,v 1.14 1996/02/13 23:42:00 christos Exp $ */
/*
@@ -147,6 +147,7 @@ struct inpcb {
struct icmp6_filter *inp_icmp6filt;
void *inp_pf_sk;
u_int inp_rtableid;
+ int inp_pipex; /* pipex indication */
};
struct inpcbtable {
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 7efb8311030..506e1381465 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_output.c,v 1.212 2010/09/08 08:34:42 claudio Exp $ */
+/* $OpenBSD: ip_output.c,v 1.213 2010/09/23 04:45:15 yasuoka Exp $ */
/* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */
/*
@@ -1429,6 +1429,13 @@ ip_ctloutput(op, so, level, optname, mp)
}
inp->inp_rtableid = rtid;
break;
+ case IP_PIPEX:
+ if (m != NULL && m->m_len == sizeof(int))
+ inp->inp_pipex = *mtod(m, int *);
+ else
+ error = EINVAL;
+ break;
+
default:
error = ENOPROTOOPT;
break;
@@ -1627,6 +1634,11 @@ ip_ctloutput(op, so, level, optname, mp)
m->m_len = sizeof(u_int);
*mtod(m, u_int *) = inp->inp_rtableid;
break;
+ case IP_PIPEX:
+ *mp = m = m_get(M_WAIT, MT_SOOPTS);
+ m->m_len = sizeof(int);
+ *mtod(m, int *) = inp->inp_pipex;
+ break;
default:
error = ENOPROTOOPT;
break;
diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h
index e70268deed1..79e3d236a3b 100644
--- a/sys/netinet6/in6.h
+++ b/sys/netinet6/in6.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6.h,v 1.51 2010/07/08 19:42:46 jsg Exp $ */
+/* $OpenBSD: in6.h,v 1.52 2010/09/23 04:45:15 yasuoka Exp $ */
/* $KAME: in6.h,v 1.83 2001/03/29 02:55:07 jinmei Exp $ */
/*
@@ -477,6 +477,7 @@ struct route_in6 {
#define IPV6_TCLASS 61 /* int; send traffic class value */
#define IPV6_DONTFRAG 62 /* bool; disable IPv6 fragmentation */
+#define IPV6_PIPEX 63 /* bool; using PIPEX */
/* to define items, should talk with KAME guys first, for *BSD compatibility */
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index f1bc7e51827..0c1a2bbccf6 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_output.c,v 1.117 2010/08/07 03:50:02 krw Exp $ */
+/* $OpenBSD: ip6_output.c,v 1.118 2010/09/23 04:45:15 yasuoka Exp $ */
/* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */
/*
@@ -1709,6 +1709,12 @@ do { \
inp->inp_secrequire = get_sa_require(inp);
#endif
break;
+ case IPV6_PIPEX:
+ if (m != NULL && m->m_len == sizeof(int))
+ inp->inp_pipex = *mtod(m, int *);
+ else
+ error = EINVAL;
+ break;
default:
error = ENOPROTOOPT;
@@ -1954,6 +1960,11 @@ do { \
*mtod(m, int *) = optval;
#endif
break;
+ case IPV6_PIPEX:
+ *mp = m = m_get(M_WAIT, MT_SOOPTS);
+ m->m_len = sizeof(int);
+ *mtod(m, int *) = optval;
+ break;
default:
error = ENOPROTOOPT;