Merge pull request #10814 from manojvn/2896483

ospf6d: observed crash in ospf6_decrement_retrans_count.
This commit is contained in:
Jafar Al-Gharaibeh 2022-03-21 22:45:01 -05:00 committed by GitHub
commit a51061fa50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 1 deletions

View File

@ -464,11 +464,28 @@ void ospf6_flood_interface(struct ospf6_neighbor *from, struct ospf6_lsa *lsa,
lsa->header->type, lsa->header->id,
lsa->header->adv_router, on->retrans_list);
if (!old) {
struct ospf6_lsa *orig;
struct ospf6_lsdb *lsdb;
if (is_debug)
zlog_debug(
"Increment %s from retrans_list of %s",
lsa->name, on->name);
ospf6_increment_retrans_count(lsa);
/* Increment the retrans count on the original
* copy of LSA if present, to maintain the
* counter consistency.
*/
lsdb = ospf6_get_scoped_lsdb(lsa);
orig = ospf6_lsdb_lookup(
lsa->header->type, lsa->header->id,
lsa->header->adv_router, lsdb);
if (orig)
ospf6_increment_retrans_count(orig);
else
ospf6_increment_retrans_count(lsa);
ospf6_lsdb_add(ospf6_lsa_copy(lsa),
on->retrans_list);
thread_add_timer(

View File

@ -132,6 +132,8 @@ void ospf6_lsdb_add(struct ospf6_lsa *lsa, struct ospf6_lsdb *lsdb)
(*lsdb->hook_add)(lsa);
}
} else {
lsa->retrans_count = old->retrans_count;
if (OSPF6_LSA_IS_CHANGED(old, lsa)) {
if (OSPF6_LSA_IS_MAXAGE(lsa)) {
if (lsdb->hook_remove) {