]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospf6d/ospf6_route.c
Revert "ospf6d: fix LSAs remain in LSDB with an old router-id value"
[mirror_frr.git] / ospf6d / ospf6_route.c
index 2daf119c52f59a0966f3b4d42bed7370a1a9bca9..0a026785f47ca689d842de4fbc4ac3181424ebb0 100644 (file)
@@ -39,6 +39,7 @@
 #include "ospf6_zebra.h"
 
 DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_ROUTE,   "OSPF6 route");
+DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_ROUTE_TABLE, "OSPF6 route table");
 DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_NEXTHOP, "OSPF6 nexthop");
 DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_PATH,    "OSPF6 Path");
 
@@ -687,6 +688,9 @@ struct ospf6_route *ospf6_route_add(struct ospf6_route *route,
                if (node->info == old) {
                        node->info = route;
                        SET_FLAG(route->flag, OSPF6_ROUTE_BEST);
+                       if (IS_OSPF6_DEBUG_ROUTE(MEMORY))
+                               zlog_debug("%s:  replace old route %s",
+                                          __func__, buf);
                }
 
                if (old->prev)
@@ -744,12 +748,12 @@ struct ospf6_route *ospf6_route_add(struct ospf6_route *route,
                        UNSET_FLAG(next->flag, OSPF6_ROUTE_BEST);
                        SET_FLAG(route->flag, OSPF6_ROUTE_BEST);
                        if (IS_OSPF6_DEBUG_ROUTE(MEMORY))
-                               zlog_info(
+                               zlog_debug(
                                        "%s %p: route add %p cost %u: replacing previous best: %p cost %u",
                                        ospf6_route_table_name(table),
                                        (void *)table, (void *)route,
-                                       route->path.cost,
-                                       (void *)next, next->path.cost);
+                                       route->path.cost, (void *)next,
+                                       next->path.cost);
                }
 
                route->installed = now;
@@ -875,6 +879,9 @@ void ospf6_route_remove(struct ospf6_route *route,
                if (route->next && route->next->rnode == node) {
                        node->info = route->next;
                        SET_FLAG(route->next->flag, OSPF6_ROUTE_BEST);
+                       if (IS_OSPF6_DEBUG_ROUTE(MEMORY))
+                               zlog_debug("%s: remove route %s", __func__,
+                                          buf);
                } else {
                        node->info = NULL;
                        route->rnode = NULL;
@@ -1021,7 +1028,8 @@ void ospf6_route_remove_all(struct ospf6_route_table *table)
 struct ospf6_route_table *ospf6_route_table_create(int s, int t)
 {
        struct ospf6_route_table *new;
-       new = XCALLOC(MTYPE_OSPF6_ROUTE, sizeof(struct ospf6_route_table));
+       new = XCALLOC(MTYPE_OSPF6_ROUTE_TABLE,
+                     sizeof(struct ospf6_route_table));
        new->table = route_table_init();
        new->scope_type = s;
        new->table_type = t;
@@ -1033,7 +1041,7 @@ void ospf6_route_table_delete(struct ospf6_route_table *table)
        ospf6_route_remove_all(table);
        bf_free(table->idspace);
        route_table_finish(table->table);
-       XFREE(MTYPE_OSPF6_ROUTE, table);
+       XFREE(MTYPE_OSPF6_ROUTE_TABLE, table);
 }