From 90dc8d1ba5861e91bc99f2bda8319091ba0dbd23 Mon Sep 17 00:00:00 2001 From: Lou Berger Date: Tue, 31 Jan 2017 16:42:47 -0500 Subject: [PATCH] bgp rfapi: fix resolution / lookup failure when using MPLS TT Signed-off-by: Lou Berger --- bgpd/rfapi/rfapi_import.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bgpd/rfapi/rfapi_import.c b/bgpd/rfapi/rfapi_import.c index 8e68eec53a..9ae3311e15 100644 --- a/bgpd/rfapi/rfapi_import.c +++ b/bgpd/rfapi/rfapi_import.c @@ -421,9 +421,16 @@ rfapiGetVncTunnelUnAddr (struct attr *attr, struct prefix *p) bgp_encap_types tun_type; rfapiGetTunnelType (attr, &tun_type); - if (p && tun_type == BGP_ENCAP_TYPE_MPLS) + if (tun_type == BGP_ENCAP_TYPE_MPLS) { - return ENOENT; /* no UN for MPLS */ + if (!p) + return 0; + /* MPLS carries UN address in next hop */ + rfapiNexthop2Prefix (attr, p); + if (p->family != 0) + return 0; + + return ENOENT; } if (attr && attr->extra) { -- 2.39.5