]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Use the re->metric instead of 0 for zebra_rmap_obj
authorDonald Sharp <sharpd@nvidia.com>
Fri, 11 Aug 2023 15:17:29 +0000 (11:17 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Fri, 11 Aug 2023 15:17:29 +0000 (11:17 -0400)
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 <sharpd@nvidia.com>
zebra/zebra_routemap.c

index f5c194fe3f774a2513ec5c5f59aec2c705fc7ba5..7e17cff2d52016c1a84962ca8d0085dc60d60875 100644 (file)
@@ -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)