Currently, if the routemap already exists, we delete the pointer to it
when it is updated. We should delete the pointer only if the route-map
is actually deleted.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
(cherry picked from commit
0fddd864b758f424eab484ea35f74479eda33fd2)
/* Keep old route-map. */
struct route_map *old = ROUTEMAP(red);
- if (!old) {
- /* Route-map creation */
- /* Update route-map. */
- ROUTEMAP(red) =
- route_map_lookup_by_name(
- ROUTEMAP_NAME(red));
-
- route_map_counter_increment(
- ROUTEMAP(red));
- } else {
- /* Route-map deletion */
- ROUTEMAP(red) = NULL;
- }
+ ROUTEMAP(red) =
+ route_map_lookup_by_name(
+ ROUTEMAP_NAME(red));
+
+ if (!old)
+ route_map_counter_increment(
+ ROUTEMAP(red));
+
/* No update for this distribute type.
*/
if (old == NULL