summaryrefslogtreecommitdiff
path: root/sys/net/if_ethersubr.c
diff options
context:
space:
mode:
authorMichele Marchetto <michele@cvs.openbsd.org>2009-01-28 22:18:45 +0000
committerMichele Marchetto <michele@cvs.openbsd.org>2009-01-28 22:18:45 +0000
commit7227a1f7a8d21a364dce2ce2e513c4e0826f0655 (patch)
tree53b778afc500a2b1c3a9d76a056b3dad0f2ef05a /sys/net/if_ethersubr.c
parentcc411b2e1c4c556ba9e319f50cf1c1422f56db9d (diff)
Get rid of the ugly rtentry hack.
We can now act as edge node and allow ipv4 packets to enter a Label Switched Path and not just forwarding MPLS packets. OK claudio@
Diffstat (limited to 'sys/net/if_ethersubr.c')
-rw-r--r--sys/net/if_ethersubr.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 4e95bdc2796..34e91cedcd5 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ethersubr.c,v 1.130 2008/11/25 12:07:55 claudio Exp $ */
+/* $OpenBSD: if_ethersubr.c,v 1.131 2009/01/28 22:18:43 michele Exp $ */
/* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */
/*
@@ -263,6 +263,12 @@ ether_output(ifp0, m0, dst, rt0)
else
senderr(EHOSTUNREACH);
}
+#ifdef MPLS
+ if (rt->rt_flags & RTF_MPLS) {
+ if ((m = mpls_output(m, rt)) == NULL)
+ senderr(EHOSTUNREACH);
+ }
+#endif
if (rt->rt_flags & RTF_GATEWAY) {
if (rt->rt_gwroute == 0)
goto lookup;
@@ -289,7 +295,12 @@ ether_output(ifp0, m0, dst, rt0)
if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX) &&
!m->m_pkthdr.pf.routed)
mcopy = m_copy(m, 0, (int)M_COPYALL);
- etype = htons(ETHERTYPE_IP);
+#ifdef MPLS
+ if (rt0->rt_flags & RTF_MPLS)
+ etype = htons(ETHERTYPE_MPLS);
+ else
+#endif
+ etype = htons(ETHERTYPE_IP);
break;
#endif
#ifdef INET6