From c70a815437fdeed798f9a903873e7d95320bdb12 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 11 Apr 2021 17:40:13 +0200 Subject: bgp: T3328: route-map to zebra/kernel can not be removed Removing the Zebra/Linux Kernel route-map added by "set protocols bgp route-map" was not removed once applied. This was because the removal must happen within the zebra daemon and not bgpd. --- src/conf_mode/protocols_bgp.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/conf_mode') diff --git a/src/conf_mode/protocols_bgp.py b/src/conf_mode/protocols_bgp.py index ae210cf20..6b83087bf 100755 --- a/src/conf_mode/protocols_bgp.py +++ b/src/conf_mode/protocols_bgp.py @@ -34,8 +34,6 @@ from vyos import frr from vyos import airbag airbag.enable() -frr_daemon = 'bgpd' - def get_config(config=None): if config: conf = config @@ -205,25 +203,33 @@ def generate(bgp): return None def apply(bgp): + bgp_daemon = 'bgpd' + zebra_daemon = 'zebra' + # Save original configuration prior to starting any commit actions frr_cfg = frr.FRRConfig() - frr_cfg.load_configuration(frr_daemon) + + # The route-map used for the FIB (zebra) is part of the zebra daemon + frr_cfg.load_configuration(zebra_daemon) + frr_cfg.modify_section(r'^ip protocol bgp route-map [-a-zA-Z0-9.]+$', '') + frr_cfg.commit_configuration(zebra_daemon) # Generate empty helper string which can be ammended to FRR commands, it # will be either empty (default VRF) or contain the "vrf