summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-04-11 19:23:10 +0200
committerChristian Poessinger <christian@poessinger.com>2021-04-12 21:16:19 +0200
commit5d9238f1d7f8d19893537a8076031903e8fea271 (patch)
tree213fd704444a8ecdd75fc7c7b083adacab0870b4 /src/conf_mode
parent46391367806834f0f8e60f0894da6b91711d51bc (diff)
downloadvyos-1x-5d9238f1d7f8d19893537a8076031903e8fea271.tar.gz
vyos-1x-5d9238f1d7f8d19893537a8076031903e8fea271.zip
rip: T3328: route-map to zebra/kernel can not be removed
Removing the Zebra/Linux Kernel route-map added by "set protocols rip route-map" was not removed once applied. This was because the removal must happen within the zebra daemon and not ripd.
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/protocols_rip.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/conf_mode/protocols_rip.py b/src/conf_mode/protocols_rip.py
index b48289dec..c1bf2c9dd 100755
--- a/src/conf_mode/protocols_rip.py
+++ b/src/conf_mode/protocols_rip.py
@@ -32,8 +32,6 @@ from vyos import frr
from vyos import airbag
airbag.enable()
-frr_daemon = 'ripd'
-
def get_config(config=None):
if config:
conf = config
@@ -101,20 +99,30 @@ def generate(rip):
return None
def apply(rip):
+ rip_daemon = 'ripd'
+ 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 rip route-map [-a-zA-Z0-9.]+$', '')
+ frr_cfg.commit_configuration(zebra_daemon)
+
+ frr_cfg.load_configuration(rip_daemon)
frr_cfg.modify_section(r'key chain \S+', '')
frr_cfg.modify_section(r'interface \S+', '')
- frr_cfg.modify_section('router rip', '')
+ frr_cfg.modify_section('^router rip$', '')
+
frr_cfg.add_before(r'(ip prefix-list .*|route-map .*|line vty)', rip['new_frr_config'])
- frr_cfg.commit_configuration(frr_daemon)
+ frr_cfg.commit_configuration(rip_daemon)
# If FRR config is blank, rerun the blank commit x times due to frr-reload
# behavior/bug not properly clearing out on one commit.
if rip['new_frr_config'] == '':
for a in range(5):
- frr_cfg.commit_configuration(frr_daemon)
+ frr_cfg.commit_configuration(rip_daemon)
# Save configuration to /run/frr/config/frr.conf
frr.save_configuration()