From 17bcaad841f4f420ce441cfd2a471e0a385afb0b Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 11 Aug 2023 11:17:29 -0400 Subject: [PATCH] zebra: Use the re->metric instead of 0 for zebra_rmap_obj The zebra_rmap_obj was storing the re->metric and allowing matches against it, but in most cases it was just using 0. Use the Route entries metric instead. This should fix some bugs where a match metric never worked. Signed-off-by: Donald Sharp --- zebra/zebra_routemap.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c index f5c194fe3f..7e17cff2d5 100644 --- a/zebra/zebra_routemap.c +++ b/zebra/zebra_routemap.c @@ -34,7 +34,6 @@ char *zebra_import_table_routemap[AFI_MAX][ZEBRA_KERNEL_TABLE_MAX]; struct zebra_rmap_obj { struct nexthop *nexthop; struct route_entry *re; - int metric; route_tag_t tag; }; @@ -1770,7 +1769,6 @@ route_map_result_t zebra_route_map_check(afi_t family, struct route_entry *re, rm_obj.nexthop = nexthop; rm_obj.re = re; - rm_obj.metric = 0; rm_obj.tag = tag; if (re->type >= 0 && re->type < ZEBRA_ROUTE_MAX) { @@ -1821,7 +1819,6 @@ route_map_result_t zebra_import_table_route_map_check( rm_obj.nexthop = nexthop; rm_obj.re = re; - rm_obj.metric = 0; rm_obj.tag = tag; if (re->type >= 0 && re->type < ZEBRA_ROUTE_MAX) @@ -1845,7 +1842,6 @@ route_map_result_t zebra_nht_route_map_check(afi_t afi, int client_proto, rm_obj.nexthop = nexthop; rm_obj.re = re; - rm_obj.metric = re->metric; rm_obj.tag = re->tag; if (client_proto >= 0 && client_proto < ZEBRA_ROUTE_MAX) -- 2.39.5