]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: fix routemap update
authorIgor Ryzhov <iryzhov@nfware.com>
Thu, 17 Jun 2021 16:31:03 +0000 (19:31 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Fri, 18 Jun 2021 13:59:52 +0000 (16:59 +0300)
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>
ospfd/ospf_routemap.c

index d3b114840ee2e38a1d0cb5ce43a6bd836cbc53c3..2525c1cf3ac2a9cf10628493517357022497f0b8 100644 (file)
@@ -71,19 +71,14 @@ static void ospf_route_map_update(const char *name)
                                        /* 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