]> git.proxmox.com Git - mirror_frr.git/commitdiff
ospf6d: Added changes to track route-map usage
authorrgirada <rgirada@vmware.com>
Mon, 4 Feb 2019 13:16:25 +0000 (05:16 -0800)
committerrgirada <rgirada@vmware.com>
Mon, 4 Feb 2019 13:16:25 +0000 (05:16 -0800)
Made changes and updated the routemap applied
counter in the following flows.
1.Increment the routemap applied counter when route map
  attached to a redistribution list.
  The counter will be updated if the routemap exists.
2.Decrement when route map removed / modified from a
  redistribution  list.
3.Increment/decrement when route map create/delete
  callback triggered.

Signed-off-by: RajeshGirada <rgirada@vmware.com>
ospf6d/ospf6_asbr.c

index 671267aa05e7ace5f568db226f6db7af91ae3615..3153c29aa18ae66998f3b68435536a78f8b0b68a 100644 (file)
@@ -856,16 +856,22 @@ void ospf6_asbr_lsentry_remove(struct ospf6_route *asbr_entry)
 
 static void ospf6_asbr_routemap_set(int type, const char *mapname)
 {
-       if (ospf6->rmap[type].name)
+       if (ospf6->rmap[type].name) {
+               route_map_counter_decrement(ospf6->rmap[type].map);
                free(ospf6->rmap[type].name);
+       }
        ospf6->rmap[type].name = strdup(mapname);
        ospf6->rmap[type].map = route_map_lookup_by_name(mapname);
+       route_map_counter_increment(ospf6->rmap[type].map);
 }
 
 static void ospf6_asbr_routemap_unset(int type)
 {
        if (ospf6->rmap[type].name)
                free(ospf6->rmap[type].name);
+
+       route_map_counter_decrement(ospf6->rmap[type].map);
+
        ospf6->rmap[type].name = NULL;
        ospf6->rmap[type].map = NULL;
 }
@@ -939,6 +945,10 @@ static void ospf6_asbr_routemap_update(const char *mapname)
                                                "%s: route-map %s update, reset redist %s",
                                                __PRETTY_FUNCTION__, mapname,
                                                ZROUTE_NAME(type));
+
+                               route_map_counter_increment(
+                                       ospf6->rmap[type].map);
+
                                ospf6_asbr_distribute_list_update(type);
                        }
                } else