From 2bac83383f38d6c6831272c9f331b16c5568f37f Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Fri, 28 May 2010 12:09:11 +0000 Subject: Rework the way we handle MPLS in the kernel. Instead of fumbling MPLS into ether_output() and later on other L2 output functions use a trick and over- load the ifp->if_output() function pointer on MPLS enabled interfaces to go through mpls_output() which will then call the link level output function. By setting IFXF_MPLS on an interface the output pointers are switched. This now allows to cleanup the MPLS input and output pathes and fix mpe(4) so that the MPLS code now actually works for both P and PE systems. Tested by myself and michele (A custom kernel with MPLS and mpe enabled is still needed). --- sys/net/if.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sys/net/if.h') diff --git a/sys/net/if.h b/sys/net/if.h index 4f8d0ad24a0..9df697c3341 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if.h,v 1.115 2010/04/17 17:46:32 deraadt Exp $ */ +/* $OpenBSD: if.h,v 1.116 2010/05/28 12:09:09 claudio Exp $ */ /* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */ /* @@ -266,6 +266,10 @@ struct ifnet { /* and the entries */ /* output routine (enqueue) */ int (*if_output)(struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *); + + /* link level output function */ + int (*if_ll_output)(struct ifnet *, struct mbuf *, + struct sockaddr *, struct rtentry *); /* initiate output routine */ void (*if_start)(struct ifnet *); /* ioctl routine */ @@ -326,6 +330,7 @@ struct ifnet { /* and the entries */ #define IFXF_TXREADY 0x1 /* interface is ready to tx */ #define IFXF_NOINET6 0x2 /* don't do inet6 */ #define IFXF_INET6_PRIVACY 0x4 /* autoconf privacy extension */ +#define IFXF_MPLS 0x8 /* supports MPLS */ #define IFXF_CANTCHANGE \ (IFXF_TXREADY) -- cgit v1.2.3