From 2ef40e3ef7415e30cd9826682bf4b21b93f22eff Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Sat, 10 Feb 2018 08:12:02 +0000 Subject: rework gif to be more consistent. while here, give us support for mpls in gif on ipv6. this moves all the gif handling into if_gif, eg, the mpls handling is no longer in ip_etherip.c. ok claudio@ --- sys/netinet6/in6_proto.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'sys/netinet6/in6_proto.c') diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c index 1435acc15c0..3be98fd1b9a 100644 --- a/sys/netinet6/in6_proto.c +++ b/sys/netinet6/in6_proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_proto.c,v 1.101 2018/02/07 22:30:59 dlg Exp $ */ +/* $OpenBSD: in6_proto.c,v 1.102 2018/02/10 08:12:01 dlg Exp $ */ /* $KAME: in6_proto.c,v 1.66 2000/10/10 15:35:47 itojun Exp $ */ /* @@ -97,7 +97,6 @@ #include "gif.h" #if NGIF > 0 -#include #include #endif @@ -277,6 +276,23 @@ const struct protosw inet6sw[] = { .pr_attach = rip6_attach, .pr_detach = rip6_detach, }, +#if defined(MPLS) && NGIF > 0 +{ + .pr_type = SOCK_RAW, + .pr_domain = &inet6domain, + .pr_protocol = IPPROTO_MPLS, + .pr_flags = PR_ATOMIC|PR_ADDR, +#if NGIF > 0 + .pr_input = in6_gif_input, +#else + .pr_input = ipip_input, +#endif + .pr_ctloutput = rip6_ctloutput, + .pr_usrreq = rip6_usrreq, /* XXX */ + .pr_attach = rip6_attach, + .pr_detach = rip6_detach, +}, +#endif /* MPLS */ #if NCARP > 0 { .pr_type = SOCK_RAW, -- cgit v1.2.3