From: jca Date: Fri, 12 Jan 2018 06:57:56 +0000 (+0000) Subject: Check that mpls has been enabled on the input interface, lost in rev 1.66 X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=02a95700629bdb921ddc5fc81b355b414ba68e8e;p=openbsd Check that mpls has been enabled on the input interface, lost in rev 1.66 While here fix under MPLS_DEBUG. ok dlg@ --- 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 @@ -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