summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/netmpls/mpls_input.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/netmpls/mpls_input.c b/sys/netmpls/mpls_input.c
index 093d662246e..4dac4616ed4 100644
--- a/sys/netmpls/mpls_input.c
+++ b/sys/netmpls/mpls_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpls_input.c,v 1.73 2019/01/27 05:13:04 dlg Exp $ */
+/* $OpenBSD: mpls_input.c,v 1.74 2019/01/29 23:36:35 dlg Exp $ */
/*
* Copyright (c) 2008 Claudio Jeker <claudio@openbsd.org>
@@ -167,7 +167,7 @@ do_v6:
ifp = NULL;
rt = rtalloc(smplstosa(smpls), RT_RESOLVE, m->m_pkthdr.ph_rtableid);
- if (rt == NULL) {
+ if (!rtisvalid(rt)) {
/* no entry for this label */
#ifdef MPLS_DEBUG
printf("MPLS_DEBUG: label not found\n");
@@ -389,7 +389,8 @@ mpls_do_error(struct mbuf *m, int type, int code, int destmtu)
smpls->smpls_label = shim->shim_label & MPLS_LABEL_MASK;
rt = rtalloc(smplstosa(smpls), RT_RESOLVE, 0);
- if (rt == NULL) {
+ if (!rtisvalid(rt)) {
+ rtfree(rt);
/* no entry for this label */
m_freem(m);
return (NULL);