Merge pull request #14078 from raja-rajasekar/frr_dev1

zebra: fix nhe refcnt when frr service goes down
This commit is contained in:
Donatas Abraitis 2023-08-01 12:19:18 +03:00 committed by GitHub
commit 12e4a71b3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3638,7 +3638,18 @@ unsigned long zebra_nhg_score_proto(int type)
* This should be the last ref if we remove client routes too,
* and thus should remove and free them.
*/
zebra_nhg_decrement_ref(nhe);
if (!CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_PROTO_RELEASED))
zebra_nhg_decrement_ref(nhe);
else {
/* protocol sends explicit delete of nhg, the
* nhe->refcount is decremented in zread_nhg_del()
*/
if (IS_ZEBRA_DEBUG_RIB_DETAILED)
zlog_debug(
"%s: nhe %u (%p) refcount %u already decremented in zread_nhg_del",
__func__, nhe->id, nhe, nhe->refcnt);
}
}
count = iter.found->count;