From d12306d3e0b86c7fa6ea848b422a830a31384ccf Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Mon, 2 Sep 2024 15:02:10 +0300 Subject: [PATCH] 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 --- bgpd/bgp_route.c | 3 ++- doc/user/bgp.rst | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 3ff7dbc070..eda5e94b7b 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -3757,7 +3757,8 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_dest *dest, if (old_select || new_select) { 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( bm->master, update_group_refresh_default_originate_route_map, diff --git a/doc/user/bgp.rst b/doc/user/bgp.rst index aa62d274f0..c6f9aabad3 100644 --- a/doc/user/bgp.rst +++ b/doc/user/bgp.rst @@ -1972,12 +1972,14 @@ Configuring Peers and will not be displayed as part of a `show run`. The no form 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 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. + Setting to 0 turns off the scanning at all. + .. clicmd:: bgp default ipv4-unicast This command allows the user to specify that the IPv4 Unicast address