forked from Mirror/frr
Merge pull request #16720 from opensourcerouting/fix/default_originate_not_needed_if_not_enabled
bgpd: Do not scan update-groups if default-originate timer is set to 0
This commit is contained in:
commit
6109043c54
|
@ -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,
|
||||
|
|
|
@ -8417,7 +8417,7 @@ DEFPY (bgp_condadv_period,
|
|||
|
||||
DEFPY (bgp_def_originate_eval,
|
||||
bgp_def_originate_eval_cmd,
|
||||
"[no$no] bgp default-originate timer (0-3600)$timer",
|
||||
"[no$no] bgp default-originate timer (0-65535)$timer",
|
||||
NO_STR
|
||||
BGP_STR
|
||||
"Control default-originate\n"
|
||||
|
@ -8426,8 +8426,7 @@ DEFPY (bgp_def_originate_eval,
|
|||
{
|
||||
VTY_DECLVAR_CONTEXT(bgp, bgp);
|
||||
|
||||
bgp->rmap_def_originate_eval_timer =
|
||||
no ? RMAP_DEFAULT_ORIGINATE_EVAL_TIMER : timer;
|
||||
bgp->rmap_def_originate_eval_timer = no ? 0 : timer;
|
||||
|
||||
if (bgp->t_rmap_def_originate_eval)
|
||||
EVENT_OFF(bgp->t_rmap_def_originate_eval);
|
||||
|
@ -19792,8 +19791,9 @@ int bgp_config_write(struct vty *vty)
|
|||
bgp->condition_check_period);
|
||||
|
||||
/* default-originate timer configuration */
|
||||
if (bgp->rmap_def_originate_eval_timer !=
|
||||
RMAP_DEFAULT_ORIGINATE_EVAL_TIMER)
|
||||
if (bgp->rmap_def_originate_eval_timer &&
|
||||
bgp->rmap_def_originate_eval_timer !=
|
||||
RMAP_DEFAULT_ORIGINATE_EVAL_TIMER)
|
||||
vty_out(vty, " bgp default-originate timer %u\n",
|
||||
bgp->rmap_def_originate_eval_timer);
|
||||
|
||||
|
|
10
bgpd/bgpd.c
10
bgpd/bgpd.c
|
@ -3527,7 +3527,7 @@ static struct bgp *bgp_create(as_t *as, const char *name,
|
|||
bgp_addpath_init_bgp_data(&bgp->tx_addpath);
|
||||
bgp->fast_convergence = false;
|
||||
bgp->llgr_stale_time = BGP_DEFAULT_LLGR_STALE_TIME;
|
||||
bgp->rmap_def_originate_eval_timer = RMAP_DEFAULT_ORIGINATE_EVAL_TIMER;
|
||||
bgp->rmap_def_originate_eval_timer = 0;
|
||||
|
||||
#ifdef ENABLE_BGP_VNC
|
||||
if (inst_type != BGP_INSTANCE_TYPE_VRF) {
|
||||
|
@ -5791,6 +5791,10 @@ int peer_default_originate_set(struct peer *peer, afi_t afi, safi_t safi,
|
|||
subgrp = peer_subgroup(peer, afi, safi);
|
||||
|
||||
if (rmap) {
|
||||
if (!peer->bgp->rmap_def_originate_eval_timer)
|
||||
peer->bgp->rmap_def_originate_eval_timer =
|
||||
RMAP_DEFAULT_ORIGINATE_EVAL_TIMER;
|
||||
|
||||
if (!peer->default_rmap[afi][safi].name
|
||||
|| strcmp(rmap, peer->default_rmap[afi][safi].name) != 0) {
|
||||
struct route_map *map = NULL;
|
||||
|
@ -5873,6 +5877,10 @@ int peer_default_originate_set(struct peer *peer, afi_t afi, safi_t safi,
|
|||
if (rmap) {
|
||||
struct route_map *map = NULL;
|
||||
|
||||
if (!member->bgp->rmap_def_originate_eval_timer)
|
||||
member->bgp->rmap_def_originate_eval_timer =
|
||||
RMAP_DEFAULT_ORIGINATE_EVAL_TIMER;
|
||||
|
||||
if (member->default_rmap[afi][safi].name) {
|
||||
map = route_map_lookup_by_name(
|
||||
member->default_rmap[afi][safi].name);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue