]> git.puffer.fish Git - matthieu/frr.git/commitdiff
Merge pull request #5270 from NaveenThanikachalam/rmap
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 25 Feb 2020 14:15:49 +0000 (09:15 -0500)
committerGitHub <noreply@github.com>
Tue, 25 Feb 2020 14:15:49 +0000 (09:15 -0500)
lib: Optimizing route-maps

1  2 
lib/routemap.c

diff --cc lib/routemap.c
index e214aa43b7a37b33cee7cda0a4af0ae1b2e4295b,b73940e743c535f67519e4056720f7d98e8243d0..54b5383173079df535d0a7dda58cd2b5f5e89192
@@@ -924,12 -971,21 +972,21 @@@ void route_map_index_delete(struct rout
                           index->map->name, index->pref);
  
        /* Free route map northbound hook contexts. */
 -      while (!TAILQ_EMPTY(&index->rhclist))
 -              routemap_hook_context_free(TAILQ_FIRST(&index->rhclist));
 +      while ((rhc = TAILQ_FIRST(&index->rhclist)) != NULL)
 +              routemap_hook_context_free(rhc);
  
        /* Free route match. */
-       while ((rule = index->match_list.head) != NULL)
+       while ((rule = index->match_list.head) != NULL) {
+               if (IS_RULE_IPv4_PREFIX_LIST(rule->cmd->str))
+                       route_map_pfx_tbl_update(RMAP_EVENT_PLIST_DELETED,
+                                                index, AFI_IP, rule->rule_str);
+               else if (IS_RULE_IPv6_PREFIX_LIST(rule->cmd->str))
+                       route_map_pfx_tbl_update(RMAP_EVENT_PLIST_DELETED,
+                                                index, AFI_IP6,
+                                                rule->rule_str);
                route_map_rule_delete(&index->match_list, rule);
+       }
  
        /* Free route set. */
        while ((rule = index->set_list.head) != NULL)