]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospfd: Route-tag is not set to external lsas when applying with rmap
authorrgirada <rgirada@vmware.com>
Mon, 18 May 2020 04:40:48 +0000 (21:40 -0700)
committerrgirada <rgirada@vmware.com>
Mon, 18 May 2020 04:40:48 +0000 (21:40 -0700)
Description:
Route-tag is not set to external lsas originated by ospf when a routemap
applied by setting a specific tag. When applying a route-map on redistribution,
external lsas will be refreshed if there is any change in the route parametrs
after applying routemap. But changing tag is not handled here.
Added the apripriate fix to correct this.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
ospfd/ospf_zebra.c

index c7e6bd9cbf731f87cf245bbae215b7d93cb191e2..f3f54f7b51fb4ab6de95d1e90f525cf8caa6d003 100644 (file)
@@ -696,6 +696,7 @@ int ospf_redistribute_check(struct ospf *ospf, struct external_info *ei,
        struct ospf_redist *red;
        uint8_t type = is_prefix_default(&ei->p) ? DEFAULT_ROUTE : ei->type;
        unsigned short instance = is_prefix_default(&ei->p) ? 0 : ei->instance;
+       route_tag_t saved_tag = 0;
 
        if (changed)
                *changed = 0;
@@ -725,6 +726,7 @@ int ospf_redistribute_check(struct ospf *ospf, struct external_info *ei,
 
        save_values = ei->route_map_set;
        ospf_reset_route_map_set_values(&ei->route_map_set);
+       saved_tag = ei->tag;
 
        /* apply route-map if needed */
        red = ospf_redist_lookup(ospf, type, instance);
@@ -747,9 +749,13 @@ int ospf_redistribute_check(struct ospf *ospf, struct external_info *ei,
                }
 
                /* check if 'route-map set' changed something */
-               if (changed)
+               if (changed) {
                        *changed = !ospf_route_map_set_compare(
                                &ei->route_map_set, &save_values);
+
+                       /* check if tag is modified */
+                       *changed |= (saved_tag != ei->tag);
+               }
        }
 
        return 1;