Skip to content

Commit

Permalink
Merge pull request FRRouting#13892 from ryndia/fix_ospf6_lsa_leak
Browse files Browse the repository at this point in the history
ospf6d: unlock lsa
  • Loading branch information
ton31337 authored Jul 4, 2023
2 parents 786bc97 + b3420b1 commit e8996e1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions ospf6d/ospf6_gr.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,10 @@ static int ospf6_router_lsa_contains_adj(struct ospf6_area *area,
if (lsdesc->type != OSPF6_ROUTER_LSDESC_POINTTOPOINT)
continue;

if (lsdesc->neighbor_router_id == neighbor_router_id)
if (lsdesc->neighbor_router_id == neighbor_router_id) {
ospf6_lsa_unlock(lsa);
return RTR_LSA_ADJ_FOUND;
}
}
}

Expand Down Expand Up @@ -511,8 +513,10 @@ static bool ospf6_gr_check_adjs(struct ospf6 *ospf6)
for (ALL_LSDB_TYPED_ADVRTR(area->lsdb, type, router,
lsa_self)) {
found = true;
if (!ospf6_gr_check_adjs_lsa(area, lsa_self))
if (!ospf6_gr_check_adjs_lsa(area, lsa_self)) {
ospf6_lsa_unlock(lsa_self);
return false;
}
}
if (!found)
return false;
Expand Down
4 changes: 3 additions & 1 deletion ospf6d/ospf6_lsdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,10 @@ struct ospf6_lsa *ospf6_find_inter_prefix_lsa(struct ospf6 *ospf6,
prefix.prefixlen = prefix_lsa->prefix.prefix_length;
ospf6_prefix_in6_addr(&prefix.u.prefix6, prefix_lsa,
&prefix_lsa->prefix);
if (prefix_same(p, &prefix))
if (prefix_same(p, &prefix)) {
ospf6_lsa_unlock(lsa);
return lsa;
}
}

return NULL;
Expand Down

0 comments on commit e8996e1

Please sign in to comment.