staticd: fix route installation on same next hop

When two routes have the same inactive next hop the second (third and so
on) route installation won't happen, because a global next hop
reference already exists. Add the code to install the route in case
global next hop entry already exists and the next hop is inactive.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
Rafael Zalamena 2025-03-07 13:44:31 -03:00 committed by Martin Winter
parent 3f785c913d
commit 9be6b2082e
No known key found for this signature in database
GPG key ID: 05A4ECF8C0102306

View file

@ -365,9 +365,13 @@ void static_zebra_nht_register(struct static_nexthop *nh, bool reg)
return;
}
if (nhtd->registered)
if (nhtd->registered) {
/* have no data, but did send register */
afi_t afi = prefix_afi(&lookup.nh);
static_nht_update(p, src_p, &nhtd->nh, nhtd->nh_num, afi, si->safi,
nh->nh_vrf_id);
return;
}
cmd = ZEBRA_NEXTHOP_REGISTER;
DEBUGD(&static_dbg_route, "Registering nexthop(%pFX) for %pRN",