From e27942887e7283fe79f39870965c42a3e63acfa2 Mon Sep 17 00:00:00 2001 From: Nataliia Solomko Date: Wed, 3 Jun 2026 18:09:12 +0300 Subject: frr: T7931: Do not restart FRR on unrelated config changes when VRF protocols are configured FRR was restarted on every commit when VRF protocols were configured, even when no routing-related configuration changed. Root cause: the rendering loop mutated `config_dict` in-place by injecting a `vrf` key into each VRF protocol sub-dict, polluting `cached_config_dict` which holds a reference to the same object, causing the equality check to always fail on the next commit. --- python/vyos/frrender.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'python') diff --git a/python/vyos/frrender.py b/python/vyos/frrender.py index ff69f8266..27b8b8568 100644 --- a/python/vyos/frrender.py +++ b/python/vyos/frrender.py @@ -813,10 +813,15 @@ class FRRender: for vrf, vrf_config in config_dict['vrf']['name'].items(): if 'protocols' not in vrf_config: continue - for protocol in vrf_config['protocols']: - vrf_config['protocols'][protocol]['vrf'] = vrf - output += inline_helper(vrf_config['protocols']) + # Do not mutate config_dict in-place — it is also stored as + # cached_config_dict and in-place mutation breaks change + # detection on the next commit (T7931). + protocols = { + protocol: {**proto_dict, 'vrf': vrf} + for protocol, proto_dict in vrf_config['protocols'].items() + } + output += inline_helper(protocols) # remove any accidentally added empty newline to not confuse FRR output = os.linesep.join([s for s in output.splitlines() if s]) -- cgit v1.2.3