summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_gre.c
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2010-05-11 09:22:56 +0000
committerclaudio <claudio@openbsd.org>2010-05-11 09:22:56 +0000
commit59d43c6acbe278f124304b12ee00d4a3aa63a6ab (patch)
treefd487a126374328af74f3fa683e411651dffd960 /sys/netinet/ip_gre.c
parentdon't accept certificates marked as "cert-authority" here; ok markus@ (diff)
downloadwireguard-openbsd-59d43c6acbe278f124304b12ee00d4a3aa63a6ab.tar.xz
wireguard-openbsd-59d43c6acbe278f124304b12ee00d4a3aa63a6ab.zip
Add support for MPLS in GRE. Fairly trivial and a NOP unless option MPLS
is defined.
Diffstat (limited to 'sys/netinet/ip_gre.c')
-rw-r--r--sys/netinet/ip_gre.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/sys/netinet/ip_gre.c b/sys/netinet/ip_gre.c
index cafb7b8eaec..a0652b1ed3c 100644
--- a/sys/netinet/ip_gre.c
+++ b/sys/netinet/ip_gre.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_gre.c,v 1.36 2010/04/20 22:05:43 tedu Exp $ */
+/* $OpenBSD: ip_gre.c,v 1.37 2010/05/11 09:22:56 claudio Exp $ */
/* $NetBSD: ip_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */
/*
@@ -72,6 +72,10 @@
#include <netatalk/at_extern.h>
#endif
+#ifdef MPLS
+#include <netmpls/mpls.h>
+#endif
+
#include "bpfilter.h"
#include "pf.h"
@@ -182,7 +186,15 @@ gre_input2(m , hlen, proto)
schednetisr(NETISR_IPV6);
af = AF_INET6;
break;
-#endif /* INET6 */
+#endif
+#ifdef MPLS
+ case ETHERTYPE_MPLS:
+ case ETHERTYPE_MPLS_MCAST:
+ ifq = &mplsintrq;
+ schednetisr(NETISR_MPLS);
+ af = AF_MPLS;
+ break;
+#endif
default: /* others not yet supported */
return (0);
}