summaryrefslogtreecommitdiff
path: root/src/conf_mode/protocols_ospfv3.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-08-12 08:58:17 +0200
committerChristian Breunig <christian@breunig.cc>2023-08-12 09:01:48 +0200
commit011697508b1ffe88d3d6a6ffd2d29e328737371a (patch)
tree046500622193f9536d661e5ae4c08ca6cf077e2f /src/conf_mode/protocols_ospfv3.py
parent073961a5c833ca820a197c3635138b14e2b16cd7 (diff)
downloadvyos-1x-011697508b1ffe88d3d6a6ffd2d29e328737371a.tar.gz
vyos-1x-011697508b1ffe88d3d6a6ffd2d29e328737371a.zip
T5467: removing ospf(v3) or isis interface in VRF context did not clear FRR config
To reproduce: set vrf name red table 2000 set vrf name red protocols ospf interface eth1 area 0 set vrf name red protocols ospf parameters router-id 1.1.1.1 set interfaces ethernet eth1 vrf red commit FRR now has an interface config vyos@vyos# vtysh -c "show run" no-header | sed -n "/^interface eth1/,/!/p" interface eth1 ip ospf area 0 ip ospf dead-interval 40 exit Now delete the interface from the OSPF(v3) or ISIS process delete vrf name red protocols ospf interface commit It's still there vyos@vyos# vtysh -c "show run" no-header | sed -n "/^interface eth1/,/!/p" interface eth1 ip ospf area 0 ip ospf dead-interval 40 exit ! Issue was caused in the FRR vtysh representation of an interface. It used to have a "vrf <name>" marker in earlier versions but FRR 8.5 and later no longer have the marker. So "interface eth1 vrf red" became "interface eth1" in vtysh, but our regex expected the "vrf" identifier when modifying FRR config.
Diffstat (limited to 'src/conf_mode/protocols_ospfv3.py')
-rwxr-xr-xsrc/conf_mode/protocols_ospfv3.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/conf_mode/protocols_ospfv3.py b/src/conf_mode/protocols_ospfv3.py
index e68fa1fe6..5b1adce30 100755
--- a/src/conf_mode/protocols_ospfv3.py
+++ b/src/conf_mode/protocols_ospfv3.py
@@ -64,7 +64,8 @@ def get_config(config=None):
if interfaces_removed:
ospfv3['interface_removed'] = list(interfaces_removed)
- # Bail out early if configuration tree does not exist
+ # Bail out early if configuration tree does no longer exist. this must
+ # be done after retrieving the list of interfaces to be removed.
if not conf.exists(base):
ospfv3.update({'deleted' : ''})
return ospfv3
@@ -166,7 +167,7 @@ def apply(ospfv3):
if key not in ospfv3:
continue
for interface in ospfv3[key]:
- frr_cfg.modify_section(f'^interface {interface}{vrf}', stop_pattern='^exit', remove_stop_mark=True)
+ frr_cfg.modify_section(f'^interface {interface}', stop_pattern='^exit', remove_stop_mark=True)
if 'new_frr_config' in ospfv3:
frr_cfg.add_before(frr.default_add_before, ospfv3['new_frr_config'])