]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgp rfapi: fix resolution / lookup failure when using MPLS TT
authorLou Berger <lberger@labn.net>
Tue, 31 Jan 2017 21:42:47 +0000 (16:42 -0500)
committerLou Berger <lberger@labn.net>
Tue, 31 Jan 2017 21:42:47 +0000 (16:42 -0500)
Signed-off-by: Lou Berger <lberger@labn.net>
bgpd/rfapi/rfapi_import.c

index 4d35af2641dce607f73fe6744ee3b79d9f50d177..adb54fd0e1dc59d7c1bd0225c1ee106f80d8f484 100644 (file)
@@ -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)
     {