From c46b3c3f04e2b025cd40193d2665505f725de871 Mon Sep 17 00:00:00 2001 From: Alex Kudentsov <43482574+alexk37@users.noreply.github.com> Date: Sun, 18 Oct 2026 16:30:20 +0700 Subject: bgp: T9450: do not re-render the default conditional-advertisement timer The CLI's XML default for "bgp conditional-advertisement timer" (60) is always present in the config dict, so the line was rendered on every commit. FRR's own default is the same value (DEFAULT_CONDITIONAL_ROUTES_POLL_TIME, bgpd/bgp_conditional_adv.h) and bgp_config_write() never prints it back when the value equals the default, so frr-reload saw the line missing on every reload and sent it again, both in the default instance and in every VRF instance. Templates cannot query the XML definition while rendering, so frrender takes the value from the config defaults of "parameters conditional-advertisement" (conf.get_config_defaults) and adds it to the BGP dict as the key xml_default_conditional_advertisement_timer, for the global instance and for every VRF instance, the same pattern used for "bgp default local-preference" (T9404). bgpd.frr.j2 renders the line only when the configured value differs from xml_default_conditional_advertisement_timer, comparing both as integers so a timer entered as "060" is still treated as 60. --- python/vyos/frrender.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'python') diff --git a/python/vyos/frrender.py b/python/vyos/frrender.py index 7d1401d2c..6a8124325 100644 --- a/python/vyos/frrender.py +++ b/python/vyos/frrender.py @@ -334,6 +334,13 @@ def get_frrender_dict(conf: Config, argv=None) -> dict: tmp = conf.get_config_defaults(bgp_cli_path + ['parameters', 'default'], key_mangling=('-', '_'), get_first_key=True) bgp['xml_default_local_pref'] = tmp.get('local_pref') + # Same pattern for "parameters conditional-advertisement timer". + tmp = conf.get_config_defaults( + bgp_cli_path + ['parameters', 'conditional-advertisement'], + key_mangling=('-', '_'), + get_first_key=True, + ) + bgp['xml_default_conditional_advertisement_timer'] = tmp.get('timer') dict.update({'bgp' : bgp}) elif conf.exists_effective(bgp_cli_path): dict.update({'bgp' : {'deleted' : '', 'dependent_vrfs' : {}}}) @@ -562,6 +569,12 @@ def get_frrender_dict(conf: Config, argv=None) -> dict: vrf_config['protocols']['bgp']['xml_default_local_pref'] = dict_search( 'parameters.default.local_pref', default_values) + vrf_config['protocols']['bgp'][ + 'xml_default_conditional_advertisement_timer' + ] = dict_search( + 'parameters.conditional_advertisement.timer', default_values + ) + # Add this BGP VRF instance as dependency into the default VRF if 'bgp' in dict: dict['bgp']['dependent_vrfs'].update({vrf_name : deepcopy(vrf_config)}) -- cgit v1.2.3