From bc818608f1d95dcc775a4fb1861f43e734d79f09 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 4d35af2641..adb54fd0e1 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) {