summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2010-05-11 09:22:57 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2010-05-11 09:22:57 +0000
commit432ff65a43723f8e2fd5ab2922f37dbdaf16bed3 (patch)
tree3077063934c1fac321c57d824ebea13f1700ddf1 /sys
parent011385e6acf27bd8b2fdf46cf99f6cc511375420 (diff)
Add support for MPLS in GRE. Fairly trivial and a NOP unless option MPLS
is defined.
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if_gre.c10
-rw-r--r--sys/netinet/ip_gre.c16
2 files changed, 23 insertions, 3 deletions
diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c
index a022a3295e9..fde4de2c306 100644
--- a/sys/net/if_gre.c
+++ b/sys/net/if_gre.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_gre.c,v 1.47 2010/05/07 13:33:16 claudio Exp $ */
+/* $OpenBSD: if_gre.c,v 1.48 2010/05/11 09:22:56 claudio Exp $ */
/* $NetBSD: if_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */
/*
@@ -377,6 +377,14 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
etype = ETHERTYPE_IPV6;
break;
#endif
+#ifdef MPLS
+ case AF_MPLS:
+ if (m->m_flags & (M_BCAST | M_MCAST))
+ etype = ETHERTYPE_MPLS_MCAST;
+ else
+ etype = ETHERTYPE_MPLS;
+ break;
+#endif
default:
IF_DROP(&ifp->if_snd);
m_freem(m);
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);
}