summaryrefslogtreecommitdiff
path: root/sys/net/if.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index a2551c31fa5..5355948366e 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.215 2010/05/08 11:07:20 stsp Exp $ */
+/* $OpenBSD: if.c,v 1.216 2010/05/28 12:09:09 claudio Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -107,6 +107,10 @@
#include <netinet6/ip6_var.h>
#endif
+#ifdef MPLS
+#include <netmpls/mpls.h>
+#endif
+
#if NBPFILTER > 0
#include <net/bpf.h>
#endif
@@ -1346,6 +1350,26 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p)
}
#endif
+#ifdef MPLS
+ if (ISSET(ifr->ifr_flags, IFXF_MPLS) &&
+ !ISSET(ifp->if_xflags, IFXF_MPLS)) {
+ int s = splnet();
+ ifp->if_xflags |= IFXF_MPLS;
+ ifp->if_ll_output = ifp->if_output;
+ ifp->if_output = mpls_output;
+ splx(s);
+ }
+ if (ISSET(ifp->if_xflags, IFXF_MPLS) &&
+ !ISSET(ifr->ifr_flags, IFXF_MPLS)) {
+ int s = splnet();
+ ifp->if_xflags &= ~IFXF_MPLS;
+ ifp->if_output = ifp->if_ll_output;
+ ifp->if_ll_output = NULL;
+ splx(s);
+ }
+#endif
+
+
ifp->if_xflags = (ifp->if_xflags & IFXF_CANTCHANGE) |
(ifr->ifr_flags &~ IFXF_CANTCHANGE);
rt_ifmsg(ifp);