]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospf6d: remove meaningless ospf6_route_is_identical
authorIgor Ryzhov <iryzhov@nfware.com>
Mon, 15 Nov 2021 16:27:27 +0000 (19:27 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Mon, 15 Nov 2021 16:27:27 +0000 (19:27 +0300)
As part of the check, it memcompares two structs ospf6_path. This struct
has a pointer field nh_list which is allocated every time a new path is
created, which means it can never be the same for two different paths.
Therefore this check is always false and can be completely removed.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
ospf6d/ospf6_route.c
ospf6d/ospf6_route.h

index 35b567c768ddbfdac5ca5dae11c56df97d6b3f58..92fcbf71e8347dcf193abe2e82200b5d9505554d 100644 (file)
@@ -704,27 +704,6 @@ struct ospf6_route *ospf6_route_add(struct ospf6_route *route,
        }
 
        if (old) {
-               /* if route does not actually change, return unchanged */
-               if (ospf6_route_is_identical(old, route)) {
-                       if (IS_OSPF6_DEBUG_ROUTE(MEMORY))
-                               zlog_debug(
-                                       "%s %p: route add %p: needless update of %p old cost %u",
-                                       ospf6_route_table_name(table),
-                                       (void *)table, (void *)route,
-                                       (void *)old, old->path.cost);
-                       else if (IS_OSPF6_DEBUG_ROUTE(TABLE))
-                               zlog_debug("%s: route add: needless update",
-                                          ospf6_route_table_name(table));
-
-                       ospf6_route_delete(route);
-                       SET_FLAG(old->flag, OSPF6_ROUTE_ADD);
-                       ospf6_route_table_assert(table);
-
-                       /* to free the lookup lock */
-                       route_unlock_node(node);
-                       return old;
-               }
-
                if (IS_OSPF6_DEBUG_ROUTE(MEMORY))
                        zlog_debug(
                                "%s %p: route add %p cost %u paths %u nh %u: update of %p cost %u paths %u nh %u",
index fd8b6a9c1dbf1eea2116c6533ff74830c176507b..8be65fa349dd4cb335c66c394fd223fe25fd443b 100644 (file)
@@ -299,12 +299,6 @@ extern const char *const ospf6_path_type_substr[OSPF6_PATH_TYPE_MAX];
         && memcmp(&(ra)->path.origin, &(rb)->path.origin,                     \
                   sizeof(struct ospf6_ls_origin))                             \
                    == 0)
-#define ospf6_route_is_identical(ra, rb)                                       \
-       ((ra)->type == (rb)->type                                              \
-        && memcmp(&(ra)->prefix, &(rb)->prefix, sizeof(struct prefix)) == 0   \
-        && memcmp(&(ra)->path, &(rb)->path, sizeof(struct ospf6_path)) == 0   \
-        && listcount(ra->paths) == listcount(rb->paths)                       \
-        && ospf6_route_cmp_nexthops(ra, rb) == 0)
 
 #define ospf6_route_is_best(r) (CHECK_FLAG ((r)->flag, OSPF6_ROUTE_BEST))