From 057be82cc48c3ccc256270caed4d46e66d822a24 Mon Sep 17 00:00:00 2001 From: Alex Kudentsov <43482574+alexk37@users.noreply.github.com> Date: Wed, 7 Oct 2026 02:25:50 +0700 Subject: bgp: T9407: do not render "bgp reject-as-sets" when it is the FRR default Since FRR 10.5 "bgp reject-as-sets" is the default. FRR does not print the default in show running-config, so frr-reload never finds the line in the running config and sends it again on every reload. The command handler resets every BGP session of the instance (NOTIFICATION Cease, other configuration change) whether or not the value changed, so with "protocols bgp parameters reject-as-sets" set, every commit that reloads FRR reset every established session, not only commits that touch BGP. Render only the non-default form: "no bgp reject-as-sets" when the option is not set, as T7664 added it, and nothing when it is set. The option is a valueless leaf, so it has no XML default to read; the rendered "no" form already was the only place that knows what FRR's default is. Changing the option still reaches FRR: frr-reload sends "bgp reject-as-sets" when the option is set (the "no" line leaves the rendered config) and "no bgp reject-as-sets" when it is deleted, and each change resets the sessions once, as before. Add a smoketest that reads the rendered /run/frr/config/vyos.frr.conf, because FRR never prints the default form and vtysh cannot show it. --- data/templates/frr/bgpd.frr.j2 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'data') diff --git a/data/templates/frr/bgpd.frr.j2 b/data/templates/frr/bgpd.frr.j2 index 7671576d1..f84f10126 100644 --- a/data/templates/frr/bgpd.frr.j2 +++ b/data/templates/frr/bgpd.frr.j2 @@ -673,9 +673,11 @@ router bgp {{ system_as }} {{ 'vrf ' ~ vrf if vrf is vyos_defined }} {{ 'as-nota {% if parameters.no_suppress_duplicates is vyos_defined %} no bgp suppress-duplicates {% endif %} -{% if parameters.reject_as_sets is vyos_defined %} - bgp reject-as-sets -{% else %} +{# FRR 10.5+ defaults to "bgp reject-as-sets" and does not print the default + in show running-config. frr-reload would find the line missing on every + reload and send it again, and FRR resets every peer for each application. + Only the non-default form is rendered. #} +{% if parameters.reject_as_sets is not vyos_defined %} no bgp reject-as-sets {% endif %} {% if parameters.router_id is vyos_defined and parameters.router_id is not none %} -- cgit v1.2.3