From e132dea0643499187cc51a332fd6616ee6df387c Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Thu, 8 Aug 2019 13:56:39 -0300 Subject: zebra: identify MPLS FTNs by route type and instance Use the route type and instance instead of the route distance to identify MPLS FTNs. This is a more robust approach since the routing daemons can modify the distance of their announced routes via configuration, which can cause inconsistencies. Signed-off-by: Renato Westphal --- zebra/zebra_mpls.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'zebra/zebra_mpls.c') diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c index 5214f1f22d..897c525949 100644 --- a/zebra/zebra_mpls.c +++ b/zebra/zebra_mpls.c @@ -2542,8 +2542,8 @@ static bool mpls_ftn_update_nexthop(int add, struct nexthop *nexthop, */ int mpls_ftn_update(int add, struct zebra_vrf *zvrf, enum lsp_types_t type, struct prefix *prefix, enum nexthop_types_t gtype, - union g_addr *gate, ifindex_t ifindex, uint8_t distance, - mpls_label_t out_label) + union g_addr *gate, ifindex_t ifindex, uint8_t route_type, + unsigned short route_instance, mpls_label_t out_label) { struct route_table *table; struct route_node *rn; @@ -2562,7 +2562,7 @@ int mpls_ftn_update(int add, struct zebra_vrf *zvrf, enum lsp_types_t type, RNODE_FOREACH_RE (rn, re) { if (CHECK_FLAG(re->status, ROUTE_ENTRY_REMOVED)) continue; - if (re->distance == distance) + if (re->type == route_type && re->instance == route_instance) break; } -- cgit v1.2.3