Skip to content

Commit

Permalink
Merge pull request #16757 from mjstapp/fix_ospfd_dlist_sa
Browse files Browse the repository at this point in the history
ospfd: add assert to resolve SA warning
  • Loading branch information
donaldsharp authored Sep 6, 2024
2 parents f3f96f9 + 2b2a12b commit 8d3d764
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ospfd/ospf_flood.c
Original file line number Diff line number Diff line change
Expand Up @@ -1094,8 +1094,13 @@ void ospf_ls_retransmit_add(struct ospf_neighbor *nbr, struct ospf_lsa *lsa)
if (ls_rxmt_node->lsa_list_entry ==
ospf_lsa_list_first(&nbr->ls_rxmt_list))
rxmt_head_replaced = true;

/* Keep SA happy */
assert(ls_rxmt_node->lsa_list_entry != NULL);

ospf_lsa_list_del(&nbr->ls_rxmt_list,
ls_rxmt_node->lsa_list_entry);

XFREE(MTYPE_OSPF_LSA_LIST, ls_rxmt_node->lsa_list_entry);
ospf_lsdb_delete(&nbr->ls_rxmt, old);
if (IS_DEBUG_OSPF(lsa, LSA_FLOODING))
Expand Down Expand Up @@ -1163,8 +1168,13 @@ void ospf_ls_retransmit_delete(struct ospf_neighbor *nbr, struct ospf_lsa *lsa)
rxmt_timer_reset = false;

lsa->retransmit_counter--;

/* Keep SA happy */
assert(ls_rxmt_node->lsa_list_entry != NULL);

ospf_lsa_list_del(&nbr->ls_rxmt_list,
ls_rxmt_node->lsa_list_entry);

XFREE(MTYPE_OSPF_LSA_LIST, ls_rxmt_node->lsa_list_entry);
ospf_lsdb_delete(&nbr->ls_rxmt, lsa);
if (IS_DEBUG_OSPF(lsa, LSA_FLOODING))
Expand Down

0 comments on commit 8d3d764

Please sign in to comment.