diff options
author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2025-01-17 16:31:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-17 16:31:19 +0100 |
commit | 76ed8f61d83358120a273b31853e591cc8e12585 (patch) | |
tree | b0a7cd01836dd850aecbb7100239bb6cb5d6ac57 | |
parent | Merge pull request #17836 from pguibert6WIND/limit_comm_list_count (diff) | |
parent | zebra: Uninstall NHG in some situations (diff) | |
download | frr-master.tar.xz frr-master.zip |
-rw-r--r-- | zebra/zebra_nhg.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c index 712b2534c..4f6bc02c6 100644 --- a/zebra/zebra_nhg.c +++ b/zebra/zebra_nhg.c @@ -1762,7 +1762,8 @@ void zebra_nhg_decrement_ref(struct nhg_hash_entry *nhe) nhe->refcnt--; if (!zebra_router_in_shutdown() && nhe->refcnt <= 0 && - CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_INSTALLED) && + (CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_INSTALLED) || + CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_QUEUED)) && !CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_KEEP_AROUND)) { nhe->refcnt = 1; SET_FLAG(nhe->flags, NEXTHOP_GROUP_KEEP_AROUND); @@ -3382,7 +3383,17 @@ void zebra_nhg_install_kernel(struct nhg_hash_entry *nhe, uint8_t type) void zebra_nhg_uninstall_kernel(struct nhg_hash_entry *nhe) { - if (CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_INSTALLED)) { + /* + * Clearly if the nexthop group is installed we should + * remove it. Additionally If the nexthop is already + * QUEUED for installation, we should also just send + * a deletion down as well. We cannot necessarily pluck + * the installation out of the queue ( since it may have + * already been acted on, but not processed yet in the + * main pthread ). + */ + if (CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_INSTALLED) || + CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_QUEUED)) { int ret = dplane_nexthop_delete(nhe); switch (ret) { |