diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2021-05-31 15:27:51 +0200 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2021-06-08 16:41:33 +0200 |
commit | 69843e810acc27b152c19fe91bb2e9b67f808108 (patch) | |
tree | 22f740229eec38d91b1c7be1cbb642218456b184 /ospfd/ospfd.c | |
parent | ospfd: fix null pointer dereference when flushing an opaque LSA (diff) | |
download | frr-69843e810acc27b152c19fe91bb2e9b67f808108.tar.xz frr-69843e810acc27b152c19fe91bb2e9b67f808108.zip |
ospfd: fix cleanup of MaxAge LSAs on exit
During shutdown, the ospf->maxage_lsa table is iterated over to
clean up all existing entries. While doing that, route_unlock_node()
should be called only for the nodes that have an associated entry,
otherwise the table will get corrupted and ospfd will crash.
As a side note, using a routing table to store MaxAge LSAs was a
very poor choice of a data structure, considering that a simple
rb-tree or hash table would get the job done with a much simpler
(and less error-prone) API. Something to cleanup in the future...
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ospfd/ospfd.c')
-rw-r--r-- | ospfd/ospfd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c index 106ce3bd7..d053bdabb 100644 --- a/ospfd/ospfd.c +++ b/ospfd/ospfd.c @@ -828,8 +828,8 @@ static void ospf_finish_final(struct ospf *ospf) if ((lsa = rn->info) != NULL) { ospf_lsa_unlock(&lsa); rn->info = NULL; + route_unlock_node(rn); } - route_unlock_node(rn); } route_table_finish(ospf->maxage_lsa); |