Skip to content

Commit

Permalink
Merge pull request #17726 from guoguojia2021/static_fix
Browse files Browse the repository at this point in the history
staticd: Reduce the frequency of adding routes
  • Loading branch information
ton31337 authored Jan 2, 2025
2 parents f3daeda + c2f0206 commit 352b97f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion staticd/static_nht.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ static void static_nht_update_path(struct static_path *pn, struct prefix *nhp,
uint32_t nh_num, vrf_id_t nh_vrf_id)
{
struct static_nexthop *nh;
bool route_changed = false;

frr_each(static_nexthop_list, &pn->nexthop_list, nh) {
if (nh->nh_vrf_id != nh_vrf_id)
Expand All @@ -42,8 +43,10 @@ static void static_nht_update_path(struct static_path *pn, struct prefix *nhp,
nh->nh_valid = !!nh_num;

if (nh->state == STATIC_START)
static_zebra_route_add(pn, true);
route_changed = true;
}
if (route_changed)
static_zebra_route_add(pn, true);
}

static void static_nht_update_safi(struct prefix *sp, struct prefix *nhp,
Expand Down

0 comments on commit 352b97f

Please sign in to comment.