summaryrefslogtreecommitdiff
path: root/sys/netmpls
diff options
context:
space:
mode:
authorJeremie Courreges-Anglas <jca@cvs.openbsd.org>2018-01-12 06:57:57 +0000
committerJeremie Courreges-Anglas <jca@cvs.openbsd.org>2018-01-12 06:57:57 +0000
commit81ec95545fc0a3003b9fcc0cb4557b47df3f2805 (patch)
tree1edb7158a13b11372f1370d062863a168ecaa6da /sys/netmpls
parenteac606dae07fa300f178b2b75e6c99f5ffb6cba7 (diff)
Check that mpls has been enabled on the input interface, lost in rev 1.66
While here fix under MPLS_DEBUG. ok dlg@
Diffstat (limited to 'sys/netmpls')
-rw-r--r--sys/netmpls/mpls_input.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/netmpls/mpls_input.c b/sys/netmpls/mpls_input.c
index 68f333aaf59..693247b88ba 100644
--- a/sys/netmpls/mpls_input.c
+++ b/sys/netmpls/mpls_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpls_input.c,v 1.67 2018/01/10 00:05:06 dlg Exp $ */
+/* $OpenBSD: mpls_input.c,v 1.68 2018/01/12 06:57:56 jca Exp $ */
/*
* Copyright (c) 2008 Claudio Jeker <claudio@openbsd.org>
@@ -63,6 +63,11 @@ mpls_input(struct ifnet *ifp, struct mbuf *m)
uint8_t ttl;
int hasbos;
+ if (!ISSET(ifp->if_xflags, IFXF_MPLS)) {
+ m_freem(m);
+ return;
+ }
+
/* drop all broadcast and multicast packets */
if (m->m_flags & (M_BCAST | M_MCAST)) {
m_freem(m);
@@ -79,7 +84,7 @@ mpls_input(struct ifnet *ifp, struct mbuf *m)
#ifdef MPLS_DEBUG
printf("mpls_input: iface %s label=%d, ttl=%d BoS %d\n",
ifp->if_xname, MPLS_LABEL_GET(shim->shim_label),
- MPLS_TTL_GET(shim->shim_label,
+ MPLS_TTL_GET(shim->shim_label),
MPLS_BOS_ISSET(shim->shim_label));
#endif