mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-09 13:19:17 +00:00
staticd: Reduce the frequency of adding routes
Signed-off-by: guozhongfeng.gzf <guozhongfeng.gzf@alibaba-inc.com>
This commit is contained in:
parent
ee5a3456d3
commit
c2f0206c3c
@ -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)
|
uint32_t nh_num, vrf_id_t nh_vrf_id)
|
||||||
{
|
{
|
||||||
struct static_nexthop *nh;
|
struct static_nexthop *nh;
|
||||||
|
bool route_changed = false;
|
||||||
|
|
||||||
frr_each(static_nexthop_list, &pn->nexthop_list, nh) {
|
frr_each(static_nexthop_list, &pn->nexthop_list, nh) {
|
||||||
if (nh->nh_vrf_id != nh_vrf_id)
|
if (nh->nh_vrf_id != nh_vrf_id)
|
||||||
@ -42,8 +43,10 @@ static void static_nht_update_path(struct static_path *pn, struct prefix *nhp,
|
|||||||
nh->nh_valid = !!nh_num;
|
nh->nh_valid = !!nh_num;
|
||||||
|
|
||||||
if (nh->state == STATIC_START)
|
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,
|
static void static_nht_update_safi(struct prefix *sp, struct prefix *nhp,
|
||||||
|
Loading…
Reference in New Issue
Block a user