summaryrefslogtreecommitdiffstats
path: root/ospf6d/ospf6_abr.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospf6d/ospf6_abr.c')
-rw-r--r--ospf6d/ospf6_abr.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/ospf6d/ospf6_abr.c b/ospf6d/ospf6_abr.c
index 57165201b..057e1d9ea 100644
--- a/ospf6d/ospf6_abr.c
+++ b/ospf6d/ospf6_abr.c
@@ -53,6 +53,17 @@
unsigned char conf_debug_ospf6_abr;
+int ospf6_ls_origin_cmp(struct ospf6_path *o_path, struct ospf6_route *route)
+{
+ if (((o_path->origin.type == route->path.origin.type)
+ && (o_path->origin.id == route->path.origin.id)
+ && (o_path->origin.adv_router ==
+ route->path.origin.adv_router)))
+ return 1;
+ else
+ return 0;
+}
+
bool ospf6_check_and_set_router_abr(struct ospf6 *o)
{
struct listnode *node;
@@ -816,8 +827,7 @@ void ospf6_abr_old_path_update(struct ospf6_route *old_route,
for (ALL_LIST_ELEMENTS(old_route->paths, anode, anext, o_path)) {
if (o_path->area_id != route->path.area_id ||
- (memcmp(&(o_path)->origin, &(route)->path.origin,
- sizeof(struct ospf6_ls_origin)) != 0))
+ (!ospf6_ls_origin_cmp(o_path, route)))
continue;
if ((o_path->cost == route->path.cost) &&
@@ -1233,8 +1243,7 @@ void ospf6_abr_examin_summary(struct ospf6_lsa *lsa, struct ospf6_area *oa)
for (ALL_LIST_ELEMENTS_RO(old_route->paths, anode,
o_path)) {
if (o_path->area_id == route->path.area_id &&
- (memcmp(&(o_path)->origin, &(route)->path.origin,
- sizeof(struct ospf6_ls_origin)) == 0))
+ (ospf6_ls_origin_cmp(o_path, route)))
break;
}