From: Lou Berger Date: Tue, 31 Jan 2017 21:42:47 +0000 (-0500) Subject: bgp rfapi: fix resolution / lookup failure when using MPLS TT X-Git-Tag: frr-3.0-branchpoint~55^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=90dc8d1ba5861e91bc99f2bda8319091ba0dbd23;p=matthieu%2Ffrr.git bgp rfapi: fix resolution / lookup failure when using MPLS TT Signed-off-by: Lou Berger --- 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) {