summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_output.c
diff options
context:
space:
mode:
authoryasuoka <yasuoka@openbsd.org>2010-09-23 04:45:15 +0000
committeryasuoka <yasuoka@openbsd.org>2010-09-23 04:45:15 +0000
commite30e1ee7d69bd7e7b6c0dc5a41ba9ada4abae7e3 (patch)
treead95023fe104d5954588a171e5f8fe09d7312bf4 /sys/netinet/ip_output.c
parentremove support for talking to the zebra routing socket which (diff)
downloadwireguard-openbsd-e30e1ee7d69bd7e7b6c0dc5a41ba9ada4abae7e3.tar.xz
wireguard-openbsd-e30e1ee7d69bd7e7b6c0dc5a41ba9ada4abae7e3.zip
add a new IP level socket option IP_PIPEX. This option is used for L2TP
support by pipex. OK henning@, "Carry on" blambert@
Diffstat (limited to 'sys/netinet/ip_output.c')
-rw-r--r--sys/netinet/ip_output.c14
1 files changed, 13 insertions, 1 deletions
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;