bgpd: Do not scan update-groups if default-originate timer is set to 0

With lots of update-groups, subgroups, this could be very tricky and the timer
is spawned even if it's totally unnecessary (default-originate is not enabled).

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
Donatas Abraitis 2024-09-02 15:02:10 +03:00
parent 8412fa8f98
commit d12306d3e0
2 changed files with 5 additions and 2 deletions

View File

@ -3757,7 +3757,8 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_dest *dest,
if (old_select || new_select) { if (old_select || new_select) {
bgp_bump_version(dest); bgp_bump_version(dest);
if (!bgp->t_rmap_def_originate_eval) if (!bgp->t_rmap_def_originate_eval &&
bgp->rmap_def_originate_eval_timer)
event_add_timer( event_add_timer(
bm->master, bm->master,
update_group_refresh_default_originate_route_map, update_group_refresh_default_originate_route_map,

View File

@ -1972,12 +1972,14 @@ Configuring Peers
and will not be displayed as part of a `show run`. The no form and will not be displayed as part of a `show run`. The no form
of the command turns off this ability. of the command turns off this ability.
.. clicmd:: bgp default-originate timer (0-3600) .. clicmd:: bgp default-originate timer (0-65535)
Set the period to rerun the default-originate route-map scanner process. The Set the period to rerun the default-originate route-map scanner process. The
default is 5 seconds. With a full routing table, it might be useful to increase default is 5 seconds. With a full routing table, it might be useful to increase
this setting to avoid scanning the whole BGP table aggressively. this setting to avoid scanning the whole BGP table aggressively.
Setting to 0 turns off the scanning at all.
.. clicmd:: bgp default ipv4-unicast .. clicmd:: bgp default ipv4-unicast
This command allows the user to specify that the IPv4 Unicast address This command allows the user to specify that the IPv4 Unicast address