From 16b20ad0628ee98537c79ae7e018303ad1de8aca Mon Sep 17 00:00:00 2001 From: Stephen Worley Date: Sun, 10 May 2020 17:34:35 -0400 Subject: [PATCH] zebra: dont update counter if outside of zebra ID range When we receive a NHG from the kernel, we set the ID counter to that to avoid using IDs owned from the kernel. If we get one outside of zebra's range, lets not update it since its probably one we created and never deleted anyway. Signed-off-by: Stephen Worley --- zebra/zebra_nhg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c index 617a3def62..74551e31c4 100644 --- a/zebra/zebra_nhg.c +++ b/zebra/zebra_nhg.c @@ -1246,7 +1246,7 @@ int zebra_nhg_kernel_find(uint32_t id, struct nexthop *nh, struct nh_grp *grp, zlog_debug("%s: nh %pNHv, id %u, count %d", __func__, nh, id, (int)count); - if (id > id_counter) + if (id > id_counter && id < zclient_get_nhg_lower_bound()) /* Increase our counter so we don't try to create * an ID that already exists */ -- 2.39.5